From 35a598dbac1ba909e87c70934651e9b463b6286b Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 7 Jun 2022 15:24:24 -0400 Subject: [PATCH] feat: add v2alpha/v2beta clients (#452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add v2alpha/v2beta clients * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix version Co-authored-by: Owl Bot --- .github/.OwlBot.yaml | 6 +- google-cloud-retail-bom/pom.xml | 20 + google-cloud-retail/pom.xml | 18 + .../retail/v2alpha/CatalogServiceClient.java | 1442 ++ .../v2alpha/CatalogServiceSettings.java | 307 + .../v2alpha/CompletionServiceClient.java | 382 + .../v2alpha/CompletionServiceSettings.java | 213 + .../retail/v2alpha/ControlServiceClient.java | 854 + .../v2alpha/ControlServiceSettings.java | 231 + .../v2alpha/PredictionServiceClient.java | 251 + .../v2alpha/PredictionServiceSettings.java | 184 + .../retail/v2alpha/ProductServiceClient.java | 2407 +++ .../v2alpha/ProductServiceSettings.java | 414 + .../retail/v2alpha/SearchServiceClient.java | 431 + .../retail/v2alpha/SearchServiceSettings.java | 187 + .../v2alpha/ServingConfigServiceClient.java | 1163 ++ .../v2alpha/ServingConfigServiceSettings.java | 260 + .../v2alpha/UserEventServiceClient.java | 586 + .../v2alpha/UserEventServiceSettings.java | 269 + .../cloud/retail/v2alpha/gapic_metadata.json | 213 + .../cloud/retail/v2alpha/package-info.java | 207 + .../v2alpha/stub/CatalogServiceStub.java | 108 + .../stub/CatalogServiceStubSettings.java | 617 + .../v2alpha/stub/CompletionServiceStub.java | 63 + .../stub/CompletionServiceStubSettings.java | 367 + .../v2alpha/stub/ControlServiceStub.java | 70 + .../stub/ControlServiceStubSettings.java | 429 + .../GrpcCatalogServiceCallableFactory.java | 115 + .../v2alpha/stub/GrpcCatalogServiceStub.java | 528 + .../GrpcCompletionServiceCallableFactory.java | 115 + .../stub/GrpcCompletionServiceStub.java | 218 + .../GrpcControlServiceCallableFactory.java | 115 + .../v2alpha/stub/GrpcControlServiceStub.java | 294 + .../GrpcPredictionServiceCallableFactory.java | 115 + .../stub/GrpcPredictionServiceStub.java | 162 + .../GrpcProductServiceCallableFactory.java | 115 + .../v2alpha/stub/GrpcProductServiceStub.java | 649 + .../GrpcSearchServiceCallableFactory.java | 115 + .../v2alpha/stub/GrpcSearchServiceStub.java | 171 + ...pcServingConfigServiceCallableFactory.java | 115 + .../stub/GrpcServingConfigServiceStub.java | 383 + .../GrpcUserEventServiceCallableFactory.java | 115 + .../stub/GrpcUserEventServiceStub.java | 337 + .../v2alpha/stub/PredictionServiceStub.java | 42 + .../stub/PredictionServiceStubSettings.java | 279 + .../v2alpha/stub/ProductServiceStub.java | 174 + .../stub/ProductServiceStubSettings.java | 1025 + .../v2alpha/stub/SearchServiceStub.java | 48 + .../stub/SearchServiceStubSettings.java | 342 + .../stub/ServingConfigServiceStub.java | 82 + .../ServingConfigServiceStubSettings.java | 500 + .../v2alpha/stub/UserEventServiceStub.java | 92 + .../stub/UserEventServiceStubSettings.java | 568 + .../retail/v2beta/CatalogServiceClient.java | 1442 ++ .../retail/v2beta/CatalogServiceSettings.java | 307 + .../v2beta/CompletionServiceClient.java | 382 + .../v2beta/CompletionServiceSettings.java | 213 + .../retail/v2beta/ControlServiceClient.java | 854 + .../retail/v2beta/ControlServiceSettings.java | 231 + .../v2beta/PredictionServiceClient.java | 251 + .../v2beta/PredictionServiceSettings.java | 184 + .../retail/v2beta/ProductServiceClient.java | 2279 ++ .../retail/v2beta/ProductServiceSettings.java | 391 + .../retail/v2beta/SearchServiceClient.java | 431 + .../retail/v2beta/SearchServiceSettings.java | 187 + .../v2beta/ServingConfigServiceClient.java | 1163 ++ .../v2beta/ServingConfigServiceSettings.java | 260 + .../retail/v2beta/UserEventServiceClient.java | 586 + .../v2beta/UserEventServiceSettings.java | 269 + .../cloud/retail/v2beta/gapic_metadata.json | 210 + .../cloud/retail/v2beta/package-info.java | 207 + .../v2beta/stub/CatalogServiceStub.java | 108 + .../stub/CatalogServiceStubSettings.java | 617 + .../v2beta/stub/CompletionServiceStub.java | 63 + .../stub/CompletionServiceStubSettings.java | 367 + .../v2beta/stub/ControlServiceStub.java | 70 + .../stub/ControlServiceStubSettings.java | 429 + .../GrpcCatalogServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcCatalogServiceStub.java | 525 + .../GrpcCompletionServiceCallableFactory.java | 115 + .../stub/GrpcCompletionServiceStub.java | 218 + .../GrpcControlServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcControlServiceStub.java | 294 + .../GrpcPredictionServiceCallableFactory.java | 115 + .../stub/GrpcPredictionServiceStub.java | 162 + .../GrpcProductServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcProductServiceStub.java | 601 + .../GrpcSearchServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcSearchServiceStub.java | 171 + ...pcServingConfigServiceCallableFactory.java | 115 + .../stub/GrpcServingConfigServiceStub.java | 382 + .../GrpcUserEventServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcUserEventServiceStub.java | 337 + .../v2beta/stub/PredictionServiceStub.java | 42 + .../stub/PredictionServiceStubSettings.java | 279 + .../v2beta/stub/ProductServiceStub.java | 162 + .../stub/ProductServiceStubSettings.java | 952 + .../retail/v2beta/stub/SearchServiceStub.java | 48 + .../stub/SearchServiceStubSettings.java | 342 + .../v2beta/stub/ServingConfigServiceStub.java | 82 + .../ServingConfigServiceStubSettings.java | 500 + .../v2beta/stub/UserEventServiceStub.java | 92 + .../stub/UserEventServiceStubSettings.java | 568 + .../v2alpha/CatalogServiceClientTest.java | 794 + .../v2alpha/CompletionServiceClientTest.java | 207 + .../v2alpha/ControlServiceClientTest.java | 464 + .../retail/v2alpha/MockCatalogService.java | 59 + .../v2alpha/MockCatalogServiceImpl.java | 292 + .../retail/v2alpha/MockCompletionService.java | 59 + .../v2alpha/MockCompletionServiceImpl.java | 103 + .../retail/v2alpha/MockControlService.java | 59 + .../v2alpha/MockControlServiceImpl.java | 164 + .../retail/v2alpha/MockPredictionService.java | 59 + .../v2alpha/MockPredictionServiceImpl.java | 80 + .../retail/v2alpha/MockProductService.java | 59 + .../v2alpha/MockProductServiceImpl.java | 312 + .../retail/v2alpha/MockSearchService.java | 59 + .../retail/v2alpha/MockSearchServiceImpl.java | 80 + .../v2alpha/MockServingConfigService.java | 59 + .../v2alpha/MockServingConfigServiceImpl.java | 209 + .../retail/v2alpha/MockUserEventService.java | 59 + .../v2alpha/MockUserEventServiceImpl.java | 167 + .../v2alpha/PredictionServiceClientTest.java | 148 + .../v2alpha/ProductServiceClientTest.java | 1151 ++ .../v2alpha/SearchServiceClientTest.java | 187 + .../ServingConfigServiceClientTest.java | 768 + .../v2alpha/UserEventServiceClientTest.java | 371 + .../v2beta/CatalogServiceClientTest.java | 794 + .../v2beta/CompletionServiceClientTest.java | 207 + .../v2beta/ControlServiceClientTest.java | 459 + .../retail/v2beta/MockCatalogService.java | 59 + .../retail/v2beta/MockCatalogServiceImpl.java | 292 + .../retail/v2beta/MockCompletionService.java | 59 + .../v2beta/MockCompletionServiceImpl.java | 103 + .../retail/v2beta/MockControlService.java | 59 + .../retail/v2beta/MockControlServiceImpl.java | 164 + .../retail/v2beta/MockPredictionService.java | 59 + .../v2beta/MockPredictionServiceImpl.java | 80 + .../retail/v2beta/MockProductService.java | 59 + .../retail/v2beta/MockProductServiceImpl.java | 291 + .../retail/v2beta/MockSearchService.java | 59 + .../retail/v2beta/MockSearchServiceImpl.java | 80 + .../v2beta/MockServingConfigService.java | 59 + .../v2beta/MockServingConfigServiceImpl.java | 209 + .../retail/v2beta/MockUserEventService.java | 59 + .../v2beta/MockUserEventServiceImpl.java | 167 + .../v2beta/PredictionServiceClientTest.java | 148 + .../v2beta/ProductServiceClientTest.java | 1091 + .../v2beta/SearchServiceClientTest.java | 186 + .../ServingConfigServiceClientTest.java | 768 + .../v2beta/UserEventServiceClientTest.java | 371 + grpc-google-cloud-retail-v2alpha/pom.xml | 69 + .../retail/v2alpha/CatalogServiceGrpc.java | 1791 ++ .../retail/v2alpha/CompletionServiceGrpc.java | 521 + .../retail/v2alpha/ControlServiceGrpc.java | 854 + .../retail/v2alpha/PredictionServiceGrpc.java | 358 + .../retail/v2alpha/ProductServiceGrpc.java | 2060 ++ .../retail/v2alpha/SearchServiceGrpc.java | 374 + .../v2alpha/ServingConfigServiceGrpc.java | 1147 + .../retail/v2alpha/UserEventServiceGrpc.java | 882 + grpc-google-cloud-retail-v2beta/pom.xml | 69 + .../retail/v2beta/CatalogServiceGrpc.java | 1783 ++ .../retail/v2beta/CompletionServiceGrpc.java | 521 + .../retail/v2beta/ControlServiceGrpc.java | 852 + .../retail/v2beta/PredictionServiceGrpc.java | 358 + .../retail/v2beta/ProductServiceGrpc.java | 1890 ++ .../retail/v2beta/SearchServiceGrpc.java | 374 + .../v2beta/ServingConfigServiceGrpc.java | 1142 + .../retail/v2beta/UserEventServiceGrpc.java | 881 + pom.xml | 24 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-retail-v2alpha/pom.xml | 42 + .../v2alpha/AddCatalogAttributeRequest.java | 979 + .../AddCatalogAttributeRequestOrBuilder.java | 100 + .../retail/v2alpha/AddControlRequest.java | 845 + .../v2alpha/AddControlRequestOrBuilder.java | 83 + .../v2alpha/AddFulfillmentPlacesMetadata.java | 466 + ...AddFulfillmentPlacesMetadataOrBuilder.java | 24 + .../v2alpha/AddFulfillmentPlacesRequest.java | 1803 ++ .../AddFulfillmentPlacesRequestOrBuilder.java | 275 + .../v2alpha/AddFulfillmentPlacesResponse.java | 466 + ...AddFulfillmentPlacesResponseOrBuilder.java | 24 + .../v2alpha/AddLocalInventoriesMetadata.java | 463 + .../AddLocalInventoriesMetadataOrBuilder.java | 24 + .../v2alpha/AddLocalInventoriesRequest.java | 2076 ++ .../AddLocalInventoriesRequestOrBuilder.java | 260 + .../v2alpha/AddLocalInventoriesResponse.java | 463 + .../AddLocalInventoriesResponseOrBuilder.java | 24 + .../retail/v2alpha/AttributeConfigLevel.java | 185 + .../retail/v2alpha/AttributesConfig.java | 1296 ++ .../retail/v2alpha/AttributesConfigName.java | 223 + .../v2alpha/AttributesConfigOrBuilder.java | 186 + .../google/cloud/retail/v2alpha/Audience.java | 1261 ++ .../retail/v2alpha/AudienceOrBuilder.java | 203 + .../cloud/retail/v2alpha/BigQuerySource.java | 1937 ++ .../v2alpha/BigQuerySourceOrBuilder.java | 248 + .../cloud/retail/v2alpha/BranchName.java | 257 + .../google/cloud/retail/v2alpha/Catalog.java | 1514 ++ .../retail/v2alpha/CatalogAttribute.java | 2244 ++ .../v2alpha/CatalogAttributeOrBuilder.java | 226 + .../cloud/retail/v2alpha/CatalogName.java | 223 + .../retail/v2alpha/CatalogOrBuilder.java | 179 + .../cloud/retail/v2alpha/CatalogProto.java | 253 + .../retail/v2alpha/CatalogServiceProto.java | 355 + .../v2alpha/CollectUserEventRequest.java | 1130 + .../CollectUserEventRequestOrBuilder.java | 125 + .../cloud/retail/v2alpha/ColorInfo.java | 1260 ++ .../retail/v2alpha/ColorInfoOrBuilder.java | 203 + .../cloud/retail/v2alpha/CommonProto.java | 453 + .../retail/v2alpha/CompleteQueryRequest.java | 1994 ++ .../CompleteQueryRequestOrBuilder.java | 292 + .../retail/v2alpha/CompleteQueryResponse.java | 4002 ++++ .../CompleteQueryResponseOrBuilder.java | 264 + .../retail/v2alpha/CompletionConfig.java | 2776 +++ .../retail/v2alpha/CompletionConfigName.java | 223 + .../v2alpha/CompletionConfigOrBuilder.java | 372 + .../v2alpha/CompletionDataInputConfig.java | 899 + .../CompletionDataInputConfigOrBuilder.java | 77 + .../retail/v2alpha/CompletionDetail.java | 932 + .../v2alpha/CompletionDetailOrBuilder.java | 94 + .../v2alpha/CompletionServiceProto.java | 192 + .../cloud/retail/v2alpha/Condition.java | 3434 +++ .../retail/v2alpha/ConditionOrBuilder.java | 150 + .../google/cloud/retail/v2alpha/Control.java | 2910 +++ .../cloud/retail/v2alpha/ControlName.java | 257 + .../retail/v2alpha/ControlOrBuilder.java | 422 + .../cloud/retail/v2alpha/ControlProto.java | 106 + .../retail/v2alpha/ControlServiceProto.java | 202 + .../retail/v2alpha/CreateControlRequest.java | 1160 ++ .../CreateControlRequestOrBuilder.java | 128 + .../retail/v2alpha/CreateProductRequest.java | 1216 ++ .../CreateProductRequestOrBuilder.java | 144 + .../v2alpha/CreateServingConfigRequest.java | 1162 ++ .../CreateServingConfigRequestOrBuilder.java | 128 + .../cloud/retail/v2alpha/CustomAttribute.java | 1493 ++ .../v2alpha/CustomAttributeOrBuilder.java | 244 + .../retail/v2alpha/DeleteControlRequest.java | 659 + .../DeleteControlRequestOrBuilder.java | 56 + .../retail/v2alpha/DeleteProductRequest.java | 771 + .../DeleteProductRequestOrBuilder.java | 88 + .../v2alpha/DeleteServingConfigRequest.java | 660 + .../DeleteServingConfigRequestOrBuilder.java | 56 + .../retail/v2alpha/ExportConfigProto.java | 127 + .../retail/v2alpha/ExportErrorsConfig.java | 795 + .../v2alpha/ExportErrorsConfigOrBuilder.java | 73 + .../cloud/retail/v2alpha/ExportMetadata.java | 1014 + .../v2alpha/ExportMetadataOrBuilder.java | 98 + .../v2alpha/ExportProductsResponse.java | 1222 ++ .../ExportProductsResponseOrBuilder.java | 111 + .../v2alpha/ExportUserEventsResponse.java | 1234 ++ .../ExportUserEventsResponseOrBuilder.java | 114 + .../cloud/retail/v2alpha/FulfillmentInfo.java | 1121 + .../v2alpha/FulfillmentInfoOrBuilder.java | 161 + .../cloud/retail/v2alpha/GcsSource.java | 1128 + .../retail/v2alpha/GcsSourceOrBuilder.java | 163 + .../v2alpha/GetAttributesConfigRequest.java | 664 + .../GetAttributesConfigRequestOrBuilder.java | 56 + .../v2alpha/GetCompletionConfigRequest.java | 664 + .../GetCompletionConfigRequestOrBuilder.java | 56 + .../retail/v2alpha/GetControlRequest.java | 659 + .../v2alpha/GetControlRequestOrBuilder.java | 56 + .../v2alpha/GetDefaultBranchRequest.java | 646 + .../GetDefaultBranchRequestOrBuilder.java | 52 + .../v2alpha/GetDefaultBranchResponse.java | 1102 + .../GetDefaultBranchResponseOrBuilder.java | 114 + .../retail/v2alpha/GetProductRequest.java | 701 + .../v2alpha/GetProductRequestOrBuilder.java | 68 + .../v2alpha/GetServingConfigRequest.java | 660 + .../GetServingConfigRequestOrBuilder.java | 56 + .../google/cloud/retail/v2alpha/Image.java | 871 + .../cloud/retail/v2alpha/ImageOrBuilder.java | 90 + .../v2alpha/ImportCompletionDataRequest.java | 1174 ++ .../ImportCompletionDataRequestOrBuilder.java | 130 + .../v2alpha/ImportCompletionDataResponse.java | 948 + ...ImportCompletionDataResponseOrBuilder.java | 76 + .../retail/v2alpha/ImportConfigProto.java | 365 + .../retail/v2alpha/ImportErrorsConfig.java | 795 + .../v2alpha/ImportErrorsConfigOrBuilder.java | 73 + .../cloud/retail/v2alpha/ImportMetadata.java | 1602 ++ .../v2alpha/ImportMetadataOrBuilder.java | 188 + .../retail/v2alpha/ImportProductsRequest.java | 2342 +++ .../ImportProductsRequestOrBuilder.java | 277 + .../v2alpha/ImportProductsResponse.java | 1224 ++ .../ImportProductsResponseOrBuilder.java | 111 + .../v2alpha/ImportUserEventsRequest.java | 1247 ++ .../ImportUserEventsRequestOrBuilder.java | 133 + .../v2alpha/ImportUserEventsResponse.java | 1517 ++ .../ImportUserEventsResponseOrBuilder.java | 149 + .../google/cloud/retail/v2alpha/Interval.java | 1161 ++ .../retail/v2alpha/IntervalOrBuilder.java | 129 + .../retail/v2alpha/ListCatalogsRequest.java | 1021 + .../v2alpha/ListCatalogsRequestOrBuilder.java | 119 + .../retail/v2alpha/ListCatalogsResponse.java | 1155 ++ .../ListCatalogsResponseOrBuilder.java | 108 + .../retail/v2alpha/ListControlsRequest.java | 1146 + .../v2alpha/ListControlsRequestOrBuilder.java | 130 + .../retail/v2alpha/ListControlsResponse.java | 1130 + .../ListControlsResponseOrBuilder.java | 102 + .../retail/v2alpha/ListProductsRequest.java | 1930 ++ .../v2alpha/ListProductsRequestOrBuilder.java | 292 + .../retail/v2alpha/ListProductsResponse.java | 1285 ++ .../ListProductsResponseOrBuilder.java | 131 + .../v2alpha/ListServingConfigsRequest.java | 944 + .../ListServingConfigsRequestOrBuilder.java | 98 + .../v2alpha/ListServingConfigsResponse.java | 1143 + .../ListServingConfigsResponseOrBuilder.java | 102 + .../cloud/retail/v2alpha/LocalInventory.java | 1970 ++ .../v2alpha/LocalInventoryOrBuilder.java | 345 + .../cloud/retail/v2alpha/LocationName.java | 192 + .../retail/v2alpha/MerchantCenterLink.java | 1554 ++ .../v2alpha/MerchantCenterLinkOrBuilder.java | 218 + .../v2alpha/MerchantCenterLinkingConfig.java | 962 + .../MerchantCenterLinkingConfigOrBuilder.java | 77 + .../cloud/retail/v2alpha/PredictRequest.java | 2760 +++ .../v2alpha/PredictRequestOrBuilder.java | 538 + .../cloud/retail/v2alpha/PredictResponse.java | 2734 +++ .../v2alpha/PredictResponseOrBuilder.java | 184 + .../v2alpha/PredictionServiceProto.java | 193 + .../cloud/retail/v2alpha/PriceInfo.java | 3497 ++++ .../retail/v2alpha/PriceInfoOrBuilder.java | 328 + .../google/cloud/retail/v2alpha/Product.java | 13510 ++++++++++++ .../cloud/retail/v2alpha/ProductDetail.java | 1181 ++ .../v2alpha/ProductDetailOrBuilder.java | 140 + .../retail/v2alpha/ProductInlineSource.java | 1043 + .../v2alpha/ProductInlineSourceOrBuilder.java | 97 + .../retail/v2alpha/ProductInputConfig.java | 1459 ++ .../v2alpha/ProductInputConfigOrBuilder.java | 132 + .../retail/v2alpha/ProductLevelConfig.java | 1074 + .../v2alpha/ProductLevelConfigOrBuilder.java | 147 + .../cloud/retail/v2alpha/ProductName.java | 298 + .../retail/v2alpha/ProductOrBuilder.java | 2289 ++ .../cloud/retail/v2alpha/ProductProto.java | 189 + .../retail/v2alpha/ProductServiceProto.java | 476 + .../cloud/retail/v2alpha/Promotion.java | 678 + .../retail/v2alpha/PromotionOrBuilder.java | 62 + .../cloud/retail/v2alpha/PromotionProto.java | 67 + .../retail/v2alpha/PurchaseTransaction.java | 1126 + .../v2alpha/PurchaseTransactionOrBuilder.java | 123 + .../retail/v2alpha/PurgeConfigProto.java | 154 + .../cloud/retail/v2alpha/PurgeMetadata.java | 458 + .../v2alpha/PurgeMetadataOrBuilder.java | 24 + .../retail/v2alpha/PurgeProductsMetadata.java | 1197 ++ .../PurgeProductsMetadataOrBuilder.java | 124 + .../retail/v2alpha/PurgeProductsRequest.java | 1146 + .../PurgeProductsRequestOrBuilder.java | 156 + .../retail/v2alpha/PurgeProductsResponse.java | 860 + .../PurgeProductsResponseOrBuilder.java | 97 + .../v2alpha/PurgeUserEventsRequest.java | 1063 + .../PurgeUserEventsRequestOrBuilder.java | 132 + .../v2alpha/PurgeUserEventsResponse.java | 553 + .../PurgeUserEventsResponseOrBuilder.java | 38 + .../google/cloud/retail/v2alpha/Rating.java | 956 + .../cloud/retail/v2alpha/RatingOrBuilder.java | 109 + .../v2alpha/RejoinUserEventsMetadata.java | 459 + .../RejoinUserEventsMetadataOrBuilder.java | 24 + .../v2alpha/RejoinUserEventsRequest.java | 1017 + .../RejoinUserEventsRequestOrBuilder.java | 88 + .../v2alpha/RejoinUserEventsResponse.java | 549 + .../RejoinUserEventsResponseOrBuilder.java | 38 + .../RemoveCatalogAttributeRequest.java | 854 + ...emoveCatalogAttributeRequestOrBuilder.java | 83 + .../retail/v2alpha/RemoveControlRequest.java | 845 + .../RemoveControlRequestOrBuilder.java | 83 + .../RemoveFulfillmentPlacesMetadata.java | 471 + ...oveFulfillmentPlacesMetadataOrBuilder.java | 24 + .../RemoveFulfillmentPlacesRequest.java | 1762 ++ ...moveFulfillmentPlacesRequestOrBuilder.java | 259 + .../RemoveFulfillmentPlacesResponse.java | 471 + ...oveFulfillmentPlacesResponseOrBuilder.java | 24 + .../RemoveLocalInventoriesMetadata.java | 470 + ...moveLocalInventoriesMetadataOrBuilder.java | 24 + .../RemoveLocalInventoriesRequest.java | 1391 ++ ...emoveLocalInventoriesRequestOrBuilder.java | 178 + .../RemoveLocalInventoriesResponse.java | 470 + ...moveLocalInventoriesResponseOrBuilder.java | 24 + .../ReplaceCatalogAttributeRequest.java | 1306 ++ ...placeCatalogAttributeRequestOrBuilder.java | 147 + .../com/google/cloud/retail/v2alpha/Rule.java | 11626 +++++++++++ .../cloud/retail/v2alpha/RuleOrBuilder.java | 363 + .../cloud/retail/v2alpha/SearchRequest.java | 17240 ++++++++++++++++ .../v2alpha/SearchRequestOrBuilder.java | 1130 + .../cloud/retail/v2alpha/SearchResponse.java | 9549 +++++++++ .../v2alpha/SearchResponseOrBuilder.java | 436 + .../retail/v2alpha/SearchServiceProto.java | 424 + .../retail/v2alpha/SearchSolutionUseCase.java | 185 + .../cloud/retail/v2alpha/ServingConfig.java | 6143 ++++++ .../retail/v2alpha/ServingConfigName.java | 269 + .../v2alpha/ServingConfigOrBuilder.java | 1160 ++ .../retail/v2alpha/ServingConfigProto.java | 121 + .../v2alpha/ServingConfigServiceProto.java | 250 + .../v2alpha/SetDefaultBranchRequest.java | 1165 ++ .../SetDefaultBranchRequestOrBuilder.java | 135 + .../retail/v2alpha/SetInventoryMetadata.java | 462 + .../SetInventoryMetadataOrBuilder.java | 24 + .../retail/v2alpha/SetInventoryRequest.java | 1981 ++ .../v2alpha/SetInventoryRequestOrBuilder.java | 298 + .../retail/v2alpha/SetInventoryResponse.java | 462 + .../SetInventoryResponseOrBuilder.java | 24 + .../cloud/retail/v2alpha/SolutionType.java | 176 + .../UpdateAttributesConfigRequest.java | 1102 + ...pdateAttributesConfigRequestOrBuilder.java | 116 + .../retail/v2alpha/UpdateCatalogRequest.java | 1131 + .../UpdateCatalogRequestOrBuilder.java | 125 + .../UpdateCompletionConfigRequest.java | 1198 ++ ...pdateCompletionConfigRequestOrBuilder.java | 140 + .../retail/v2alpha/UpdateControlRequest.java | 1079 + .../UpdateControlRequestOrBuilder.java | 113 + .../retail/v2alpha/UpdateProductRequest.java | 1273 ++ .../UpdateProductRequestOrBuilder.java | 152 + .../v2alpha/UpdateServingConfigRequest.java | 1081 + .../UpdateServingConfigRequestOrBuilder.java | 113 + .../cloud/retail/v2alpha/UserEvent.java | 6368 ++++++ .../v2alpha/UserEventImportSummary.java | 645 + .../UserEventImportSummaryOrBuilder.java | 52 + .../retail/v2alpha/UserEventInlineSource.java | 1000 + .../UserEventInlineSourceOrBuilder.java | 87 + .../retail/v2alpha/UserEventInputConfig.java | 1532 ++ .../UserEventInputConfigOrBuilder.java | 151 + .../retail/v2alpha/UserEventOrBuilder.java | 1062 + .../cloud/retail/v2alpha/UserEventProto.java | 184 + .../retail/v2alpha/UserEventServiceProto.java | 196 + .../google/cloud/retail/v2alpha/UserInfo.java | 1286 ++ .../retail/v2alpha/UserInfoOrBuilder.java | 170 + .../retail/v2alpha/WriteUserEventRequest.java | 947 + .../WriteUserEventRequestOrBuilder.java | 93 + .../google/cloud/retail/v2alpha/catalog.proto | 397 + .../retail/v2alpha/catalog_service.proto | 478 + .../google/cloud/retail/v2alpha/common.proto | 761 + .../retail/v2alpha/completion_service.proto | 199 + .../google/cloud/retail/v2alpha/control.proto | 92 + .../retail/v2alpha/control_service.proto | 184 + .../cloud/retail/v2alpha/export_config.proto | 77 + .../cloud/retail/v2alpha/import_config.proto | 397 + .../retail/v2alpha/prediction_service.proto | 194 + .../google/cloud/retail/v2alpha/product.proto | 567 + .../retail/v2alpha/product_service.proto | 882 + .../cloud/retail/v2alpha/promotion.proto | 40 + .../cloud/retail/v2alpha/purge_config.proto | 171 + .../cloud/retail/v2alpha/search_service.proto | 832 + .../cloud/retail/v2alpha/serving_config.proto | 247 + .../v2alpha/serving_config_service.proto | 241 + .../cloud/retail/v2alpha/user_event.proto | 344 + .../retail/v2alpha/user_event_service.proto | 190 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-retail-v2beta/pom.xml | 42 + .../v2beta/AddCatalogAttributeRequest.java | 978 + .../AddCatalogAttributeRequestOrBuilder.java | 100 + .../retail/v2beta/AddControlRequest.java | 844 + .../v2beta/AddControlRequestOrBuilder.java | 83 + .../v2beta/AddFulfillmentPlacesMetadata.java | 463 + ...AddFulfillmentPlacesMetadataOrBuilder.java | 24 + .../v2beta/AddFulfillmentPlacesRequest.java | 1803 ++ .../AddFulfillmentPlacesRequestOrBuilder.java | 275 + .../v2beta/AddFulfillmentPlacesResponse.java | 463 + ...AddFulfillmentPlacesResponseOrBuilder.java | 24 + .../v2beta/AddLocalInventoriesMetadata.java | 463 + .../AddLocalInventoriesMetadataOrBuilder.java | 24 + .../v2beta/AddLocalInventoriesRequest.java | 2075 ++ .../AddLocalInventoriesRequestOrBuilder.java | 260 + .../v2beta/AddLocalInventoriesResponse.java | 463 + .../AddLocalInventoriesResponseOrBuilder.java | 24 + .../retail/v2beta/AttributeConfigLevel.java | 185 + .../cloud/retail/v2beta/AttributesConfig.java | 1289 ++ .../retail/v2beta/AttributesConfigName.java | 223 + .../v2beta/AttributesConfigOrBuilder.java | 185 + .../google/cloud/retail/v2beta/Audience.java | 1261 ++ .../retail/v2beta/AudienceOrBuilder.java | 203 + .../cloud/retail/v2beta/BigQuerySource.java | 1937 ++ .../v2beta/BigQuerySourceOrBuilder.java | 248 + .../cloud/retail/v2beta/BranchName.java | 257 + .../google/cloud/retail/v2beta/Catalog.java | 1513 ++ .../cloud/retail/v2beta/CatalogAttribute.java | 2240 ++ .../v2beta/CatalogAttributeOrBuilder.java | 224 + .../cloud/retail/v2beta/CatalogName.java | 223 + .../cloud/retail/v2beta/CatalogOrBuilder.java | 179 + .../cloud/retail/v2beta/CatalogProto.java | 252 + .../retail/v2beta/CatalogServiceProto.java | 354 + .../v2beta/CollectUserEventRequest.java | 1130 + .../CollectUserEventRequestOrBuilder.java | 125 + .../google/cloud/retail/v2beta/ColorInfo.java | 1259 ++ .../retail/v2beta/ColorInfoOrBuilder.java | 203 + .../cloud/retail/v2beta/CommonProto.java | 453 + .../retail/v2beta/CompleteQueryRequest.java | 1994 ++ .../v2beta/CompleteQueryRequestOrBuilder.java | 292 + .../retail/v2beta/CompleteQueryResponse.java | 3987 ++++ .../CompleteQueryResponseOrBuilder.java | 264 + .../cloud/retail/v2beta/CompletionConfig.java | 2776 +++ .../retail/v2beta/CompletionConfigName.java | 223 + .../v2beta/CompletionConfigOrBuilder.java | 372 + .../v2beta/CompletionDataInputConfig.java | 899 + .../CompletionDataInputConfigOrBuilder.java | 77 + .../cloud/retail/v2beta/CompletionDetail.java | 932 + .../v2beta/CompletionDetailOrBuilder.java | 94 + .../retail/v2beta/CompletionServiceProto.java | 192 + .../google/cloud/retail/v2beta/Condition.java | 3431 +++ .../retail/v2beta/ConditionOrBuilder.java | 150 + .../google/cloud/retail/v2beta/Control.java | 2407 +++ .../cloud/retail/v2beta/ControlName.java | 257 + .../cloud/retail/v2beta/ControlOrBuilder.java | 328 + .../cloud/retail/v2beta/ControlProto.java | 102 + .../retail/v2beta/ControlServiceProto.java | 202 + .../retail/v2beta/CreateControlRequest.java | 1160 ++ .../v2beta/CreateControlRequestOrBuilder.java | 128 + .../retail/v2beta/CreateProductRequest.java | 1216 ++ .../v2beta/CreateProductRequestOrBuilder.java | 144 + .../v2beta/CreateServingConfigRequest.java | 1162 ++ .../CreateServingConfigRequestOrBuilder.java | 128 + .../cloud/retail/v2beta/CustomAttribute.java | 1492 ++ .../v2beta/CustomAttributeOrBuilder.java | 244 + .../retail/v2beta/DeleteControlRequest.java | 659 + .../v2beta/DeleteControlRequestOrBuilder.java | 56 + .../retail/v2beta/DeleteProductRequest.java | 771 + .../v2beta/DeleteProductRequestOrBuilder.java | 88 + .../v2beta/DeleteServingConfigRequest.java | 660 + .../DeleteServingConfigRequestOrBuilder.java | 56 + .../retail/v2beta/ExportConfigProto.java | 127 + .../retail/v2beta/ExportErrorsConfig.java | 795 + .../v2beta/ExportErrorsConfigOrBuilder.java | 73 + .../cloud/retail/v2beta/ExportMetadata.java | 1014 + .../v2beta/ExportMetadataOrBuilder.java | 98 + .../retail/v2beta/ExportProductsResponse.java | 1222 ++ .../ExportProductsResponseOrBuilder.java | 111 + .../v2beta/ExportUserEventsResponse.java | 1234 ++ .../ExportUserEventsResponseOrBuilder.java | 114 + .../cloud/retail/v2beta/FulfillmentInfo.java | 1120 + .../v2beta/FulfillmentInfoOrBuilder.java | 161 + .../google/cloud/retail/v2beta/GcsSource.java | 1127 + .../retail/v2beta/GcsSourceOrBuilder.java | 163 + .../v2beta/GetAttributesConfigRequest.java | 664 + .../GetAttributesConfigRequestOrBuilder.java | 56 + .../v2beta/GetCompletionConfigRequest.java | 664 + .../GetCompletionConfigRequestOrBuilder.java | 56 + .../retail/v2beta/GetControlRequest.java | 658 + .../v2beta/GetControlRequestOrBuilder.java | 56 + .../v2beta/GetDefaultBranchRequest.java | 646 + .../GetDefaultBranchRequestOrBuilder.java | 52 + .../v2beta/GetDefaultBranchResponse.java | 1102 + .../GetDefaultBranchResponseOrBuilder.java | 114 + .../retail/v2beta/GetProductRequest.java | 700 + .../v2beta/GetProductRequestOrBuilder.java | 68 + .../v2beta/GetServingConfigRequest.java | 660 + .../GetServingConfigRequestOrBuilder.java | 56 + .../com/google/cloud/retail/v2beta/Image.java | 870 + .../cloud/retail/v2beta/ImageOrBuilder.java | 90 + .../v2beta/ImportCompletionDataRequest.java | 1174 ++ .../ImportCompletionDataRequestOrBuilder.java | 130 + .../v2beta/ImportCompletionDataResponse.java | 945 + ...ImportCompletionDataResponseOrBuilder.java | 76 + .../retail/v2beta/ImportConfigProto.java | 364 + .../retail/v2beta/ImportErrorsConfig.java | 795 + .../v2beta/ImportErrorsConfigOrBuilder.java | 73 + .../cloud/retail/v2beta/ImportMetadata.java | 1602 ++ .../v2beta/ImportMetadataOrBuilder.java | 188 + .../retail/v2beta/ImportProductsRequest.java | 2341 +++ .../ImportProductsRequestOrBuilder.java | 277 + .../retail/v2beta/ImportProductsResponse.java | 1224 ++ .../ImportProductsResponseOrBuilder.java | 111 + .../v2beta/ImportUserEventsRequest.java | 1247 ++ .../ImportUserEventsRequestOrBuilder.java | 133 + .../v2beta/ImportUserEventsResponse.java | 1515 ++ .../ImportUserEventsResponseOrBuilder.java | 149 + .../google/cloud/retail/v2beta/Interval.java | 1161 ++ .../retail/v2beta/IntervalOrBuilder.java | 129 + .../retail/v2beta/ListCatalogsRequest.java | 1021 + .../v2beta/ListCatalogsRequestOrBuilder.java | 119 + .../retail/v2beta/ListCatalogsResponse.java | 1154 ++ .../v2beta/ListCatalogsResponseOrBuilder.java | 108 + .../retail/v2beta/ListControlsRequest.java | 1146 + .../v2beta/ListControlsRequestOrBuilder.java | 130 + .../retail/v2beta/ListControlsResponse.java | 1129 + .../v2beta/ListControlsResponseOrBuilder.java | 102 + .../retail/v2beta/ListProductsRequest.java | 1820 ++ .../v2beta/ListProductsRequestOrBuilder.java | 274 + .../retail/v2beta/ListProductsResponse.java | 1154 ++ .../v2beta/ListProductsResponseOrBuilder.java | 108 + .../v2beta/ListServingConfigsRequest.java | 944 + .../ListServingConfigsRequestOrBuilder.java | 98 + .../v2beta/ListServingConfigsResponse.java | 1143 + .../ListServingConfigsResponseOrBuilder.java | 102 + .../cloud/retail/v2beta/LocalInventory.java | 1968 ++ .../v2beta/LocalInventoryOrBuilder.java | 345 + .../cloud/retail/v2beta/LocationName.java | 192 + .../retail/v2beta/MerchantCenterLink.java | 1554 ++ .../v2beta/MerchantCenterLinkOrBuilder.java | 218 + .../v2beta/MerchantCenterLinkingConfig.java | 960 + .../MerchantCenterLinkingConfigOrBuilder.java | 77 + .../cloud/retail/v2beta/PredictRequest.java | 2760 +++ .../v2beta/PredictRequestOrBuilder.java | 538 + .../cloud/retail/v2beta/PredictResponse.java | 2724 +++ .../v2beta/PredictResponseOrBuilder.java | 178 + .../retail/v2beta/PredictionServiceProto.java | 193 + .../google/cloud/retail/v2beta/PriceInfo.java | 3487 ++++ .../retail/v2beta/PriceInfoOrBuilder.java | 326 + .../google/cloud/retail/v2beta/Product.java | 13493 ++++++++++++ .../cloud/retail/v2beta/ProductDetail.java | 1181 ++ .../retail/v2beta/ProductDetailOrBuilder.java | 140 + .../retail/v2beta/ProductInlineSource.java | 1042 + .../v2beta/ProductInlineSourceOrBuilder.java | 97 + .../retail/v2beta/ProductInputConfig.java | 1458 ++ .../v2beta/ProductInputConfigOrBuilder.java | 132 + .../retail/v2beta/ProductLevelConfig.java | 1074 + .../v2beta/ProductLevelConfigOrBuilder.java | 147 + .../cloud/retail/v2beta/ProductName.java | 298 + .../cloud/retail/v2beta/ProductOrBuilder.java | 2286 ++ .../cloud/retail/v2beta/ProductProto.java | 189 + .../retail/v2beta/ProductServiceProto.java | 463 + .../google/cloud/retail/v2beta/Promotion.java | 677 + .../retail/v2beta/PromotionOrBuilder.java | 62 + .../cloud/retail/v2beta/PromotionProto.java | 67 + .../retail/v2beta/PurchaseTransaction.java | 1126 + .../v2beta/PurchaseTransactionOrBuilder.java | 123 + .../cloud/retail/v2beta/PurgeConfigProto.java | 104 + .../cloud/retail/v2beta/PurgeMetadata.java | 458 + .../retail/v2beta/PurgeMetadataOrBuilder.java | 24 + .../retail/v2beta/PurgeUserEventsRequest.java | 1063 + .../PurgeUserEventsRequestOrBuilder.java | 132 + .../v2beta/PurgeUserEventsResponse.java | 553 + .../PurgeUserEventsResponseOrBuilder.java | 38 + .../google/cloud/retail/v2beta/Rating.java | 955 + .../cloud/retail/v2beta/RatingOrBuilder.java | 109 + .../v2beta/RejoinUserEventsMetadata.java | 459 + .../RejoinUserEventsMetadataOrBuilder.java | 24 + .../v2beta/RejoinUserEventsRequest.java | 1016 + .../RejoinUserEventsRequestOrBuilder.java | 88 + .../v2beta/RejoinUserEventsResponse.java | 549 + .../RejoinUserEventsResponseOrBuilder.java | 38 + .../v2beta/RemoveCatalogAttributeRequest.java | 853 + ...emoveCatalogAttributeRequestOrBuilder.java | 83 + .../retail/v2beta/RemoveControlRequest.java | 845 + .../v2beta/RemoveControlRequestOrBuilder.java | 83 + .../RemoveFulfillmentPlacesMetadata.java | 470 + ...oveFulfillmentPlacesMetadataOrBuilder.java | 24 + .../RemoveFulfillmentPlacesRequest.java | 1760 ++ ...moveFulfillmentPlacesRequestOrBuilder.java | 259 + .../RemoveFulfillmentPlacesResponse.java | 470 + ...oveFulfillmentPlacesResponseOrBuilder.java | 24 + .../RemoveLocalInventoriesMetadata.java | 468 + ...moveLocalInventoriesMetadataOrBuilder.java | 24 + .../v2beta/RemoveLocalInventoriesRequest.java | 1390 ++ ...emoveLocalInventoriesRequestOrBuilder.java | 178 + .../RemoveLocalInventoriesResponse.java | 468 + ...moveLocalInventoriesResponseOrBuilder.java | 24 + .../ReplaceCatalogAttributeRequest.java | 1303 ++ ...placeCatalogAttributeRequestOrBuilder.java | 147 + .../com/google/cloud/retail/v2beta/Rule.java | 11616 +++++++++++ .../cloud/retail/v2beta/RuleOrBuilder.java | 357 + .../cloud/retail/v2beta/SearchRequest.java | 16665 +++++++++++++++ .../retail/v2beta/SearchRequestOrBuilder.java | 1053 + .../cloud/retail/v2beta/SearchResponse.java | 9522 +++++++++ .../v2beta/SearchResponseOrBuilder.java | 436 + .../retail/v2beta/SearchServiceProto.java | 407 + .../retail/v2beta/SearchSolutionUseCase.java | 185 + .../cloud/retail/v2beta/ServingConfig.java | 6140 ++++++ .../retail/v2beta/ServingConfigName.java | 269 + .../retail/v2beta/ServingConfigOrBuilder.java | 1157 ++ .../retail/v2beta/ServingConfigProto.java | 121 + .../v2beta/ServingConfigServiceProto.java | 249 + .../v2beta/SetDefaultBranchRequest.java | 1165 ++ .../SetDefaultBranchRequestOrBuilder.java | 135 + .../retail/v2beta/SetInventoryMetadata.java | 462 + .../v2beta/SetInventoryMetadataOrBuilder.java | 24 + .../retail/v2beta/SetInventoryRequest.java | 1981 ++ .../v2beta/SetInventoryRequestOrBuilder.java | 298 + .../retail/v2beta/SetInventoryResponse.java | 462 + .../v2beta/SetInventoryResponseOrBuilder.java | 24 + .../cloud/retail/v2beta/SolutionType.java | 176 + .../v2beta/UpdateAttributesConfigRequest.java | 1100 + ...pdateAttributesConfigRequestOrBuilder.java | 116 + .../retail/v2beta/UpdateCatalogRequest.java | 1131 + .../v2beta/UpdateCatalogRequestOrBuilder.java | 125 + .../v2beta/UpdateCompletionConfigRequest.java | 1196 ++ ...pdateCompletionConfigRequestOrBuilder.java | 140 + .../retail/v2beta/UpdateControlRequest.java | 1079 + .../v2beta/UpdateControlRequestOrBuilder.java | 113 + .../retail/v2beta/UpdateProductRequest.java | 1273 ++ .../v2beta/UpdateProductRequestOrBuilder.java | 152 + .../v2beta/UpdateServingConfigRequest.java | 1081 + .../UpdateServingConfigRequestOrBuilder.java | 113 + .../google/cloud/retail/v2beta/UserEvent.java | 6353 ++++++ .../retail/v2beta/UserEventImportSummary.java | 645 + .../UserEventImportSummaryOrBuilder.java | 52 + .../retail/v2beta/UserEventInlineSource.java | 998 + .../UserEventInlineSourceOrBuilder.java | 87 + .../retail/v2beta/UserEventInputConfig.java | 1532 ++ .../v2beta/UserEventInputConfigOrBuilder.java | 150 + .../retail/v2beta/UserEventOrBuilder.java | 1059 + .../cloud/retail/v2beta/UserEventProto.java | 183 + .../retail/v2beta/UserEventServiceProto.java | 195 + .../google/cloud/retail/v2beta/UserInfo.java | 1286 ++ .../retail/v2beta/UserInfoOrBuilder.java | 170 + .../retail/v2beta/WriteUserEventRequest.java | 946 + .../WriteUserEventRequestOrBuilder.java | 93 + .../google/cloud/retail/v2beta/catalog.proto | 397 + .../cloud/retail/v2beta/catalog_service.proto | 478 + .../google/cloud/retail/v2beta/common.proto | 760 + .../retail/v2beta/completion_service.proto | 199 + .../google/cloud/retail/v2beta/control.proto | 84 + .../cloud/retail/v2beta/control_service.proto | 184 + .../cloud/retail/v2beta/export_config.proto | 77 + .../cloud/retail/v2beta/import_config.proto | 397 + .../retail/v2beta/prediction_service.proto | 194 + .../google/cloud/retail/v2beta/product.proto | 566 + .../cloud/retail/v2beta/product_service.proto | 829 + .../cloud/retail/v2beta/promotion.proto | 40 + .../cloud/retail/v2beta/purge_config.proto | 80 + .../cloud/retail/v2beta/search_service.proto | 791 + .../cloud/retail/v2beta/serving_config.proto | 247 + .../v2beta/serving_config_service.proto | 240 + .../cloud/retail/v2beta/user_event.proto | 342 + .../retail/v2beta/user_event_service.proto | 190 + versions.txt | 4 + 711 files changed, 513684 insertions(+), 3 deletions(-) create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceCallableFactory.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStub.java create mode 100644 google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CatalogServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CompletionServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ControlServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/PredictionServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ProductServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/SearchServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/UserEventServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CompletionServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventService.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventServiceImpl.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/PredictionServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/SearchServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java create mode 100644 google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/UserEventServiceClientTest.java create mode 100644 grpc-google-cloud-retail-v2alpha/pom.xml create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/pom.xml create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceGrpc.java create mode 100644 grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java create mode 100644 proto-google-cloud-retail-v2alpha/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-retail-v2alpha/pom.xml create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributeConfigLevel.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Audience.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AudienceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySource.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BranchName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Catalog.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttribute.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttributeOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfo.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CommonProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetail.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetailOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Condition.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ConditionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Control.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttribute.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttributeOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfo.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSource.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Image.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImageOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportConfigProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Interval.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/IntervalOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventory.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventoryOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocationName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLink.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfo.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Product.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetail.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetailOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSource.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Promotion.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransaction.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransactionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeConfigProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rating.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RatingOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rule.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RuleOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchSolutionUseCase.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigName.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadata.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponse.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SolutionType.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEvent.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummary.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummaryOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSource.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfig.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceProto.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfo.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequest.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/common.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/completion_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/import_config.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/prediction_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/promotion.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/purge_config.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/search_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config_service.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event.proto create mode 100644 proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event_service.proto create mode 100644 proto-google-cloud-retail-v2beta/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-retail-v2beta/pom.xml create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributeConfigLevel.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Audience.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AudienceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BranchName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Catalog.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfo.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CommonProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetail.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetailOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ConditionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfo.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Image.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImageOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportConfigProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Interval.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/IntervalOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventory.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventoryOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocationName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfo.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetail.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetailOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSource.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Promotion.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransaction.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransactionOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeConfigProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rating.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RatingOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RuleOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigName.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadata.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadataOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponse.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponseOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SolutionType.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummary.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummaryOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSource.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSourceOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfig.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfigOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfo.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfoOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequest.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequestOrBuilder.java create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/promotion.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/purge_config.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto create mode 100644 proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index e693dfba..fe27b7ce 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -24,9 +24,9 @@ deep-preserve-regex: - "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" deep-copy-regex: -- source: "/google/cloud/retail/(v\\d)/.*-java/proto-google-.*/src" +- source: "/google/cloud/retail/(v.*)/.*-java/proto-google-.*/src" dest: "/owl-bot-staging/$1/proto-google-cloud-retail-$1/src" -- source: "/google/cloud/retail/(v\\d)/.*-java/grpc-google-.*/src" +- source: "/google/cloud/retail/(v.*)/.*-java/grpc-google-.*/src" dest: "/owl-bot-staging/$1/grpc-google-cloud-retail-$1/src" -- source: "/google/cloud/retail/(v\\d)/.*-java/gapic-google-.*/src" +- source: "/google/cloud/retail/(v.*)/.*-java/gapic-google-.*/src" dest: "/owl-bot-staging/$1/google-cloud-retail/src" diff --git a/google-cloud-retail-bom/pom.xml b/google-cloud-retail-bom/pom.xml index a7baaea8..2eb4dad0 100644 --- a/google-cloud-retail-bom/pom.xml +++ b/google-cloud-retail-bom/pom.xml @@ -64,11 +64,31 @@ grpc-google-cloud-retail-v2 2.1.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-retail-v2 2.1.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + diff --git a/google-cloud-retail/pom.xml b/google-cloud-retail/pom.xml index 9d2a8360..72ae97cc 100644 --- a/google-cloud-retail/pom.xml +++ b/google-cloud-retail/pom.xml @@ -42,6 +42,14 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-retail-v2beta + + + com.google.api.grpc + proto-google-cloud-retail-v2alpha + com.google.api.grpc proto-google-cloud-retail-v2 @@ -76,6 +84,16 @@ grpc-google-cloud-retail-v2 test + + com.google.api.grpc + grpc-google-cloud-retail-v2beta + test + + + com.google.api.grpc + grpc-google-cloud-retail-v2alpha + test + com.google.api diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java new file mode 100644 index 00000000..84f44531 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java @@ -0,0 +1,1442 @@ +/* + * 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.v2alpha; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.CatalogServiceStub; +import com.google.cloud.retail.v2alpha.stub.CatalogServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 managing catalog configuration. + * + *

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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ *   Catalog catalog = Catalog.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CatalogServiceClient 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 CatalogServiceSettings 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.
+ * CatalogServiceSettings catalogServiceSettings =
+ *     CatalogServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceClient implements BackgroundResource { + private final CatalogServiceSettings settings; + private final CatalogServiceStub stub; + + /** Constructs an instance of CatalogServiceClient with default settings. */ + public static final CatalogServiceClient create() throws IOException { + return create(CatalogServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient create(CatalogServiceSettings settings) + throws IOException { + return new CatalogServiceClient(settings); + } + + /** + * Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(CatalogServiceSettings). + */ + public static final CatalogServiceClient create(CatalogServiceStub stub) { + return new CatalogServiceClient(stub); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient(CatalogServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected CatalogServiceClient(CatalogServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CatalogServiceSettings getSettings() { + return settings; + } + + public CatalogServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *

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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account resource name with an associated location. + *

If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(LocationName parent) { + ListCatalogsRequest request = + ListCatalogsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *

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()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account resource name with an associated location. + *

If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(String parent) { + ListCatalogsRequest request = ListCatalogsRequest.newBuilder().setParent(parent).build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Catalog element : catalogServiceClient.listCatalogs(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 ListCatalogsPagedResponse listCatalogs(ListCatalogsRequest request) { + return listCatalogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.listCatalogsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Catalog element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCatalogsPagedCallable() { + return stub.listCatalogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListCatalogsResponse response = catalogServiceClient.listCatalogsCallable().call(request);
+   *     for (Catalog element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listCatalogsCallable() { + return stub.listCatalogsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + * + *

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()) {
+   *   Catalog catalog = Catalog.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+   * }
+   * }
+ * + * @param catalog Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update. + *

If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not exist, a + * NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2alpha.Catalog] to update. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Catalog updateCatalog(Catalog catalog, FieldMask updateMask) { + UpdateCatalogRequest request = + UpdateCatalogRequest.newBuilder().setCatalog(catalog).setUpdateMask(updateMask).build(); + return updateCatalog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + * + *

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()) {
+   *   UpdateCatalogRequest request =
+   *       UpdateCatalogRequest.newBuilder()
+   *           .setCatalog(Catalog.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Catalog response = catalogServiceClient.updateCatalog(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 Catalog updateCatalog(UpdateCatalogRequest request) { + return updateCatalogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + * + *

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()) {
+   *   UpdateCatalogRequest request =
+   *       UpdateCatalogRequest.newBuilder()
+   *           .setCatalog(Catalog.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = catalogServiceClient.updateCatalogCallable().futureCall(request);
+   *   // Do something.
+   *   Catalog response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCatalogCallable() { + return stub.updateCatalogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(CatalogName catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(String catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .setForce(true)
+   *           .build();
+   *   catalogServiceClient.setDefaultBranch(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 setDefaultBranch(SetDefaultBranchRequest request) { + setDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = catalogServiceClient.setDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setDefaultBranchCallable() { + return stub.setDefaultBranchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(CatalogName catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(String catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(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 GetDefaultBranchResponse getDefaultBranch(GetDefaultBranchRequest request) { + return getDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   GetDefaultBranchResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getDefaultBranchCallable() { + return stub.getDefaultBranchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *

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()) {
+   *   CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full CompletionConfig resource name. Format: + * 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) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *

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()) {
+   *   String name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full CompletionConfig resource name. Format: + * 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) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder().setName(name).build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *

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()) {
+   *   GetCompletionConfigRequest request =
+   *       GetCompletionConfigRequest.newBuilder()
+   *           .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(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 CompletionConfig getCompletionConfig(GetCompletionConfigRequest request) { + return getCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + * + *

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()) {
+   *   GetCompletionConfigRequest request =
+   *       GetCompletionConfigRequest.newBuilder()
+   *           .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getCompletionConfigCallable().futureCall(request);
+   *   // Do something.
+   *   CompletionConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getCompletionConfigCallable() { + return stub.getCompletionConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + * + *

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()) {
+   *   CompletionConfig completionConfig = CompletionConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   CompletionConfig response =
+   *       catalogServiceClient.updateCompletionConfig(completionConfig, updateMask);
+   * }
+   * }
+ * + * @param completionConfig Required. The + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. + *

If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a PERMISSION_DENIED + * error is returned. + *

If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update does + * not exist, a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. The following + * are the only supported fields: + *

    + *
  • [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order] + *
  • [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions] + *
  • [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length] + *
  • [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompletionConfig updateCompletionConfig( + CompletionConfig completionConfig, FieldMask updateMask) { + UpdateCompletionConfigRequest request = + UpdateCompletionConfigRequest.newBuilder() + .setCompletionConfig(completionConfig) + .setUpdateMask(updateMask) + .build(); + return updateCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + * + *

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()) {
+   *   UpdateCompletionConfigRequest request =
+   *       UpdateCompletionConfigRequest.newBuilder()
+   *           .setCompletionConfig(CompletionConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CompletionConfig response = catalogServiceClient.updateCompletionConfig(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 CompletionConfig updateCompletionConfig(UpdateCompletionConfigRequest request) { + return updateCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + * + *

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()) {
+   *   UpdateCompletionConfigRequest request =
+   *       UpdateCompletionConfigRequest.newBuilder()
+   *           .setCompletionConfig(CompletionConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.updateCompletionConfigCallable().futureCall(request);
+   *   // Do something.
+   *   CompletionConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateCompletionConfigCallable() { + return stub.updateCompletionConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.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()) {
+   *   AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(AttributesConfigName name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.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()) {
+   *   String name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(String name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder().setName(name).build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.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()) {
+   *   GetAttributesConfigRequest request =
+   *       GetAttributesConfigRequest.newBuilder()
+   *           .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(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 AttributesConfig getAttributesConfig(GetAttributesConfigRequest request) { + return getAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [AttributesConfig][google.cloud.retail.v2alpha.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()) {
+   *   GetAttributesConfigRequest request =
+   *       GetAttributesConfigRequest.newBuilder()
+   *           .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getAttributesConfigCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getAttributesConfigCallable() { + return stub.getAttributesConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   AttributesConfig attributesConfig = AttributesConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AttributesConfig response =
+   *       catalogServiceClient.updateAttributesConfig(attributesConfig, updateMask);
+   * }
+   * }
+ * + * @param attributesConfig Required. The + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. + * @param updateMask Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. The following + * is the only supported field: + *
    + *
  • [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig updateAttributesConfig( + AttributesConfig attributesConfig, FieldMask updateMask) { + UpdateAttributesConfigRequest request = + UpdateAttributesConfigRequest.newBuilder() + .setAttributesConfig(attributesConfig) + .setUpdateMask(updateMask) + .build(); + return updateAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   UpdateAttributesConfigRequest request =
+   *       UpdateAttributesConfigRequest.newBuilder()
+   *           .setAttributesConfig(AttributesConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.updateAttributesConfig(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 AttributesConfig updateAttributesConfig(UpdateAttributesConfigRequest request) { + return updateAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   UpdateAttributesConfigRequest request =
+   *       UpdateAttributesConfigRequest.newBuilder()
+   *           .setAttributesConfig(AttributesConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.updateAttributesConfigCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateAttributesConfigCallable() { + return stub.updateAttributesConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   AddCatalogAttributeRequest request =
+   *       AddCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.addCatalogAttribute(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 AttributesConfig addCatalogAttribute(AddCatalogAttributeRequest request) { + return addCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   AddCatalogAttributeRequest request =
+   *       AddCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.addCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addCatalogAttributeCallable() { + return stub.addCatalogAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   RemoveCatalogAttributeRequest request =
+   *       RemoveCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setKey("key106079")
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.removeCatalogAttribute(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 AttributesConfig removeCatalogAttribute(RemoveCatalogAttributeRequest request) { + return removeCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + * + *

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

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()) {
+   *   RemoveCatalogAttributeRequest request =
+   *       RemoveCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setKey("key106079")
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.removeCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeCatalogAttributeCallable() { + return stub.removeCatalogAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Replaces the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by updating the catalog + * attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]. + * + *

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

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()) {
+   *   ReplaceCatalogAttributeRequest request =
+   *       ReplaceCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.replaceCatalogAttribute(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 AttributesConfig replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) { + return replaceCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Replaces the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by updating the catalog + * attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]. + * + *

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

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()) {
+   *   ReplaceCatalogAttributeRequest request =
+   *       ReplaceCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.replaceCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + replaceCatalogAttributeCallable() { + return stub.replaceCatalogAttributeCallable(); + } + + @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 ListCatalogsPagedResponse + extends AbstractPagedListResponse< + ListCatalogsRequest, + ListCatalogsResponse, + Catalog, + ListCatalogsPage, + ListCatalogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCatalogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCatalogsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCatalogsPagedResponse(ListCatalogsPage page) { + super(page, ListCatalogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCatalogsPage + extends AbstractPage { + + private ListCatalogsPage( + PageContext context, + ListCatalogsResponse response) { + super(context, response); + } + + private static ListCatalogsPage createEmptyPage() { + return new ListCatalogsPage(null, null); + } + + @Override + protected ListCatalogsPage createPage( + PageContext context, + ListCatalogsResponse response) { + return new ListCatalogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCatalogsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCatalogsRequest, + ListCatalogsResponse, + Catalog, + ListCatalogsPage, + ListCatalogsFixedSizeCollection> { + + private ListCatalogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCatalogsFixedSizeCollection createEmptyCollection() { + return new ListCatalogsFixedSizeCollection(null, 0); + } + + @Override + protected ListCatalogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCatalogsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceSettings.java new file mode 100644 index 00000000..5ce90c09 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceSettings.java @@ -0,0 +1,307 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.CatalogServiceClient.ListCatalogsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.v2alpha.stub.CatalogServiceStubSettings; +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 CatalogServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .updateCatalogSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder
+ *             .updateCatalogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listCatalogs. */ + public PagedCallSettings + listCatalogsSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).listCatalogsSettings(); + } + + /** Returns the object with the settings used for calls to updateCatalog. */ + public UnaryCallSettings updateCatalogSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).setDefaultBranchSettings(); + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getDefaultBranchSettings(); + } + + /** Returns the object with the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings + getCompletionConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getCompletionConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings + updateCompletionConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateCompletionConfigSettings(); + } + + /** Returns the object with the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings + getAttributesConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getAttributesConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings + updateAttributesConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateAttributesConfigSettings(); + } + + /** Returns the object with the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings + addCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).addCatalogAttributeSettings(); + } + + /** Returns the object with the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings + removeCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).removeCatalogAttributeSettings(); + } + + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings + replaceCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).replaceCatalogAttributeSettings(); + } + + public static final CatalogServiceSettings create(CatalogServiceStubSettings stub) + throws IOException { + return new CatalogServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CatalogServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CatalogServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CatalogServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CatalogServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CatalogServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CatalogServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CatalogServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CatalogServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CatalogServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CatalogServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CatalogServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CatalogServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CatalogServiceStubSettings.newBuilder()); + } + + public CatalogServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CatalogServiceStubSettings.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 listCatalogs. */ + public PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings() { + return getStubSettingsBuilder().listCatalogsSettings(); + } + + /** Returns the builder for the settings used for calls to updateCatalog. */ + public UnaryCallSettings.Builder updateCatalogSettings() { + return getStubSettingsBuilder().updateCatalogSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return getStubSettingsBuilder().setDefaultBranchSettings(); + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getStubSettingsBuilder().getDefaultBranchSettings(); + } + + /** Returns the builder for the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings.Builder + getCompletionConfigSettings() { + return getStubSettingsBuilder().getCompletionConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings.Builder + updateCompletionConfigSettings() { + return getStubSettingsBuilder().updateCompletionConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings.Builder + getAttributesConfigSettings() { + return getStubSettingsBuilder().getAttributesConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings.Builder + updateAttributesConfigSettings() { + return getStubSettingsBuilder().updateAttributesConfigSettings(); + } + + /** Returns the builder for the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings.Builder + addCatalogAttributeSettings() { + return getStubSettingsBuilder().addCatalogAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings.Builder + removeCatalogAttributeSettings() { + return getStubSettingsBuilder().removeCatalogAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings.Builder + replaceCatalogAttributeSettings() { + return getStubSettingsBuilder().replaceCatalogAttributeSettings(); + } + + @Override + public CatalogServiceSettings build() throws IOException { + return new CatalogServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java new file mode 100644 index 00000000..116d00b1 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java @@ -0,0 +1,382 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.CompletionServiceStub; +import com.google.cloud.retail.v2alpha.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CompletionServiceClient 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 CompletionServiceSettings 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.
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CompletionServiceClient completionServiceClient =
+ *     CompletionServiceClient.create(completionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceClient implements BackgroundResource { + private final CompletionServiceSettings settings; + private final CompletionServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CompletionServiceClient with default settings. */ + public static final CompletionServiceClient create() throws IOException { + return create(CompletionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CompletionServiceClient, 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 CompletionServiceClient create(CompletionServiceSettings settings) + throws IOException { + return new CompletionServiceClient(settings); + } + + /** + * Constructs an instance of CompletionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CompletionServiceSettings). + */ + public static final CompletionServiceClient create(CompletionServiceStub stub) { + return new CompletionServiceClient(stub); + } + + /** + * Constructs an instance of CompletionServiceClient, 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 CompletionServiceClient(CompletionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CompletionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected CompletionServiceClient(CompletionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CompletionServiceSettings getSettings() { + return settings; + } + + public CompletionServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   CompleteQueryResponse response = completionServiceClient.completeQuery(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 CompleteQueryResponse completeQuery(CompleteQueryRequest request) { + return completeQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.completeQueryCallable().futureCall(request);
+   *   // Do something.
+   *   CompleteQueryResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable completeQueryCallable() { + return stub.completeQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ImportCompletionDataResponse response =
+   *       completionServiceClient.importCompletionDataAsync(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 + importCompletionDataAsync(ImportCompletionDataRequest request) { + return importCompletionDataOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   OperationFuture future =
+   *       completionServiceClient.importCompletionDataOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportCompletionDataResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return stub.importCompletionDataOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.importCompletionDataCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + importCompletionDataCallable() { + return stub.importCompletionDataCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceSettings.java new file mode 100644 index 00000000..ee307daa --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceSettings.java @@ -0,0 +1,213 @@ +/* + * 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.v2alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return ((CompletionServiceStubSettings) getStubSettings()).completeQuerySettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return ((CompletionServiceStubSettings) getStubSettings()).importCompletionDataSettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return ((CompletionServiceStubSettings) getStubSettings()) + .importCompletionDataOperationSettings(); + } + + public static final CompletionServiceSettings create(CompletionServiceStubSettings stub) + throws IOException { + return new CompletionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CompletionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CompletionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CompletionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CompletionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CompletionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CompletionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CompletionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CompletionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CompletionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CompletionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CompletionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CompletionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CompletionServiceStubSettings.newBuilder()); + } + + public CompletionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CompletionServiceStubSettings.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 completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return getStubSettingsBuilder().completeQuerySettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return getStubSettingsBuilder().importCompletionDataSettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return getStubSettingsBuilder().importCompletionDataOperationSettings(); + } + + @Override + public CompletionServiceSettings build() throws IOException { + return new CompletionServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java new file mode 100644 index 00000000..85ffb9ef --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java @@ -0,0 +1,854 @@ +/* + * 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.v2alpha; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.ControlServiceStub; +import com.google.cloud.retail.v2alpha.stub.ControlServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 modifying Control. + * + *

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 (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   Control control = Control.newBuilder().build();
+ *   String controlId = "controlId-395080872";
+ *   Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ControlServiceClient 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 ControlServiceSettings 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.
+ * ControlServiceSettings controlServiceSettings =
+ *     ControlServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ControlServiceClient controlServiceClient = ControlServiceClient.create(controlServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceClient implements BackgroundResource { + private final ControlServiceSettings settings; + private final ControlServiceStub stub; + + /** Constructs an instance of ControlServiceClient with default settings. */ + public static final ControlServiceClient create() throws IOException { + return create(ControlServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ControlServiceClient, 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 ControlServiceClient create(ControlServiceSettings settings) + throws IOException { + return new ControlServiceClient(settings); + } + + /** + * Constructs an instance of ControlServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ControlServiceSettings). + */ + public static final ControlServiceClient create(ControlServiceStub stub) { + return new ControlServiceClient(stub); + } + + /** + * Constructs an instance of ControlServiceClient, 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 ControlServiceClient(ControlServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ControlServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ControlServiceClient(ControlServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ControlServiceSettings getSettings() { + return settings; + } + + public ControlServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   Control control = Control.newBuilder().build();
+   *   String controlId = "controlId-395080872";
+   *   Control response = controlServiceClient.createControl(parent, control, controlId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param control Required. The Control to create. + * @param controlId Required. The ID to use for the Control, which will become the final component + * of the Control's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control createControl(CatalogName parent, Control control, String controlId) { + CreateControlRequest request = + CreateControlRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setControl(control) + .setControlId(controlId) + .build(); + return createControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   Control control = Control.newBuilder().build();
+   *   String controlId = "controlId-395080872";
+   *   Control response = controlServiceClient.createControl(parent, control, controlId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param control Required. The Control to create. + * @param controlId Required. The ID to use for the Control, which will become the final component + * of the Control's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control createControl(String parent, Control control, String controlId) { + CreateControlRequest request = + CreateControlRequest.newBuilder() + .setParent(parent) + .setControl(control) + .setControlId(controlId) + .build(); + return createControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CreateControlRequest request =
+   *       CreateControlRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setControl(Control.newBuilder().build())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   Control response = controlServiceClient.createControl(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 Control createControl(CreateControlRequest request) { + return createControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CreateControlRequest request =
+   *       CreateControlRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setControl(Control.newBuilder().build())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future = controlServiceClient.createControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createControlCallable() { + return stub.createControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+   *   controlServiceClient.deleteControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final void deleteControl(ControlName name) { + DeleteControlRequest request = + DeleteControlRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+   *   controlServiceClient.deleteControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final void deleteControl(String name) { + DeleteControlRequest request = DeleteControlRequest.newBuilder().setName(name).build(); + deleteControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   DeleteControlRequest request =
+   *       DeleteControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   controlServiceClient.deleteControl(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 deleteControl(DeleteControlRequest request) { + deleteControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   DeleteControlRequest request =
+   *       DeleteControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.deleteControlCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteControlCallable() { + return stub.deleteControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   Control control = Control.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Control response = controlServiceClient.updateControl(control, updateMask);
+   * }
+   * }
+ * + * @param control Required. The Control to update. + * @param updateMask Indicates which fields in the provided + * [Control][google.cloud.retail.v2alpha.Control] to update. The following are NOT supported: + *
    + *
  • [Control.name][google.cloud.retail.v2alpha.Control.name] + *
+ *

If not set or empty, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control updateControl(Control control, FieldMask updateMask) { + UpdateControlRequest request = + UpdateControlRequest.newBuilder().setControl(control).setUpdateMask(updateMask).build(); + return updateControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   UpdateControlRequest request =
+   *       UpdateControlRequest.newBuilder()
+   *           .setControl(Control.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Control response = controlServiceClient.updateControl(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 Control updateControl(UpdateControlRequest request) { + return updateControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   UpdateControlRequest request =
+   *       UpdateControlRequest.newBuilder()
+   *           .setControl(Control.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.updateControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateControlCallable() { + return stub.updateControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+   *   Control response = controlServiceClient.getControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final Control getControl(ControlName name) { + GetControlRequest request = + GetControlRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+   *   Control response = controlServiceClient.getControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final Control getControl(String name) { + GetControlRequest request = GetControlRequest.newBuilder().setName(name).build(); + return getControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   GetControlRequest request =
+   *       GetControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   Control response = controlServiceClient.getControl(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 Control getControl(GetControlRequest request) { + return getControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   GetControlRequest request =
+   *       GetControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.getControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getControlCallable() { + return stub.getControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Controls linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ListControlsRequest request =
+   *       ListControlsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Control element : controlServiceClient.listControls(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 ListControlsPagedResponse listControls(ListControlsRequest request) { + return listControlsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Controls linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ListControlsRequest request =
+   *       ListControlsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListControlsResponse response = controlServiceClient.listControlsCallable().call(request);
+   *     for (Control element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listControlsCallable() { + return stub.listControlsCallable(); + } + + @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 ListControlsPagedResponse + extends AbstractPagedListResponse< + ListControlsRequest, + ListControlsResponse, + Control, + ListControlsPage, + ListControlsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListControlsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListControlsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListControlsPagedResponse(ListControlsPage page) { + super(page, ListControlsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListControlsPage + extends AbstractPage { + + private ListControlsPage( + PageContext context, + ListControlsResponse response) { + super(context, response); + } + + private static ListControlsPage createEmptyPage() { + return new ListControlsPage(null, null); + } + + @Override + protected ListControlsPage createPage( + PageContext context, + ListControlsResponse response) { + return new ListControlsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListControlsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListControlsRequest, + ListControlsResponse, + Control, + ListControlsPage, + ListControlsFixedSizeCollection> { + + private ListControlsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListControlsFixedSizeCollection createEmptyCollection() { + return new ListControlsFixedSizeCollection(null, 0); + } + + @Override + protected ListControlsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListControlsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceSettings.java new file mode 100644 index 00000000..8bad2cb5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceSettings.java @@ -0,0 +1,231 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ControlServiceClient.ListControlsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.v2alpha.stub.ControlServiceStubSettings; +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 ControlServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceSettings.Builder controlServiceSettingsBuilder =
+ *     ControlServiceSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ *     .createControlSettings()
+ *     .setRetrySettings(
+ *         controlServiceSettingsBuilder
+ *             .createControlSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ControlServiceSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createControl. */ + public UnaryCallSettings createControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).createControlSettings(); + } + + /** Returns the object with the settings used for calls to deleteControl. */ + public UnaryCallSettings deleteControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).deleteControlSettings(); + } + + /** Returns the object with the settings used for calls to updateControl. */ + public UnaryCallSettings updateControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).updateControlSettings(); + } + + /** Returns the object with the settings used for calls to getControl. */ + public UnaryCallSettings getControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).getControlSettings(); + } + + /** Returns the object with the settings used for calls to listControls. */ + public PagedCallSettings + listControlsSettings() { + return ((ControlServiceStubSettings) getStubSettings()).listControlsSettings(); + } + + public static final ControlServiceSettings create(ControlServiceStubSettings stub) + throws IOException { + return new ControlServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ControlServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ControlServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ControlServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ControlServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ControlServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ControlServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ControlServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ControlServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ControlServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ControlServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ControlServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ControlServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ControlServiceStubSettings.newBuilder()); + } + + public ControlServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ControlServiceStubSettings.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 createControl. */ + public UnaryCallSettings.Builder createControlSettings() { + return getStubSettingsBuilder().createControlSettings(); + } + + /** Returns the builder for the settings used for calls to deleteControl. */ + public UnaryCallSettings.Builder deleteControlSettings() { + return getStubSettingsBuilder().deleteControlSettings(); + } + + /** Returns the builder for the settings used for calls to updateControl. */ + public UnaryCallSettings.Builder updateControlSettings() { + return getStubSettingsBuilder().updateControlSettings(); + } + + /** Returns the builder for the settings used for calls to getControl. */ + public UnaryCallSettings.Builder getControlSettings() { + return getStubSettingsBuilder().getControlSettings(); + } + + /** Returns the builder for the settings used for calls to listControls. */ + public PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings() { + return getStubSettingsBuilder().listControlsSettings(); + } + + @Override + public ControlServiceSettings build() throws IOException { + return new ControlServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java new file mode 100644 index 00000000..bbf984a9 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java @@ -0,0 +1,251 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.PredictionServiceStub; +import com.google.cloud.retail.v2alpha.stub.PredictionServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for making recommendation prediction. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   PredictRequest request =
+ *       PredictRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllLabels(new HashMap())
+ *           .build();
+ *   PredictResponse response = predictionServiceClient.predict(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the PredictionServiceClient 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 PredictionServiceSettings 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.
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceClient implements BackgroundResource { + private final PredictionServiceSettings settings; + private final PredictionServiceStub stub; + + /** Constructs an instance of PredictionServiceClient with default settings. */ + public static final PredictionServiceClient create() throws IOException { + return create(PredictionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient create(PredictionServiceSettings settings) + throws IOException { + return new PredictionServiceClient(settings); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(PredictionServiceSettings). + */ + public static final PredictionServiceClient create(PredictionServiceStub stub) { + return new PredictionServiceClient(stub); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient(PredictionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected PredictionServiceClient(PredictionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PredictionServiceSettings getSettings() { + return settings; + } + + public PredictionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Makes a recommendation prediction. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   PredictResponse response = predictionServiceClient.predict(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 PredictResponse predict(PredictRequest request) { + return predictCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Makes a recommendation prediction. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.predictCallable().futureCall(request);
+   *   // Do something.
+   *   PredictResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable predictCallable() { + return stub.predictCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceSettings.java new file mode 100644 index 00000000..62ced44d --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceSettings.java @@ -0,0 +1,184 @@ +/* + * 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.v2alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.stub.PredictionServiceStubSettings; +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 PredictionServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder
+ *             .predictSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); + } + + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) + throws IOException { + return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 PredictionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(PredictionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(PredictionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(PredictionServiceStubSettings.newBuilder()); + } + + public PredictionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionServiceStubSettings.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 predict. */ + public UnaryCallSettings.Builder predictSettings() { + return getStubSettingsBuilder().predictSettings(); + } + + @Override + public PredictionServiceSettings build() throws IOException { + return new PredictionServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java new file mode 100644 index 00000000..ebb53bf9 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java @@ -0,0 +1,2407 @@ +/* + * 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.v2alpha; + +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.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.v2alpha.stub.ProductServiceStub; +import com.google.cloud.retail.v2alpha.stub.ProductServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +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 ingesting [Product][google.cloud.retail.v2alpha.Product] + * information of the customer's website. + * + *

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 (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "productId-1051830678";
+ *   Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ProductServiceClient 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 ProductServiceSettings 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.
+ * ProductServiceSettings productServiceSettings =
+ *     ProductServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceClient implements BackgroundResource { + private final ProductServiceSettings settings; + private final ProductServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ProductServiceClient with default settings. */ + public static final ProductServiceClient create() throws IOException { + return create(ProductServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProductServiceClient, 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 ProductServiceClient create(ProductServiceSettings settings) + throws IOException { + return new ProductServiceClient(settings); + } + + /** + * Constructs an instance of ProductServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ProductServiceSettings). + */ + public static final ProductServiceClient create(ProductServiceStub stub) { + return new ProductServiceClient(stub); + } + + /** + * Constructs an instance of ProductServiceClient, 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 ProductServiceClient(ProductServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProductServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ProductServiceClient(ProductServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ProductServiceSettings getSettings() { + return settings; + } + + public ProductServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "productId-1051830678";
+   *   Product response = productServiceClient.createProduct(parent, product, productId);
+   * }
+   * }
+ * + * @param parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * @param product Required. The [Product][google.cloud.retail.v2alpha.Product] to create. + * @param productId Required. The ID to use for the + * [Product][google.cloud.retail.v2alpha.Product], which will become the final component of + * the [Product.name][google.cloud.retail.v2alpha.Product.name]. + *

If the caller does not have permission to create the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

This field must be unique among all [Product][google.cloud.retail.v2alpha.Product]s with + * the same [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + *

This field must be a UTF-8 encoded string with a length limit of 128 characters. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(BranchName parent, Product product, String productId) { + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "productId-1051830678";
+   *   Product response = productServiceClient.createProduct(parent, product, productId);
+   * }
+   * }
+ * + * @param parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * @param product Required. The [Product][google.cloud.retail.v2alpha.Product] to create. + * @param productId Required. The ID to use for the + * [Product][google.cloud.retail.v2alpha.Product], which will become the final component of + * the [Product.name][google.cloud.retail.v2alpha.Product.name]. + *

If the caller does not have permission to create the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

This field must be unique among all [Product][google.cloud.retail.v2alpha.Product]s with + * the same [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + *

This field must be a UTF-8 encoded string with a length limit of 128 characters. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(String parent, Product product, String productId) { + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   CreateProductRequest request =
+   *       CreateProductRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setProduct(Product.newBuilder().build())
+   *           .setProductId("productId-1051830678")
+   *           .build();
+   *   Product response = productServiceClient.createProduct(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 Product createProduct(CreateProductRequest request) { + return createProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   CreateProductRequest request =
+   *       CreateProductRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setProduct(Product.newBuilder().build())
+   *           .setProductId("productId-1051830678")
+   *           .build();
+   *   ApiFuture future = productServiceClient.createProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createProductCallable() { + return stub.createProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   Product response = productServiceClient.getProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a + * NOT_FOUND error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(ProductName name) { + GetProductRequest request = + GetProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   Product response = productServiceClient.getProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a + * NOT_FOUND error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(String name) { + GetProductRequest request = GetProductRequest.newBuilder().setName(name).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   GetProductRequest request =
+   *       GetProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   Product response = productServiceClient.getProduct(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 Product getProduct(GetProductRequest request) { + return getProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   GetProductRequest request =
+   *       GetProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = productServiceClient.getProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getProductCallable() { + return stub.getProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2alpha.Product]s under this branch, regardless of whether or + * not this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(BranchName parent) { + ListProductsRequest request = + ListProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2alpha.Product]s under this branch, regardless of whether or + * not this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(String parent) { + ListProductsRequest request = ListProductsRequest.newBuilder().setParent(parent).build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .setRequireTotalSize(true)
+   *           .build();
+   *   for (Product element : productServiceClient.listProducts(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 ListProductsPagedResponse listProducts(ListProductsRequest request) { + return listProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .setRequireTotalSize(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.listProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProductsPagedCallable() { + return stub.listProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .setRequireTotalSize(true)
+   *           .build();
+   *   while (true) {
+   *     ListProductsResponse response = productServiceClient.listProductsCallable().call(request);
+   *     for (Product element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listProductsCallable() { + return stub.listProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   Product product = Product.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Product response = productServiceClient.updateProduct(product, updateMask);
+   * }
+   * }
+ * + * @param product Required. The product to update/create. + *

If the caller does not have permission to update the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2alpha.Product] to update does not exist and + * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing] is not set, + * a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and output only + * fields are NOT supported. If not set, all supported fields (the fields that are neither + * immutable nor output only) are updated. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product updateProduct(Product product, FieldMask updateMask) { + UpdateProductRequest request = + UpdateProductRequest.newBuilder().setProduct(product).setUpdateMask(updateMask).build(); + return updateProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   UpdateProductRequest request =
+   *       UpdateProductRequest.newBuilder()
+   *           .setProduct(Product.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Product response = productServiceClient.updateProduct(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 Product updateProduct(UpdateProductRequest request) { + return updateProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   UpdateProductRequest request =
+   *       UpdateProductRequest.newBuilder()
+   *           .setProduct(Product.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = productServiceClient.updateProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateProductCallable() { + return stub.updateProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   productServiceClient.deleteProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

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

The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2alpha.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2alpha.Product] with more than one + * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2alpha.Product] + * will be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(ProductName name) { + DeleteProductRequest request = + DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   productServiceClient.deleteProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

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

The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2alpha.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2alpha.Product] with more than one + * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an + * INVALID_ARGUMENT error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2alpha.Product] + * will be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(String name) { + DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   DeleteProductRequest request =
+   *       DeleteProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   productServiceClient.deleteProduct(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 deleteProduct(DeleteProductRequest request) { + deleteProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2alpha.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   DeleteProductRequest request =
+   *       DeleteProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = productServiceClient.deleteProductCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a + * branch. + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   PurgeProductsRequest request =
+   *       PurgeProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   PurgeProductsResponse response = productServiceClient.purgeProductsAsync(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 purgeProductsAsync( + PurgeProductsRequest request) { + return purgeProductsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a + * branch. + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   PurgeProductsRequest request =
+   *       PurgeProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.purgeProductsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PurgeProductsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + purgeProductsOperationCallable() { + return stub.purgeProductsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a + * branch. + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   PurgeProductsRequest request =
+   *       PurgeProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.purgeProductsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable purgeProductsCallable() { + return stub.purgeProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ImportProductsResponse response = productServiceClient.importProductsAsync(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 importProductsAsync( + ImportProductsRequest request) { + return importProductsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.importProductsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportProductsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + importProductsOperationCallable() { + return stub.importProductsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.importProductsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importProductsCallable() { + return stub.importProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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 + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or + * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. + * + *

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

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and + * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   Product inventory = Product.newBuilder().build();
+   *   FieldMask setMask = FieldMask.newBuilder().build();
+   *   SetInventoryResponse response =
+   *       productServiceClient.setInventoryAsync(inventory, setMask).get();
+   * }
+   * }
+ * + * @param inventory Required. The inventory information to update. The allowable fields to update + * are: + *
    + *
  • [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + *
  • [Product.availability][google.cloud.retail.v2alpha.Product.availability] + *
  • [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info] The + * updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]. + *
+ *

If [SetInventoryRequest.inventory.name][] is empty or invalid, an INVALID_ARGUMENT error + * is returned. + *

If the caller does not have permission to update the + * [Product][google.cloud.retail.v2alpha.Product] named in + * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2alpha.Product] to update does not have existing + * inventory information, the provided inventory information will be inserted. + *

If the [Product][google.cloud.retail.v2alpha.Product] to update has existing inventory + * information, the provided inventory information will be merged while respecting the last + * update time for each inventory field, using the provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time]. + *

The caller can replace place IDs for a subset of fulfillment types in the following + * ways: + *

    + *
  • Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask] + *
  • Specifies only the desired fulfillment types and corresponding place IDs to update in + * [SetInventoryRequest.inventory.fulfillment_info][] + *
+ *

The caller can clear all place IDs from a subset of fulfillment types in the following + * ways: + *

    + *
  • Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask] + *
  • Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][] + *
  • Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + *
+ *

The last update time is recorded for the following inventory fields: + *

    + *
  • [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + *
  • [Product.availability][google.cloud.retail.v2alpha.Product.availability] + *
  • [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info] + *
+ *

If a full overwrite of inventory information while ignoring timestamps is needed, + * [UpdateProduct][] should be invoked instead. + * @param setMask Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2alpha.Product] to update. + *

At least one field must be provided. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned + * and the entire update will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture setInventoryAsync( + Product inventory, FieldMask setMask) { + SetInventoryRequest request = + SetInventoryRequest.newBuilder().setInventory(inventory).setSetMask(setMask).build(); + return setInventoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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 + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or + * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. + * + *

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

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and + * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   SetInventoryResponse response = productServiceClient.setInventoryAsync(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 setInventoryAsync( + SetInventoryRequest request) { + return setInventoryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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 + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or + * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. + * + *

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

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and + * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.setInventoryOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SetInventoryResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + setInventoryOperationCallable() { + return stub.setInventoryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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 + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or + * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. + * + *

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

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and + * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = productServiceClient.setInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setInventoryCallable() { + return stub.setInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(ProductName product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(String product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(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 + addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) { + return addFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.addFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return stub.addFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.addFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addFulfillmentPlacesCallable() { + return stub.addFulfillmentPlacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(ProductName product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(String product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(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 + removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) { + return removeFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.removeFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemoveFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return stub.removeFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.removeFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeFulfillmentPlacesCallable() { + return stub.removeFulfillmentPlacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addLocalInventoriesAsync(ProductName product) { + AddLocalInventoriesRequest request = + AddLocalInventoriesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return addLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addLocalInventoriesAsync(String product) { + AddLocalInventoriesRequest request = + AddLocalInventoriesRequest.newBuilder().setProduct(product).build(); + return addLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(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 + addLocalInventoriesAsync(AddLocalInventoriesRequest request) { + return addLocalInventoriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.addLocalInventoriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddLocalInventoriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + return stub.addLocalInventoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.addLocalInventoriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addLocalInventoriesCallable() { + return stub.addLocalInventoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeLocalInventoriesAsync(ProductName product) { + RemoveLocalInventoriesRequest request = + RemoveLocalInventoriesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return removeLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2alpha.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeLocalInventoriesAsync(String product) { + RemoveLocalInventoriesRequest request = + RemoveLocalInventoriesRequest.newBuilder().setProduct(product).build(); + return removeLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(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 + removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) { + return removeLocalInventoriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.removeLocalInventoriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemoveLocalInventoriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + return stub.removeLocalInventoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and + * [UpdateProduct][google.cloud.retail.v2alpha.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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.removeLocalInventoriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeLocalInventoriesCallable() { + return stub.removeLocalInventoriesCallable(); + } + + @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 ListProductsPagedResponse + extends AbstractPagedListResponse< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProductsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProductsPagedResponse(ListProductsPage page) { + super(page, ListProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductsPage + extends AbstractPage { + + private ListProductsPage( + PageContext context, + ListProductsResponse response) { + super(context, response); + } + + private static ListProductsPage createEmptyPage() { + return new ListProductsPage(null, null); + } + + @Override + protected ListProductsPage createPage( + PageContext context, + ListProductsResponse response) { + return new ListProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + private ListProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductsFixedSizeCollection createEmptyCollection() { + return new ListProductsFixedSizeCollection(null, 0); + } + + @Override + protected ListProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceSettings.java new file mode 100644 index 00000000..d65553f0 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceSettings.java @@ -0,0 +1,414 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ProductServiceClient.ListProductsPagedResponse; + +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.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.v2alpha.stub.ProductServiceStubSettings; +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 ProductServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceSettings.Builder productServiceSettingsBuilder =
+ *     ProductServiceSettings.newBuilder();
+ * productServiceSettingsBuilder
+ *     .createProductSettings()
+ *     .setRetrySettings(
+ *         productServiceSettingsBuilder
+ *             .createProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProductServiceSettings productServiceSettings = productServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).createProductSettings(); + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).getProductSettings(); + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).listProductsSettings(); + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).updateProductSettings(); + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).deleteProductSettings(); + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + public UnaryCallSettings purgeProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).purgeProductsSettings(); + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + public OperationCallSettings + purgeProductsOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).purgeProductsOperationSettings(); + } + + /** Returns the object with the settings used for calls to importProducts. */ + public UnaryCallSettings importProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).importProductsSettings(); + } + + /** Returns the object with the settings used for calls to importProducts. */ + public OperationCallSettings + importProductsOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).importProductsOperationSettings(); + } + + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventorySettings(); + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventoryOperationSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesOperationSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).removeFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()) + .removeFulfillmentPlacesOperationSettings(); + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public UnaryCallSettings addLocalInventoriesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addLocalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addLocalInventoriesOperationSettings(); + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings + removeLocalInventoriesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).removeLocalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()) + .removeLocalInventoriesOperationSettings(); + } + + public static final ProductServiceSettings create(ProductServiceStubSettings stub) + throws IOException { + return new ProductServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProductServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ProductServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ProductServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProductServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ProductServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProductServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProductServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ProductServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ProductServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ProductServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ProductServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProductServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ProductServiceStubSettings.newBuilder()); + } + + public ProductServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ProductServiceStubSettings.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 createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return getStubSettingsBuilder().createProductSettings(); + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getStubSettingsBuilder().getProductSettings(); + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return getStubSettingsBuilder().listProductsSettings(); + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return getStubSettingsBuilder().updateProductSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return getStubSettingsBuilder().deleteProductSettings(); + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + public UnaryCallSettings.Builder purgeProductsSettings() { + return getStubSettingsBuilder().purgeProductsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + public OperationCallSettings.Builder< + PurgeProductsRequest, PurgeProductsResponse, PurgeProductsMetadata> + purgeProductsOperationSettings() { + return getStubSettingsBuilder().purgeProductsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public UnaryCallSettings.Builder importProductsSettings() { + return getStubSettingsBuilder().importProductsSettings(); + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings() { + return getStubSettingsBuilder().importProductsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return getStubSettingsBuilder().setInventorySettings(); + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return getStubSettingsBuilder().setInventoryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public UnaryCallSettings.Builder + addLocalInventoriesSettings() { + return getStubSettingsBuilder().addLocalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return getStubSettingsBuilder().addLocalInventoriesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings.Builder + removeLocalInventoriesSettings() { + return getStubSettingsBuilder().removeLocalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return getStubSettingsBuilder().removeLocalInventoriesOperationSettings(); + } + + @Override + public ProductServiceSettings build() throws IOException { + return new ProductServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java new file mode 100644 index 00000000..39742f82 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java @@ -0,0 +1,431 @@ +/* + * 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.v2alpha; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.SearchServiceStub; +import com.google.cloud.retail.v2alpha.stub.SearchServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 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 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 (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SearchServiceClient 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 SearchServiceSettings 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.
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceClient implements BackgroundResource { + private final SearchServiceSettings settings; + private final SearchServiceStub stub; + + /** Constructs an instance of SearchServiceClient with default settings. */ + public static final SearchServiceClient create() throws IOException { + return create(SearchServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SearchServiceClient, 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 SearchServiceClient create(SearchServiceSettings settings) + throws IOException { + return new SearchServiceClient(settings); + } + + /** + * Constructs an instance of SearchServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SearchServiceSettings). + */ + public static final SearchServiceClient create(SearchServiceStub stub) { + return new SearchServiceClient(stub); + } + + /** + * Constructs an instance of SearchServiceClient, 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 SearchServiceClient(SearchServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SearchServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SearchServiceClient(SearchServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SearchServiceSettings getSettings() { + return settings; + } + + public SearchServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   for (SearchResponse.SearchResult element : searchServiceClient.search(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 SearchPagedResponse search(SearchRequest request) { + return searchPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       searchServiceClient.searchPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchResponse.SearchResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchPagedCallable() { + return stub.searchPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     SearchResponse response = searchServiceClient.searchCallable().call(request);
+   *     for (SearchResponse.SearchResult element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchCallable() { + return stub.searchCallable(); + } + + @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 SearchPagedResponse + extends AbstractPagedListResponse< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new SearchPagedResponse(input), MoreExecutors.directExecutor()); + } + + private SearchPagedResponse(SearchPage page) { + super(page, SearchFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchPage + extends AbstractPage { + + private SearchPage( + PageContext context, + SearchResponse response) { + super(context, response); + } + + private static SearchPage createEmptyPage() { + return new SearchPage(null, null); + } + + @Override + protected SearchPage createPage( + PageContext context, + SearchResponse response) { + return new SearchPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + private SearchFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchFixedSizeCollection createEmptyCollection() { + return new SearchFixedSizeCollection(null, 0); + } + + @Override + protected SearchFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceSettings.java new file mode 100644 index 00000000..4b64c5c6 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceSettings.java @@ -0,0 +1,187 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.SearchServiceClient.SearchPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.v2alpha.stub.SearchServiceStubSettings; +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 SearchServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return ((SearchServiceStubSettings) getStubSettings()).searchSettings(); + } + + public static final SearchServiceSettings create(SearchServiceStubSettings stub) + throws IOException { + return new SearchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SearchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SearchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SearchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SearchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SearchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SearchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 SearchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SearchServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SearchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SearchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SearchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SearchServiceStubSettings.newBuilder()); + } + + public SearchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SearchServiceStubSettings.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 search. */ + public PagedCallSettings.Builder + searchSettings() { + return getStubSettingsBuilder().searchSettings(); + } + + @Override + public SearchServiceSettings build() throws IOException { + return new SearchServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java new file mode 100644 index 00000000..83ffeef8 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java @@ -0,0 +1,1163 @@ +/* + * 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.v2alpha; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.ServingConfigServiceStub; +import com.google.cloud.retail.v2alpha.stub.ServingConfigServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 modifying ServingConfig. + * + *

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 (ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ *   String servingConfigId = "servingConfigId-831052759";
+ *   ServingConfig response =
+ *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ServingConfigServiceClient 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 ServingConfigServiceSettings + * 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.
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ *     ServingConfigServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create(servingConfigServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceClient implements BackgroundResource { + private final ServingConfigServiceSettings settings; + private final ServingConfigServiceStub stub; + + /** Constructs an instance of ServingConfigServiceClient with default settings. */ + public static final ServingConfigServiceClient create() throws IOException { + return create(ServingConfigServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient create(ServingConfigServiceSettings settings) + throws IOException { + return new ServingConfigServiceClient(settings); + } + + /** + * Constructs an instance of ServingConfigServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(ServingConfigServiceSettings). + */ + public static final ServingConfigServiceClient create(ServingConfigServiceStub stub) { + return new ServingConfigServiceClient(stub); + } + + /** + * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient(ServingConfigServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ServingConfigServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ServingConfigServiceClient(ServingConfigServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ServingConfigServiceSettings getSettings() { + return settings; + } + + public ServingConfigServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   String servingConfigId = "servingConfigId-831052759";
+   *   ServingConfig response =
+   *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param servingConfig Required. The ServingConfig to create. + * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the + * final component of the ServingConfig's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig createServingConfig( + CatalogName parent, ServingConfig servingConfig, String servingConfigId) { + CreateServingConfigRequest request = + CreateServingConfigRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setServingConfig(servingConfig) + .setServingConfigId(servingConfigId) + .build(); + return createServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   String servingConfigId = "servingConfigId-831052759";
+   *   ServingConfig response =
+   *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param servingConfig Required. The ServingConfig to create. + * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the + * final component of the ServingConfig's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig createServingConfig( + String parent, ServingConfig servingConfig, String servingConfigId) { + CreateServingConfigRequest request = + CreateServingConfigRequest.newBuilder() + .setParent(parent) + .setServingConfig(servingConfig) + .setServingConfigId(servingConfigId) + .build(); + return createServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CreateServingConfigRequest request =
+   *       CreateServingConfigRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setServingConfigId("servingConfigId-831052759")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.createServingConfig(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 ServingConfig createServingConfig(CreateServingConfigRequest request) { + return createServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CreateServingConfigRequest request =
+   *       CreateServingConfigRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setServingConfigId("servingConfigId-831052759")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.createServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createServingConfigCallable() { + return stub.createServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   servingConfigServiceClient.deleteServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServingConfig(ServingConfigName name) { + DeleteServingConfigRequest request = + DeleteServingConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   servingConfigServiceClient.deleteServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServingConfig(String name) { + DeleteServingConfigRequest request = + DeleteServingConfigRequest.newBuilder().setName(name).build(); + deleteServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   DeleteServingConfigRequest request =
+   *       DeleteServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   servingConfigServiceClient.deleteServingConfig(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 deleteServingConfig(DeleteServingConfigRequest request) { + deleteServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   DeleteServingConfigRequest request =
+   *       DeleteServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.deleteServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteServingConfigCallable() { + return stub.deleteServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ServingConfig response =
+   *       servingConfigServiceClient.updateServingConfig(servingConfig, updateMask);
+   * }
+   * }
+ * + * @param servingConfig Required. The ServingConfig to update. + * @param updateMask Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The following are NOT + * supported: + *
    + *
  • [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig updateServingConfig( + ServingConfig servingConfig, FieldMask updateMask) { + UpdateServingConfigRequest request = + UpdateServingConfigRequest.newBuilder() + .setServingConfig(servingConfig) + .setUpdateMask(updateMask) + .build(); + return updateServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   UpdateServingConfigRequest request =
+   *       UpdateServingConfigRequest.newBuilder()
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.updateServingConfig(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 ServingConfig updateServingConfig(UpdateServingConfigRequest request) { + return updateServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   UpdateServingConfigRequest request =
+   *       UpdateServingConfigRequest.newBuilder()
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.updateServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateServingConfigCallable() { + return stub.updateServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig getServingConfig(ServingConfigName name) { + GetServingConfigRequest request = + GetServingConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig getServingConfig(String name) { + GetServingConfigRequest request = GetServingConfigRequest.newBuilder().setName(name).build(); + return getServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   GetServingConfigRequest request =
+   *       GetServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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 ServingConfig getServingConfig(GetServingConfigRequest request) { + return getServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   GetServingConfigRequest request =
+   *       GetServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.getServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getServingConfigCallable() { + return stub.getServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The catalog resource name. Format: + * 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) { + ListServingConfigsRequest request = + ListServingConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServingConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The catalog resource name. Format: + * 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) { + ListServingConfigsRequest request = + ListServingConfigsRequest.newBuilder().setParent(parent).build(); + return listServingConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ListServingConfigsRequest request =
+   *       ListServingConfigsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(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 ListServingConfigsPagedResponse listServingConfigs( + ListServingConfigsRequest request) { + return listServingConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ListServingConfigsRequest request =
+   *       ListServingConfigsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListServingConfigsResponse response =
+   *         servingConfigServiceClient.listServingConfigsCallable().call(request);
+   *     for (ServingConfig element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listServingConfigsCallable() { + return stub.listServingConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + AddControlRequest request = + AddControlRequest.newBuilder() + .setServingConfig(servingConfig == null ? null : servingConfig.toString()) + .build(); + return addControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + AddControlRequest request = + AddControlRequest.newBuilder().setServingConfig(servingConfig).build(); + return addControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   AddControlRequest request =
+   *       AddControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.addControl(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 ServingConfig addControl(AddControlRequest request) { + return addControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   AddControlRequest request =
+   *       AddControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.addControlCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addControlCallable() { + return stub.addControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + RemoveControlRequest request = + RemoveControlRequest.newBuilder() + .setServingConfig(servingConfig == null ? null : servingConfig.toString()) + .build(); + return removeControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + RemoveControlRequest request = + RemoveControlRequest.newBuilder().setServingConfig(servingConfig).build(); + return removeControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   RemoveControlRequest request =
+   *       RemoveControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.removeControl(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 ServingConfig removeControl(RemoveControlRequest request) { + return removeControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   RemoveControlRequest request =
+   *       RemoveControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.removeControlCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable removeControlCallable() { + return stub.removeControlCallable(); + } + + @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 ListServingConfigsPagedResponse + extends AbstractPagedListResponse< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage, + ListServingConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServingConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListServingConfigsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListServingConfigsPagedResponse(ListServingConfigsPage page) { + super(page, ListServingConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServingConfigsPage + extends AbstractPage< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage> { + + private ListServingConfigsPage( + PageContext context, + ListServingConfigsResponse response) { + super(context, response); + } + + private static ListServingConfigsPage createEmptyPage() { + return new ListServingConfigsPage(null, null); + } + + @Override + protected ListServingConfigsPage createPage( + PageContext context, + ListServingConfigsResponse response) { + return new ListServingConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServingConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage, + ListServingConfigsFixedSizeCollection> { + + private ListServingConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServingConfigsFixedSizeCollection createEmptyCollection() { + return new ListServingConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListServingConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServingConfigsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceSettings.java new file mode 100644 index 00000000..d829c944 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceSettings.java @@ -0,0 +1,260 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.v2alpha.stub.ServingConfigServiceStubSettings; +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 ServingConfigServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceSettings.Builder servingConfigServiceSettingsBuilder =
+ *     ServingConfigServiceSettings.newBuilder();
+ * servingConfigServiceSettingsBuilder
+ *     .createServingConfigSettings()
+ *     .setRetrySettings(
+ *         servingConfigServiceSettingsBuilder
+ *             .createServingConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ *     servingConfigServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createServingConfig. */ + public UnaryCallSettings + createServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).createServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings deleteServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).deleteServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateServingConfig. */ + public UnaryCallSettings + updateServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).updateServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to getServingConfig. */ + public UnaryCallSettings getServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).getServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to listServingConfigs. */ + public PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).listServingConfigsSettings(); + } + + /** Returns the object with the settings used for calls to addControl. */ + public UnaryCallSettings addControlSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).addControlSettings(); + } + + /** Returns the object with the settings used for calls to removeControl. */ + public UnaryCallSettings removeControlSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).removeControlSettings(); + } + + public static final ServingConfigServiceSettings create(ServingConfigServiceStubSettings stub) + throws IOException { + return new ServingConfigServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ServingConfigServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ServingConfigServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ServingConfigServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ServingConfigServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ServingConfigServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ServingConfigServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServingConfigServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ServingConfigServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ServingConfigServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ServingConfigServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ServingConfigServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ServingConfigServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ServingConfigServiceStubSettings.newBuilder()); + } + + public ServingConfigServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ServingConfigServiceStubSettings.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 createServingConfig. */ + public UnaryCallSettings.Builder + createServingConfigSettings() { + return getStubSettingsBuilder().createServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings.Builder + deleteServingConfigSettings() { + return getStubSettingsBuilder().deleteServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateServingConfig. */ + public UnaryCallSettings.Builder + updateServingConfigSettings() { + return getStubSettingsBuilder().updateServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getServingConfig. */ + public UnaryCallSettings.Builder + getServingConfigSettings() { + return getStubSettingsBuilder().getServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listServingConfigs. */ + public PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return getStubSettingsBuilder().listServingConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to addControl. */ + public UnaryCallSettings.Builder addControlSettings() { + return getStubSettingsBuilder().addControlSettings(); + } + + /** Returns the builder for the settings used for calls to removeControl. */ + public UnaryCallSettings.Builder removeControlSettings() { + return getStubSettingsBuilder().removeControlSettings(); + } + + @Override + public ServingConfigServiceSettings build() throws IOException { + return new ServingConfigServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java new file mode 100644 index 00000000..e964d571 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java @@ -0,0 +1,586 @@ +/* + * 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.v2alpha; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.UserEventServiceStub; +import com.google.cloud.retail.v2alpha.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for ingesting end user actions on the customer website. + * + *

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 (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the UserEventServiceClient 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 UserEventServiceSettings 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.
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * UserEventServiceClient userEventServiceClient =
+ *     UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceClient implements BackgroundResource { + private final UserEventServiceSettings settings; + private final UserEventServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of UserEventServiceClient with default settings. */ + public static final UserEventServiceClient create() throws IOException { + return create(UserEventServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient create(UserEventServiceSettings settings) + throws IOException { + return new UserEventServiceClient(settings); + } + + /** + * Constructs an instance of UserEventServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(UserEventServiceSettings). + */ + public static final UserEventServiceClient create(UserEventServiceStub stub) { + return new UserEventServiceClient(stub); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient(UserEventServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((UserEventServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected UserEventServiceClient(UserEventServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final UserEventServiceSettings getSettings() { + return settings; + } + + public UserEventServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .build();
+   *   UserEvent response = userEventServiceClient.writeUserEvent(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 UserEvent writeUserEvent(WriteUserEventRequest request) { + return writeUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.writeUserEventCallable().futureCall(request);
+   *   // Do something.
+   *   UserEvent response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable writeUserEventCallable() { + return stub.writeUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent("userEvent315571599")
+   *           .setUri("uri116076")
+   *           .setEts(100772)
+   *           .build();
+   *   HttpBody response = userEventServiceClient.collectUserEvent(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 HttpBody collectUserEvent(CollectUserEventRequest request) { + return collectUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent("userEvent315571599")
+   *           .setUri("uri116076")
+   *           .setEts(100772)
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.collectUserEventCallable().futureCall(request);
+   *   // Do something.
+   *   HttpBody response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable collectUserEventCallable() { + return stub.collectUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(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 purgeUserEventsAsync( + PurgeUserEventsRequest request) { + return purgeUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PurgeUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + purgeUserEventsOperationCallable() { + return stub.purgeUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.purgeUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable purgeUserEventsCallable() { + return stub.purgeUserEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   ImportUserEventsResponse response =
+   *       userEventServiceClient.importUserEventsAsync(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 importUserEventsAsync( + ImportUserEventsRequest request) { + return importUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + importUserEventsOperationCallable() { + return stub.importUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.importUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importUserEventsCallable() { + return stub.importUserEventsCallable(); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   RejoinUserEventsResponse response =
+   *       userEventServiceClient.rejoinUserEventsAsync(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 + rejoinUserEventsAsync(RejoinUserEventsRequest request) { + return rejoinUserEventsOperationCallable().futureCall(request); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   OperationFuture future =
+   *       userEventServiceClient.rejoinUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RejoinUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + return stub.rejoinUserEventsOperationCallable(); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   ApiFuture future =
+   *       userEventServiceClient.rejoinUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable rejoinUserEventsCallable() { + return stub.rejoinUserEventsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceSettings.java new file mode 100644 index 00000000..4e413e80 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceSettings.java @@ -0,0 +1,269 @@ +/* + * 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.v2alpha; + +import com.google.api.HttpBody; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link UserEventServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder
+ *             .writeUserEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).writeUserEventSettings(); + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).collectUserEventSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public OperationCallSettings + purgeUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsOperationSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public OperationCallSettings + importUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsOperationSettings(); + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings rejoinUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).rejoinUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).rejoinUserEventsOperationSettings(); + } + + public static final UserEventServiceSettings create(UserEventServiceStubSettings stub) + throws IOException { + return new UserEventServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return UserEventServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return UserEventServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return UserEventServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return UserEventServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return UserEventServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return UserEventServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return UserEventServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 UserEventServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for UserEventServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(UserEventServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(UserEventServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(UserEventServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(UserEventServiceStubSettings.newBuilder()); + } + + public UserEventServiceStubSettings.Builder getStubSettingsBuilder() { + return ((UserEventServiceStubSettings.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 writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return getStubSettingsBuilder().writeUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return getStubSettingsBuilder().collectUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return getStubSettingsBuilder().purgeUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings() { + return getStubSettingsBuilder().purgeUserEventsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return getStubSettingsBuilder().importUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return getStubSettingsBuilder().importUserEventsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings.Builder + rejoinUserEventsSettings() { + return getStubSettingsBuilder().rejoinUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return getStubSettingsBuilder().rejoinUserEventsOperationSettings(); + } + + @Override + public UserEventServiceSettings build() throws IOException { + return new UserEventServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json new file mode 100644 index 00000000..d9c9f227 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json @@ -0,0 +1,213 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.retail.v2alpha", + "libraryPackage": "com.google.cloud.retail.v2alpha", + "services": { + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "CatalogServiceClient", + "rpcs": { + "AddCatalogAttribute": { + "methods": ["addCatalogAttribute", "addCatalogAttributeCallable"] + }, + "GetAttributesConfig": { + "methods": ["getAttributesConfig", "getAttributesConfig", "getAttributesConfig", "getAttributesConfigCallable"] + }, + "GetCompletionConfig": { + "methods": ["getCompletionConfig", "getCompletionConfig", "getCompletionConfig", "getCompletionConfigCallable"] + }, + "GetDefaultBranch": { + "methods": ["getDefaultBranch", "getDefaultBranch", "getDefaultBranch", "getDefaultBranchCallable"] + }, + "ListCatalogs": { + "methods": ["listCatalogs", "listCatalogs", "listCatalogs", "listCatalogsPagedCallable", "listCatalogsCallable"] + }, + "RemoveCatalogAttribute": { + "methods": ["removeCatalogAttribute", "removeCatalogAttributeCallable"] + }, + "ReplaceCatalogAttribute": { + "methods": ["replaceCatalogAttribute", "replaceCatalogAttributeCallable"] + }, + "SetDefaultBranch": { + "methods": ["setDefaultBranch", "setDefaultBranch", "setDefaultBranch", "setDefaultBranchCallable"] + }, + "UpdateAttributesConfig": { + "methods": ["updateAttributesConfig", "updateAttributesConfig", "updateAttributesConfigCallable"] + }, + "UpdateCatalog": { + "methods": ["updateCatalog", "updateCatalog", "updateCatalogCallable"] + }, + "UpdateCompletionConfig": { + "methods": ["updateCompletionConfig", "updateCompletionConfig", "updateCompletionConfigCallable"] + } + } + } + } + }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": ["completeQuery", "completeQueryCallable"] + }, + "ImportCompletionData": { + "methods": ["importCompletionDataAsync", "importCompletionDataOperationCallable", "importCompletionDataCallable"] + } + } + } + } + }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceClient", + "rpcs": { + "CreateControl": { + "methods": ["createControl", "createControl", "createControl", "createControlCallable"] + }, + "DeleteControl": { + "methods": ["deleteControl", "deleteControl", "deleteControl", "deleteControlCallable"] + }, + "GetControl": { + "methods": ["getControl", "getControl", "getControl", "getControlCallable"] + }, + "ListControls": { + "methods": ["listControls", "listControls", "listControls", "listControlsPagedCallable", "listControlsCallable"] + }, + "UpdateControl": { + "methods": ["updateControl", "updateControl", "updateControlCallable"] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": ["predict", "predictCallable"] + } + } + } + } + }, + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "ProductServiceClient", + "rpcs": { + "AddFulfillmentPlaces": { + "methods": ["addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesOperationCallable", "addFulfillmentPlacesCallable"] + }, + "AddLocalInventories": { + "methods": ["addLocalInventoriesAsync", "addLocalInventoriesAsync", "addLocalInventoriesAsync", "addLocalInventoriesOperationCallable", "addLocalInventoriesCallable"] + }, + "CreateProduct": { + "methods": ["createProduct", "createProduct", "createProduct", "createProductCallable"] + }, + "DeleteProduct": { + "methods": ["deleteProduct", "deleteProduct", "deleteProduct", "deleteProductCallable"] + }, + "GetProduct": { + "methods": ["getProduct", "getProduct", "getProduct", "getProductCallable"] + }, + "ImportProducts": { + "methods": ["importProductsAsync", "importProductsOperationCallable", "importProductsCallable"] + }, + "ListProducts": { + "methods": ["listProducts", "listProducts", "listProducts", "listProductsPagedCallable", "listProductsCallable"] + }, + "PurgeProducts": { + "methods": ["purgeProductsAsync", "purgeProductsOperationCallable", "purgeProductsCallable"] + }, + "RemoveFulfillmentPlaces": { + "methods": ["removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesOperationCallable", "removeFulfillmentPlacesCallable"] + }, + "RemoveLocalInventories": { + "methods": ["removeLocalInventoriesAsync", "removeLocalInventoriesAsync", "removeLocalInventoriesAsync", "removeLocalInventoriesOperationCallable", "removeLocalInventoriesCallable"] + }, + "SetInventory": { + "methods": ["setInventoryAsync", "setInventoryAsync", "setInventoryOperationCallable", "setInventoryCallable"] + }, + "UpdateProduct": { + "methods": ["updateProduct", "updateProduct", "updateProductCallable"] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": ["search", "searchPagedCallable", "searchCallable"] + } + } + } + } + }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "ServingConfigServiceClient", + "rpcs": { + "AddControl": { + "methods": ["addControl", "addControl", "addControl", "addControlCallable"] + }, + "CreateServingConfig": { + "methods": ["createServingConfig", "createServingConfig", "createServingConfig", "createServingConfigCallable"] + }, + "DeleteServingConfig": { + "methods": ["deleteServingConfig", "deleteServingConfig", "deleteServingConfig", "deleteServingConfigCallable"] + }, + "GetServingConfig": { + "methods": ["getServingConfig", "getServingConfig", "getServingConfig", "getServingConfigCallable"] + }, + "ListServingConfigs": { + "methods": ["listServingConfigs", "listServingConfigs", "listServingConfigs", "listServingConfigsPagedCallable", "listServingConfigsCallable"] + }, + "RemoveControl": { + "methods": ["removeControl", "removeControl", "removeControl", "removeControlCallable"] + }, + "UpdateServingConfig": { + "methods": ["updateServingConfig", "updateServingConfig", "updateServingConfigCallable"] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventServiceClient", + "rpcs": { + "CollectUserEvent": { + "methods": ["collectUserEvent", "collectUserEventCallable"] + }, + "ImportUserEvents": { + "methods": ["importUserEventsAsync", "importUserEventsOperationCallable", "importUserEventsCallable"] + }, + "PurgeUserEvents": { + "methods": ["purgeUserEventsAsync", "purgeUserEventsOperationCallable", "purgeUserEventsCallable"] + }, + "RejoinUserEvents": { + "methods": ["rejoinUserEventsAsync", "rejoinUserEventsOperationCallable", "rejoinUserEventsCallable"] + }, + "WriteUserEvent": { + "methods": ["writeUserEvent", "writeUserEventCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java new file mode 100644 index 00000000..c63031f5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java @@ -0,0 +1,207 @@ +/* + * 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. + */ + +/** + * A client to Retail API + * + *

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

======================= CatalogServiceClient ======================= + * + *

Service Description: Service for managing catalog configuration. + * + *

Sample for CatalogServiceClient: + * + *

{@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()) {
+ *   Catalog catalog = Catalog.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+ * }
+ * }
+ * + *

======================= CompletionServiceClient ======================= + * + *

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

Sample for CompletionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

======================= ControlServiceClient ======================= + * + *

Service Description: Service for modifying Control. + * + *

Sample for ControlServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   Control control = Control.newBuilder().build();
+ *   String controlId = "controlId-395080872";
+ *   Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ * + *

======================= PredictionServiceClient ======================= + * + *

Service Description: Service for making recommendation prediction. + * + *

Sample for PredictionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   PredictRequest request =
+ *       PredictRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllLabels(new HashMap())
+ *           .build();
+ *   PredictResponse response = predictionServiceClient.predict(request);
+ * }
+ * }
+ * + *

======================= ProductServiceClient ======================= + * + *

Service Description: Service for ingesting [Product][google.cloud.retail.v2alpha.Product] + * information of the customer's website. + * + *

Sample for ProductServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "productId-1051830678";
+ *   Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ * + *

======================= SearchServiceClient ======================= + * + *

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

Sample for SearchServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

======================= ServingConfigServiceClient ======================= + * + *

Service Description: Service for modifying ServingConfig. + * + *

Sample for ServingConfigServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ *   String servingConfigId = "servingConfigId-831052759";
+ *   ServingConfig response =
+ *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ * + *

======================= UserEventServiceClient ======================= + * + *

Service Description: Service for ingesting end user actions on the customer website. + * + *

Sample for UserEventServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.retail.v2alpha; + +import javax.annotation.Generated; diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStub.java new file mode 100644 index 00000000..88ac6f55 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStub.java @@ -0,0 +1,108 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.CatalogServiceClient.ListCatalogsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.AttributesConfig; +import com.google.cloud.retail.v2alpha.Catalog; +import com.google.cloud.retail.v2alpha.CompletionConfig; +import com.google.cloud.retail.v2alpha.GetAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.GetCompletionConfigRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchResponse; +import com.google.cloud.retail.v2alpha.ListCatalogsRequest; +import com.google.cloud.retail.v2alpha.ListCatalogsResponse; +import com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.SetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.UpdateCatalogRequest; +import com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CatalogService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CatalogServiceStub implements BackgroundResource { + + public UnaryCallable listCatalogsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogsPagedCallable()"); + } + + public UnaryCallable listCatalogsCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogsCallable()"); + } + + public UnaryCallable updateCatalogCallable() { + throw new UnsupportedOperationException("Not implemented: updateCatalogCallable()"); + } + + public UnaryCallable setDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: setDefaultBranchCallable()"); + } + + public UnaryCallable + getDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: getDefaultBranchCallable()"); + } + + public UnaryCallable getCompletionConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getCompletionConfigCallable()"); + } + + public UnaryCallable + updateCompletionConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateCompletionConfigCallable()"); + } + + public UnaryCallable getAttributesConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getAttributesConfigCallable()"); + } + + public UnaryCallable + updateAttributesConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateAttributesConfigCallable()"); + } + + public UnaryCallable addCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: addCatalogAttributeCallable()"); + } + + public UnaryCallable + removeCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: removeCatalogAttributeCallable()"); + } + + public UnaryCallable + replaceCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: replaceCatalogAttributeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java new file mode 100644 index 00000000..818c66a5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java @@ -0,0 +1,617 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.CatalogServiceClient.ListCatalogsPagedResponse; + +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.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.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.v2alpha.AddCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.AttributesConfig; +import com.google.cloud.retail.v2alpha.Catalog; +import com.google.cloud.retail.v2alpha.CompletionConfig; +import com.google.cloud.retail.v2alpha.GetAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.GetCompletionConfigRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchResponse; +import com.google.cloud.retail.v2alpha.ListCatalogsRequest; +import com.google.cloud.retail.v2alpha.ListCatalogsResponse; +import com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.SetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.UpdateCatalogRequest; +import com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; +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.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 CatalogServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CatalogServiceStubSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceStubSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .updateCatalogSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder
+ *             .updateCatalogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceStubSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceStubSettings 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 PagedCallSettings< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings; + private final UnaryCallSettings updateCatalogSettings; + private final UnaryCallSettings setDefaultBranchSettings; + private final UnaryCallSettings + getDefaultBranchSettings; + private final UnaryCallSettings + getCompletionConfigSettings; + private final UnaryCallSettings + updateCompletionConfigSettings; + private final UnaryCallSettings + getAttributesConfigSettings; + private final UnaryCallSettings + updateAttributesConfigSettings; + private final UnaryCallSettings + addCatalogAttributeSettings; + private final UnaryCallSettings + removeCatalogAttributeSettings; + private final UnaryCallSettings + replaceCatalogAttributeSettings; + + private static final PagedListDescriptor + LIST_CATALOGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCatalogsRequest injectToken(ListCatalogsRequest payload, String token) { + return ListCatalogsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCatalogsRequest injectPageSize(ListCatalogsRequest payload, int pageSize) { + return ListCatalogsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCatalogsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCatalogsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCatalogsResponse payload) { + return payload.getCatalogsList() == null + ? ImmutableList.of() + : payload.getCatalogsList(); + } + }; + + private static final PagedListResponseFactory< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + LIST_CATALOGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCatalogsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CATALOGS_PAGE_STR_DESC, request, context); + return ListCatalogsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listCatalogs. */ + public PagedCallSettings + listCatalogsSettings() { + return listCatalogsSettings; + } + + /** Returns the object with the settings used for calls to updateCatalog. */ + public UnaryCallSettings updateCatalogSettings() { + return updateCatalogSettings; + } + + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + + /** Returns the object with the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings + getCompletionConfigSettings() { + return getCompletionConfigSettings; + } + + /** Returns the object with the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings + updateCompletionConfigSettings() { + return updateCompletionConfigSettings; + } + + /** Returns the object with the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings + getAttributesConfigSettings() { + return getAttributesConfigSettings; + } + + /** Returns the object with the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings + updateAttributesConfigSettings() { + return updateAttributesConfigSettings; + } + + /** Returns the object with the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings + addCatalogAttributeSettings() { + return addCatalogAttributeSettings; + } + + /** Returns the object with the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings + removeCatalogAttributeSettings() { + return removeCatalogAttributeSettings; + } + + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings + replaceCatalogAttributeSettings() { + return replaceCatalogAttributeSettings; + } + + public CatalogServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCatalogServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CatalogServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CatalogServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listCatalogsSettings = settingsBuilder.listCatalogsSettings().build(); + updateCatalogSettings = settingsBuilder.updateCatalogSettings().build(); + setDefaultBranchSettings = settingsBuilder.setDefaultBranchSettings().build(); + getDefaultBranchSettings = settingsBuilder.getDefaultBranchSettings().build(); + getCompletionConfigSettings = settingsBuilder.getCompletionConfigSettings().build(); + updateCompletionConfigSettings = settingsBuilder.updateCompletionConfigSettings().build(); + getAttributesConfigSettings = settingsBuilder.getAttributesConfigSettings().build(); + updateAttributesConfigSettings = settingsBuilder.updateAttributesConfigSettings().build(); + addCatalogAttributeSettings = settingsBuilder.addCatalogAttributeSettings().build(); + removeCatalogAttributeSettings = settingsBuilder.removeCatalogAttributeSettings().build(); + replaceCatalogAttributeSettings = settingsBuilder.replaceCatalogAttributeSettings().build(); + } + + /** Builder for CatalogServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings; + private final UnaryCallSettings.Builder updateCatalogSettings; + private final UnaryCallSettings.Builder + setDefaultBranchSettings; + private final UnaryCallSettings.Builder + getDefaultBranchSettings; + private final UnaryCallSettings.Builder + getCompletionConfigSettings; + private final UnaryCallSettings.Builder + updateCompletionConfigSettings; + private final UnaryCallSettings.Builder + getAttributesConfigSettings; + private final UnaryCallSettings.Builder + updateAttributesConfigSettings; + private final UnaryCallSettings.Builder + addCatalogAttributeSettings; + private final UnaryCallSettings.Builder + removeCatalogAttributeSettings; + private final UnaryCallSettings.Builder + replaceCatalogAttributeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listCatalogsSettings = PagedCallSettings.newBuilder(LIST_CATALOGS_PAGE_STR_FACT); + updateCatalogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCompletionConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCompletionConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getAttributesConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAttributesConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + replaceCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings, + getCompletionConfigSettings, + updateCompletionConfigSettings, + getAttributesConfigSettings, + updateAttributesConfigSettings, + addCatalogAttributeSettings, + removeCatalogAttributeSettings, + replaceCatalogAttributeSettings); + initDefaults(this); + } + + protected Builder(CatalogServiceStubSettings settings) { + super(settings); + + listCatalogsSettings = settings.listCatalogsSettings.toBuilder(); + updateCatalogSettings = settings.updateCatalogSettings.toBuilder(); + setDefaultBranchSettings = settings.setDefaultBranchSettings.toBuilder(); + getDefaultBranchSettings = settings.getDefaultBranchSettings.toBuilder(); + getCompletionConfigSettings = settings.getCompletionConfigSettings.toBuilder(); + updateCompletionConfigSettings = settings.updateCompletionConfigSettings.toBuilder(); + getAttributesConfigSettings = settings.getAttributesConfigSettings.toBuilder(); + updateAttributesConfigSettings = settings.updateAttributesConfigSettings.toBuilder(); + addCatalogAttributeSettings = settings.addCatalogAttributeSettings.toBuilder(); + removeCatalogAttributeSettings = settings.removeCatalogAttributeSettings.toBuilder(); + replaceCatalogAttributeSettings = settings.replaceCatalogAttributeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings, + getCompletionConfigSettings, + updateCompletionConfigSettings, + getAttributesConfigSettings, + updateAttributesConfigSettings, + addCatalogAttributeSettings, + removeCatalogAttributeSettings, + replaceCatalogAttributeSettings); + } + + 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 initDefaults(Builder builder) { + builder + .listCatalogsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateCatalogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getCompletionConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateCompletionConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getAttributesConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateAttributesConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .addCatalogAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .removeCatalogAttributeSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 listCatalogs. */ + public PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings() { + return listCatalogsSettings; + } + + /** Returns the builder for the settings used for calls to updateCatalog. */ + public UnaryCallSettings.Builder updateCatalogSettings() { + return updateCatalogSettings; + } + + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + + /** Returns the builder for the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings.Builder + getCompletionConfigSettings() { + return getCompletionConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings.Builder + updateCompletionConfigSettings() { + return updateCompletionConfigSettings; + } + + /** Returns the builder for the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings.Builder + getAttributesConfigSettings() { + return getAttributesConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings.Builder + updateAttributesConfigSettings() { + return updateAttributesConfigSettings; + } + + /** Returns the builder for the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings.Builder + addCatalogAttributeSettings() { + return addCatalogAttributeSettings; + } + + /** Returns the builder for the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings.Builder + removeCatalogAttributeSettings() { + return removeCatalogAttributeSettings; + } + + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings.Builder + replaceCatalogAttributeSettings() { + return replaceCatalogAttributeSettings; + } + + @Override + public CatalogServiceStubSettings build() throws IOException { + return new CatalogServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStub.java new file mode 100644 index 00000000..7b2bd81a --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStub.java @@ -0,0 +1,63 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.CompleteQueryRequest; +import com.google.cloud.retail.v2alpha.CompleteQueryResponse; +import com.google.cloud.retail.v2alpha.ImportCompletionDataRequest; +import com.google.cloud.retail.v2alpha.ImportCompletionDataResponse; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CompletionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable completeQueryCallable() { + throw new UnsupportedOperationException("Not implemented: completeQueryCallable()"); + } + + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: importCompletionDataOperationCallable()"); + } + + public UnaryCallable importCompletionDataCallable() { + throw new UnsupportedOperationException("Not implemented: importCompletionDataCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java new file mode 100644 index 00000000..6e939255 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java @@ -0,0 +1,367 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.CompleteQueryRequest; +import com.google.cloud.retail.v2alpha.CompleteQueryResponse; +import com.google.cloud.retail.v2alpha.ImportCompletionDataRequest; +import com.google.cloud.retail.v2alpha.ImportCompletionDataResponse; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceStubSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceStubSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceStubSettings completionServiceSettings =
+ *     completionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceStubSettings 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 + completeQuerySettings; + private final UnaryCallSettings + importCompletionDataSettings; + private final OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + public CompletionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCompletionServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CompletionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CompletionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + completeQuerySettings = settingsBuilder.completeQuerySettings().build(); + importCompletionDataSettings = settingsBuilder.importCompletionDataSettings().build(); + importCompletionDataOperationSettings = + settingsBuilder.importCompletionDataOperationSettings().build(); + } + + /** Builder for CompletionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + completeQuerySettings; + private final UnaryCallSettings.Builder + importCompletionDataSettings; + private final OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + completeQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + initDefaults(this); + } + + protected Builder(CompletionServiceStubSettings settings) { + super(settings); + + completeQuerySettings = settings.completeQuerySettings.toBuilder(); + importCompletionDataSettings = settings.importCompletionDataSettings.toBuilder(); + importCompletionDataOperationSettings = + settings.importCompletionDataOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + } + + 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 initDefaults(Builder builder) { + builder + .completeQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ImportCompletionDataResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + @Override + public CompletionServiceStubSettings build() throws IOException { + return new CompletionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStub.java new file mode 100644 index 00000000..ff0b0ed9 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStub.java @@ -0,0 +1,70 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ControlServiceClient.ListControlsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.Control; +import com.google.cloud.retail.v2alpha.CreateControlRequest; +import com.google.cloud.retail.v2alpha.DeleteControlRequest; +import com.google.cloud.retail.v2alpha.GetControlRequest; +import com.google.cloud.retail.v2alpha.ListControlsRequest; +import com.google.cloud.retail.v2alpha.ListControlsResponse; +import com.google.cloud.retail.v2alpha.UpdateControlRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ControlService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ControlServiceStub implements BackgroundResource { + + public UnaryCallable createControlCallable() { + throw new UnsupportedOperationException("Not implemented: createControlCallable()"); + } + + public UnaryCallable deleteControlCallable() { + throw new UnsupportedOperationException("Not implemented: deleteControlCallable()"); + } + + public UnaryCallable updateControlCallable() { + throw new UnsupportedOperationException("Not implemented: updateControlCallable()"); + } + + public UnaryCallable getControlCallable() { + throw new UnsupportedOperationException("Not implemented: getControlCallable()"); + } + + public UnaryCallable listControlsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listControlsPagedCallable()"); + } + + public UnaryCallable listControlsCallable() { + throw new UnsupportedOperationException("Not implemented: listControlsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java new file mode 100644 index 00000000..d58eafd2 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java @@ -0,0 +1,429 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ControlServiceClient.ListControlsPagedResponse; + +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.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.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.v2alpha.Control; +import com.google.cloud.retail.v2alpha.CreateControlRequest; +import com.google.cloud.retail.v2alpha.DeleteControlRequest; +import com.google.cloud.retail.v2alpha.GetControlRequest; +import com.google.cloud.retail.v2alpha.ListControlsRequest; +import com.google.cloud.retail.v2alpha.ListControlsResponse; +import com.google.cloud.retail.v2alpha.UpdateControlRequest; +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.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 ControlServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceStubSettings.Builder controlServiceSettingsBuilder =
+ *     ControlServiceStubSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ *     .createControlSettings()
+ *     .setRetrySettings(
+ *         controlServiceSettingsBuilder
+ *             .createControlSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ControlServiceStubSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceStubSettings 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 createControlSettings; + private final UnaryCallSettings deleteControlSettings; + private final UnaryCallSettings updateControlSettings; + private final UnaryCallSettings getControlSettings; + private final PagedCallSettings< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings; + + private static final PagedListDescriptor + LIST_CONTROLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListControlsRequest injectToken(ListControlsRequest payload, String token) { + return ListControlsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListControlsRequest injectPageSize(ListControlsRequest payload, int pageSize) { + return ListControlsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListControlsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListControlsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListControlsResponse payload) { + return payload.getControlsList() == null + ? ImmutableList.of() + : payload.getControlsList(); + } + }; + + private static final PagedListResponseFactory< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + LIST_CONTROLS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListControlsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONTROLS_PAGE_STR_DESC, request, context); + return ListControlsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createControl. */ + public UnaryCallSettings createControlSettings() { + return createControlSettings; + } + + /** Returns the object with the settings used for calls to deleteControl. */ + public UnaryCallSettings deleteControlSettings() { + return deleteControlSettings; + } + + /** Returns the object with the settings used for calls to updateControl. */ + public UnaryCallSettings updateControlSettings() { + return updateControlSettings; + } + + /** Returns the object with the settings used for calls to getControl. */ + public UnaryCallSettings getControlSettings() { + return getControlSettings; + } + + /** Returns the object with the settings used for calls to listControls. */ + public PagedCallSettings + listControlsSettings() { + return listControlsSettings; + } + + public ControlServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcControlServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ControlServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ControlServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createControlSettings = settingsBuilder.createControlSettings().build(); + deleteControlSettings = settingsBuilder.deleteControlSettings().build(); + updateControlSettings = settingsBuilder.updateControlSettings().build(); + getControlSettings = settingsBuilder.getControlSettings().build(); + listControlsSettings = settingsBuilder.listControlsSettings().build(); + } + + /** Builder for ControlServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createControlSettings; + private final UnaryCallSettings.Builder deleteControlSettings; + private final UnaryCallSettings.Builder updateControlSettings; + private final UnaryCallSettings.Builder getControlSettings; + private final PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings; + 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); + + createControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listControlsSettings = PagedCallSettings.newBuilder(LIST_CONTROLS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createControlSettings, + deleteControlSettings, + updateControlSettings, + getControlSettings, + listControlsSettings); + initDefaults(this); + } + + protected Builder(ControlServiceStubSettings settings) { + super(settings); + + createControlSettings = settings.createControlSettings.toBuilder(); + deleteControlSettings = settings.deleteControlSettings.toBuilder(); + updateControlSettings = settings.updateControlSettings.toBuilder(); + getControlSettings = settings.getControlSettings.toBuilder(); + listControlsSettings = settings.listControlsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createControlSettings, + deleteControlSettings, + updateControlSettings, + getControlSettings, + listControlsSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listControlsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 createControl. */ + public UnaryCallSettings.Builder createControlSettings() { + return createControlSettings; + } + + /** Returns the builder for the settings used for calls to deleteControl. */ + public UnaryCallSettings.Builder deleteControlSettings() { + return deleteControlSettings; + } + + /** Returns the builder for the settings used for calls to updateControl. */ + public UnaryCallSettings.Builder updateControlSettings() { + return updateControlSettings; + } + + /** Returns the builder for the settings used for calls to getControl. */ + public UnaryCallSettings.Builder getControlSettings() { + return getControlSettings; + } + + /** Returns the builder for the settings used for calls to listControls. */ + public PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings() { + return listControlsSettings; + } + + @Override + public ControlServiceStubSettings build() throws IOException { + return new ControlServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceCallableFactory.java new file mode 100644 index 00000000..c4a6e969 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CatalogService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCatalogServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceStub.java new file mode 100644 index 00000000..cc9faeb1 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCatalogServiceStub.java @@ -0,0 +1,528 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.CatalogServiceClient.ListCatalogsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.AttributesConfig; +import com.google.cloud.retail.v2alpha.Catalog; +import com.google.cloud.retail.v2alpha.CompletionConfig; +import com.google.cloud.retail.v2alpha.GetAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.GetCompletionConfigRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.GetDefaultBranchResponse; +import com.google.cloud.retail.v2alpha.ListCatalogsRequest; +import com.google.cloud.retail.v2alpha.ListCatalogsResponse; +import com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2alpha.SetDefaultBranchRequest; +import com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2alpha.UpdateCatalogRequest; +import com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; +import com.google.common.collect.ImmutableMap; +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 CatalogService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCatalogServiceStub extends CatalogServiceStub { + private static final MethodDescriptor + listCatalogsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/ListCatalogs") + .setRequestMarshaller(ProtoUtils.marshaller(ListCatalogsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCatalogsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCatalogMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/UpdateCatalog") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCatalogRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Catalog.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/SetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/GetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GetDefaultBranchResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCompletionConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/GetCompletionConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCompletionConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCompletionConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.CatalogService/UpdateCompletionConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCompletionConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAttributesConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/GetAttributesConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAttributesConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAttributesConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.CatalogService/UpdateAttributesConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAttributesConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CatalogService/AddCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(AddCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.CatalogService/RemoveCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + replaceCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.CatalogService/ReplaceCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(ReplaceCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private final UnaryCallable listCatalogsCallable; + private final UnaryCallable + listCatalogsPagedCallable; + private final UnaryCallable updateCatalogCallable; + private final UnaryCallable setDefaultBranchCallable; + private final UnaryCallable + getDefaultBranchCallable; + private final UnaryCallable + getCompletionConfigCallable; + private final UnaryCallable + updateCompletionConfigCallable; + private final UnaryCallable + getAttributesConfigCallable; + private final UnaryCallable + updateAttributesConfigCallable; + private final UnaryCallable + addCatalogAttributeCallable; + private final UnaryCallable + removeCatalogAttributeCallable; + private final UnaryCallable + replaceCatalogAttributeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCatalogServiceStub create(CatalogServiceStubSettings settings) + throws IOException { + return new GrpcCatalogServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCatalogServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCatalogServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub(CatalogServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCatalogServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub( + CatalogServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listCatalogsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCatalogsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateCatalogTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCatalogMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog.name", String.valueOf(request.getCatalog().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultBranchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings + getDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDefaultBranchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings + getCompletionConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCompletionConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateCompletionConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCompletionConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "completion_config.name", + String.valueOf(request.getCompletionConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getAttributesConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAttributesConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateAttributesConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAttributesConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config.name", + String.valueOf(request.getAttributesConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + addCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings + replaceCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(replaceCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + + this.listCatalogsCallable = + callableFactory.createUnaryCallable( + listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext); + this.listCatalogsPagedCallable = + callableFactory.createPagedCallable( + listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext); + this.updateCatalogCallable = + callableFactory.createUnaryCallable( + updateCatalogTransportSettings, settings.updateCatalogSettings(), clientContext); + this.setDefaultBranchCallable = + callableFactory.createUnaryCallable( + setDefaultBranchTransportSettings, settings.setDefaultBranchSettings(), clientContext); + this.getDefaultBranchCallable = + callableFactory.createUnaryCallable( + getDefaultBranchTransportSettings, settings.getDefaultBranchSettings(), clientContext); + this.getCompletionConfigCallable = + callableFactory.createUnaryCallable( + getCompletionConfigTransportSettings, + settings.getCompletionConfigSettings(), + clientContext); + this.updateCompletionConfigCallable = + callableFactory.createUnaryCallable( + updateCompletionConfigTransportSettings, + settings.updateCompletionConfigSettings(), + clientContext); + this.getAttributesConfigCallable = + callableFactory.createUnaryCallable( + getAttributesConfigTransportSettings, + settings.getAttributesConfigSettings(), + clientContext); + this.updateAttributesConfigCallable = + callableFactory.createUnaryCallable( + updateAttributesConfigTransportSettings, + settings.updateAttributesConfigSettings(), + clientContext); + this.addCatalogAttributeCallable = + callableFactory.createUnaryCallable( + addCatalogAttributeTransportSettings, + settings.addCatalogAttributeSettings(), + clientContext); + this.removeCatalogAttributeCallable = + callableFactory.createUnaryCallable( + removeCatalogAttributeTransportSettings, + settings.removeCatalogAttributeSettings(), + clientContext); + this.replaceCatalogAttributeCallable = + callableFactory.createUnaryCallable( + replaceCatalogAttributeTransportSettings, + settings.replaceCatalogAttributeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCatalogsCallable() { + return listCatalogsCallable; + } + + @Override + public UnaryCallable listCatalogsPagedCallable() { + return listCatalogsPagedCallable; + } + + @Override + public UnaryCallable updateCatalogCallable() { + return updateCatalogCallable; + } + + @Override + public UnaryCallable setDefaultBranchCallable() { + return setDefaultBranchCallable; + } + + @Override + public UnaryCallable + getDefaultBranchCallable() { + return getDefaultBranchCallable; + } + + @Override + public UnaryCallable getCompletionConfigCallable() { + return getCompletionConfigCallable; + } + + @Override + public UnaryCallable + updateCompletionConfigCallable() { + return updateCompletionConfigCallable; + } + + @Override + public UnaryCallable getAttributesConfigCallable() { + return getAttributesConfigCallable; + } + + @Override + public UnaryCallable + updateAttributesConfigCallable() { + return updateAttributesConfigCallable; + } + + @Override + public UnaryCallable addCatalogAttributeCallable() { + return addCatalogAttributeCallable; + } + + @Override + public UnaryCallable + removeCatalogAttributeCallable() { + return removeCatalogAttributeCallable; + } + + @Override + public UnaryCallable + replaceCatalogAttributeCallable() { + return replaceCatalogAttributeCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceCallableFactory.java new file mode 100644 index 00000000..bde8d274 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CompletionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceStub.java new file mode 100644 index 00000000..8f87ce74 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcCompletionServiceStub.java @@ -0,0 +1,218 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.CompleteQueryRequest; +import com.google.cloud.retail.v2alpha.CompleteQueryResponse; +import com.google.cloud.retail.v2alpha.ImportCompletionDataRequest; +import com.google.cloud.retail.v2alpha.ImportCompletionDataResponse; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceStub extends CompletionServiceStub { + private static final MethodDescriptor + completeQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.CompletionService/CompleteQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CompleteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CompleteQueryResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importCompletionDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.CompletionService/ImportCompletionData") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportCompletionDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable completeQueryCallable; + private final UnaryCallable importCompletionDataCallable; + private final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCompletionServiceStub create(CompletionServiceStubSettings settings) + throws IOException { + return new GrpcCompletionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCompletionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCompletionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, 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 GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCompletionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, 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 GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings completeQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(completeQueryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings importCompletionDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importCompletionDataMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.completeQueryCallable = + callableFactory.createUnaryCallable( + completeQueryTransportSettings, settings.completeQuerySettings(), clientContext); + this.importCompletionDataCallable = + callableFactory.createUnaryCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataSettings(), + clientContext); + this.importCompletionDataOperationCallable = + callableFactory.createOperationCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable completeQueryCallable() { + return completeQueryCallable; + } + + @Override + public UnaryCallable importCompletionDataCallable() { + return importCompletionDataCallable; + } + + @Override + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return importCompletionDataOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceCallableFactory.java new file mode 100644 index 00000000..f4011612 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ControlService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcControlServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceStub.java new file mode 100644 index 00000000..74907ee4 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcControlServiceStub.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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ControlServiceClient.ListControlsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2alpha.Control; +import com.google.cloud.retail.v2alpha.CreateControlRequest; +import com.google.cloud.retail.v2alpha.DeleteControlRequest; +import com.google.cloud.retail.v2alpha.GetControlRequest; +import com.google.cloud.retail.v2alpha.ListControlsRequest; +import com.google.cloud.retail.v2alpha.ListControlsResponse; +import com.google.cloud.retail.v2alpha.UpdateControlRequest; +import com.google.common.collect.ImmutableMap; +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 ControlService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcControlServiceStub extends ControlServiceStub { + private static final MethodDescriptor + createControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ControlService/CreateControl") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ControlService/DeleteControl") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ControlService/UpdateControl") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ControlService/GetControl") + .setRequestMarshaller(ProtoUtils.marshaller(GetControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listControlsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ControlService/ListControls") + .setRequestMarshaller(ProtoUtils.marshaller(ListControlsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListControlsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createControlCallable; + private final UnaryCallable deleteControlCallable; + private final UnaryCallable updateControlCallable; + private final UnaryCallable getControlCallable; + private final UnaryCallable listControlsCallable; + private final UnaryCallable + listControlsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcControlServiceStub create(ControlServiceStubSettings settings) + throws IOException { + return new GrpcControlServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcControlServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcControlServiceStub( + ControlServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcControlServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcControlServiceStub( + ControlServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcControlServiceStub, 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 GrpcControlServiceStub(ControlServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcControlServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcControlServiceStub, 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 GrpcControlServiceStub( + ControlServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("control.name", String.valueOf(request.getControl().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listControlsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listControlsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createControlCallable = + callableFactory.createUnaryCallable( + createControlTransportSettings, settings.createControlSettings(), clientContext); + this.deleteControlCallable = + callableFactory.createUnaryCallable( + deleteControlTransportSettings, settings.deleteControlSettings(), clientContext); + this.updateControlCallable = + callableFactory.createUnaryCallable( + updateControlTransportSettings, settings.updateControlSettings(), clientContext); + this.getControlCallable = + callableFactory.createUnaryCallable( + getControlTransportSettings, settings.getControlSettings(), clientContext); + this.listControlsCallable = + callableFactory.createUnaryCallable( + listControlsTransportSettings, settings.listControlsSettings(), clientContext); + this.listControlsPagedCallable = + callableFactory.createPagedCallable( + listControlsTransportSettings, settings.listControlsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createControlCallable() { + return createControlCallable; + } + + @Override + public UnaryCallable deleteControlCallable() { + return deleteControlCallable; + } + + @Override + public UnaryCallable updateControlCallable() { + return updateControlCallable; + } + + @Override + public UnaryCallable getControlCallable() { + return getControlCallable; + } + + @Override + public UnaryCallable listControlsCallable() { + return listControlsCallable; + } + + @Override + public UnaryCallable listControlsPagedCallable() { + return listControlsPagedCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 00000000..6769e9e7 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the PredictionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceStub.java new file mode 100644 index 00000000..9e630db9 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,162 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.PredictRequest; +import com.google.cloud.retail.v2alpha.PredictResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceStub extends PredictionServiceStub { + private static final MethodDescriptor predictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.PredictionService/Predict") + .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable predictCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new GrpcPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings predictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("placement", String.valueOf(request.getPlacement())); + return params.build(); + }) + .build(); + + this.predictCallable = + callableFactory.createUnaryCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable predictCallable() { + return predictCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceCallableFactory.java new file mode 100644 index 00000000..f287d9c6 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ProductService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcProductServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceStub.java new file mode 100644 index 00000000..fb3888cd --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcProductServiceStub.java @@ -0,0 +1,649 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ProductServiceClient.ListProductsPagedResponse; + +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.v2alpha.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.CreateProductRequest; +import com.google.cloud.retail.v2alpha.DeleteProductRequest; +import com.google.cloud.retail.v2alpha.GetProductRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportProductsRequest; +import com.google.cloud.retail.v2alpha.ImportProductsResponse; +import com.google.cloud.retail.v2alpha.ListProductsRequest; +import com.google.cloud.retail.v2alpha.ListProductsResponse; +import com.google.cloud.retail.v2alpha.Product; +import com.google.cloud.retail.v2alpha.PurgeProductsMetadata; +import com.google.cloud.retail.v2alpha.PurgeProductsRequest; +import com.google.cloud.retail.v2alpha.PurgeProductsResponse; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.SetInventoryMetadata; +import com.google.cloud.retail.v2alpha.SetInventoryRequest; +import com.google.cloud.retail.v2alpha.SetInventoryResponse; +import com.google.cloud.retail.v2alpha.UpdateProductRequest; +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 ProductService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcProductServiceStub extends ProductServiceStub { + private static final MethodDescriptor + createProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/CreateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/GetProduct") + .setRequestMarshaller(ProtoUtils.marshaller(GetProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/ListProducts") + .setRequestMarshaller(ProtoUtils.marshaller(ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/UpdateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + purgeProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/PurgeProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeProductsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/ImportProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProductsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/SetInventory") + .setRequestMarshaller(ProtoUtils.marshaller(SetInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/AddFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(AddFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ProductService/RemoveFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addLocalInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ProductService/AddLocalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(AddLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeLocalInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ProductService/RemoveLocalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable createProductCallable; + private final UnaryCallable getProductCallable; + private final UnaryCallable listProductsCallable; + private final UnaryCallable + listProductsPagedCallable; + private final UnaryCallable updateProductCallable; + private final UnaryCallable deleteProductCallable; + private final UnaryCallable purgeProductsCallable; + private final OperationCallable< + PurgeProductsRequest, PurgeProductsResponse, PurgeProductsMetadata> + purgeProductsOperationCallable; + private final UnaryCallable importProductsCallable; + private final OperationCallable + importProductsOperationCallable; + private final UnaryCallable setInventoryCallable; + private final OperationCallable + setInventoryOperationCallable; + private final UnaryCallable addFulfillmentPlacesCallable; + private final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable; + private final UnaryCallable + removeFulfillmentPlacesCallable; + private final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable; + private final UnaryCallable addLocalInventoriesCallable; + private final OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable; + private final UnaryCallable + removeLocalInventoriesCallable; + private final OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcProductServiceStub create(ProductServiceStubSettings settings) + throws IOException { + return new GrpcProductServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcProductServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcProductServiceStub( + ProductServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcProductServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcProductServiceStub( + ProductServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcProductServiceStub, 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 GrpcProductServiceStub(ProductServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcProductServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcProductServiceStub, 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 GrpcProductServiceStub( + ProductServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProductsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product.name", String.valueOf(request.getProduct().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings purgeProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeProductsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings importProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importProductsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings setInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("inventory.name", String.valueOf(request.getInventory().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings addFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings addLocalInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addLocalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeLocalInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeLocalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + + this.createProductCallable = + callableFactory.createUnaryCallable( + createProductTransportSettings, settings.createProductSettings(), clientContext); + this.getProductCallable = + callableFactory.createUnaryCallable( + getProductTransportSettings, settings.getProductSettings(), clientContext); + this.listProductsCallable = + callableFactory.createUnaryCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.listProductsPagedCallable = + callableFactory.createPagedCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.updateProductCallable = + callableFactory.createUnaryCallable( + updateProductTransportSettings, settings.updateProductSettings(), clientContext); + this.deleteProductCallable = + callableFactory.createUnaryCallable( + deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); + this.purgeProductsCallable = + callableFactory.createUnaryCallable( + purgeProductsTransportSettings, settings.purgeProductsSettings(), clientContext); + this.purgeProductsOperationCallable = + callableFactory.createOperationCallable( + purgeProductsTransportSettings, + settings.purgeProductsOperationSettings(), + clientContext, + operationsStub); + this.importProductsCallable = + callableFactory.createUnaryCallable( + importProductsTransportSettings, settings.importProductsSettings(), clientContext); + this.importProductsOperationCallable = + callableFactory.createOperationCallable( + importProductsTransportSettings, + settings.importProductsOperationSettings(), + clientContext, + operationsStub); + this.setInventoryCallable = + callableFactory.createUnaryCallable( + setInventoryTransportSettings, settings.setInventorySettings(), clientContext); + this.setInventoryOperationCallable = + callableFactory.createOperationCallable( + setInventoryTransportSettings, + settings.setInventoryOperationSettings(), + clientContext, + operationsStub); + this.addFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesSettings(), + clientContext); + this.addFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); + this.removeFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesSettings(), + clientContext); + this.removeFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); + this.addLocalInventoriesCallable = + callableFactory.createUnaryCallable( + addLocalInventoriesTransportSettings, + settings.addLocalInventoriesSettings(), + clientContext); + this.addLocalInventoriesOperationCallable = + callableFactory.createOperationCallable( + addLocalInventoriesTransportSettings, + settings.addLocalInventoriesOperationSettings(), + clientContext, + operationsStub); + this.removeLocalInventoriesCallable = + callableFactory.createUnaryCallable( + removeLocalInventoriesTransportSettings, + settings.removeLocalInventoriesSettings(), + clientContext); + this.removeLocalInventoriesOperationCallable = + callableFactory.createOperationCallable( + removeLocalInventoriesTransportSettings, + settings.removeLocalInventoriesOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createProductCallable() { + return createProductCallable; + } + + @Override + public UnaryCallable getProductCallable() { + return getProductCallable; + } + + @Override + public UnaryCallable listProductsCallable() { + return listProductsCallable; + } + + @Override + public UnaryCallable listProductsPagedCallable() { + return listProductsPagedCallable; + } + + @Override + public UnaryCallable updateProductCallable() { + return updateProductCallable; + } + + @Override + public UnaryCallable deleteProductCallable() { + return deleteProductCallable; + } + + @Override + public UnaryCallable purgeProductsCallable() { + return purgeProductsCallable; + } + + @Override + public OperationCallable + purgeProductsOperationCallable() { + return purgeProductsOperationCallable; + } + + @Override + public UnaryCallable importProductsCallable() { + return importProductsCallable; + } + + @Override + public OperationCallable + importProductsOperationCallable() { + return importProductsOperationCallable; + } + + @Override + public UnaryCallable setInventoryCallable() { + return setInventoryCallable; + } + + @Override + public OperationCallable + setInventoryOperationCallable() { + return setInventoryOperationCallable; + } + + @Override + public UnaryCallable addFulfillmentPlacesCallable() { + return addFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return addFulfillmentPlacesOperationCallable; + } + + @Override + public UnaryCallable + removeFulfillmentPlacesCallable() { + return removeFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return removeFulfillmentPlacesOperationCallable; + } + + @Override + public UnaryCallable addLocalInventoriesCallable() { + return addLocalInventoriesCallable; + } + + @Override + public OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + return addLocalInventoriesOperationCallable; + } + + @Override + public UnaryCallable removeLocalInventoriesCallable() { + return removeLocalInventoriesCallable; + } + + @Override + public OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + return removeLocalInventoriesOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceCallableFactory.java new file mode 100644 index 00000000..86217378 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SearchService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSearchServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceStub.java new file mode 100644 index 00000000..b191ec9f --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcSearchServiceStub.java @@ -0,0 +1,171 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.SearchServiceClient.SearchPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2alpha.SearchRequest; +import com.google.cloud.retail.v2alpha.SearchResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSearchServiceStub extends SearchServiceStub { + private static final MethodDescriptor searchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.SearchService/Search") + .setRequestMarshaller(ProtoUtils.marshaller(SearchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SearchResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable searchCallable; + private final UnaryCallable searchPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSearchServiceStub create(SearchServiceStubSettings settings) + throws IOException { + return new GrpcSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSearchServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcSearchServiceStub(SearchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSearchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSearchServiceStub( + SearchServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, 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 GrpcSearchServiceStub(SearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, 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 GrpcSearchServiceStub( + SearchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings searchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("placement", String.valueOf(request.getPlacement())); + return params.build(); + }) + .build(); + + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.searchPagedCallable = + callableFactory.createPagedCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable searchCallable() { + return searchCallable; + } + + @Override + public UnaryCallable searchPagedCallable() { + return searchPagedCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceCallableFactory.java new file mode 100644 index 00000000..7ebf37e5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ServingConfigService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcServingConfigServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceStub.java new file mode 100644 index 00000000..f3876509 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcServingConfigServiceStub.java @@ -0,0 +1,383 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2alpha.AddControlRequest; +import com.google.cloud.retail.v2alpha.CreateServingConfigRequest; +import com.google.cloud.retail.v2alpha.DeleteServingConfigRequest; +import com.google.cloud.retail.v2alpha.GetServingConfigRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsResponse; +import com.google.cloud.retail.v2alpha.RemoveControlRequest; +import com.google.cloud.retail.v2alpha.ServingConfig; +import com.google.cloud.retail.v2alpha.UpdateServingConfigRequest; +import com.google.common.collect.ImmutableMap; +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 ServingConfigService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcServingConfigServiceStub extends ServingConfigServiceStub { + private static final MethodDescriptor + createServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ServingConfigService/CreateServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ServingConfigService/DeleteServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ServingConfigService/UpdateServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ServingConfigService/GetServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listServingConfigsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.ServingConfigService/ListServingConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListServingConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServingConfigsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ServingConfigService/AddControl") + .setRequestMarshaller(ProtoUtils.marshaller(AddControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.ServingConfigService/RemoveControl") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private final UnaryCallable + createServingConfigCallable; + private final UnaryCallable deleteServingConfigCallable; + private final UnaryCallable + updateServingConfigCallable; + private final UnaryCallable getServingConfigCallable; + private final UnaryCallable + listServingConfigsCallable; + private final UnaryCallable + listServingConfigsPagedCallable; + private final UnaryCallable addControlCallable; + private final UnaryCallable removeControlCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcServingConfigServiceStub create(ServingConfigServiceStubSettings settings) + throws IOException { + return new GrpcServingConfigServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcServingConfigServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcServingConfigServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcServingConfigServiceStub, 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 GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcServingConfigServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcServingConfigServiceStub, 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 GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "serving_config.name", + String.valueOf(request.getServingConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listServingConfigsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listServingConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings addControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("serving_config", String.valueOf(request.getServingConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings removeControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("serving_config", String.valueOf(request.getServingConfig())); + return params.build(); + }) + .build(); + + this.createServingConfigCallable = + callableFactory.createUnaryCallable( + createServingConfigTransportSettings, + settings.createServingConfigSettings(), + clientContext); + this.deleteServingConfigCallable = + callableFactory.createUnaryCallable( + deleteServingConfigTransportSettings, + settings.deleteServingConfigSettings(), + clientContext); + this.updateServingConfigCallable = + callableFactory.createUnaryCallable( + updateServingConfigTransportSettings, + settings.updateServingConfigSettings(), + clientContext); + this.getServingConfigCallable = + callableFactory.createUnaryCallable( + getServingConfigTransportSettings, settings.getServingConfigSettings(), clientContext); + this.listServingConfigsCallable = + callableFactory.createUnaryCallable( + listServingConfigsTransportSettings, + settings.listServingConfigsSettings(), + clientContext); + this.listServingConfigsPagedCallable = + callableFactory.createPagedCallable( + listServingConfigsTransportSettings, + settings.listServingConfigsSettings(), + clientContext); + this.addControlCallable = + callableFactory.createUnaryCallable( + addControlTransportSettings, settings.addControlSettings(), clientContext); + this.removeControlCallable = + callableFactory.createUnaryCallable( + removeControlTransportSettings, settings.removeControlSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createServingConfigCallable() { + return createServingConfigCallable; + } + + @Override + public UnaryCallable deleteServingConfigCallable() { + return deleteServingConfigCallable; + } + + @Override + public UnaryCallable updateServingConfigCallable() { + return updateServingConfigCallable; + } + + @Override + public UnaryCallable getServingConfigCallable() { + return getServingConfigCallable; + } + + @Override + public UnaryCallable + listServingConfigsCallable() { + return listServingConfigsCallable; + } + + @Override + public UnaryCallable + listServingConfigsPagedCallable() { + return listServingConfigsPagedCallable; + } + + @Override + public UnaryCallable addControlCallable() { + return addControlCallable; + } + + @Override + public UnaryCallable removeControlCallable() { + return removeControlCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceCallableFactory.java new file mode 100644 index 00000000..d059c2fd --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceCallableFactory.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the UserEventService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcUserEventServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceStub.java new file mode 100644 index 00000000..adb787e8 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcUserEventServiceStub.java @@ -0,0 +1,337 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.HttpBody; +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.v2alpha.CollectUserEventRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportUserEventsRequest; +import com.google.cloud.retail.v2alpha.ImportUserEventsResponse; +import com.google.cloud.retail.v2alpha.PurgeMetadata; +import com.google.cloud.retail.v2alpha.PurgeUserEventsRequest; +import com.google.cloud.retail.v2alpha.PurgeUserEventsResponse; +import com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2alpha.RejoinUserEventsRequest; +import com.google.cloud.retail.v2alpha.RejoinUserEventsResponse; +import com.google.cloud.retail.v2alpha.UserEvent; +import com.google.cloud.retail.v2alpha.WriteUserEventRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the UserEventService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcUserEventServiceStub extends UserEventServiceStub { + private static final MethodDescriptor + writeUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.UserEventService/WriteUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(WriteUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(UserEvent.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + collectUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.UserEventService/CollectUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(CollectUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + purgeUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.UserEventService/PurgeUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.UserEventService/ImportUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + rejoinUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2alpha.UserEventService/RejoinUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(RejoinUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable writeUserEventCallable; + private final UnaryCallable collectUserEventCallable; + private final UnaryCallable purgeUserEventsCallable; + private final OperationCallable + purgeUserEventsOperationCallable; + private final UnaryCallable importUserEventsCallable; + private final OperationCallable + importUserEventsOperationCallable; + private final UnaryCallable rejoinUserEventsCallable; + private final OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcUserEventServiceStub create(UserEventServiceStubSettings settings) + throws IOException { + return new GrpcUserEventServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcUserEventServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcUserEventServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcUserEventServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings writeUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeUserEventMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings collectUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectUserEventMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings purgeUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings importUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings rejoinUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rejoinUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.writeUserEventCallable = + callableFactory.createUnaryCallable( + writeUserEventTransportSettings, settings.writeUserEventSettings(), clientContext); + this.collectUserEventCallable = + callableFactory.createUnaryCallable( + collectUserEventTransportSettings, settings.collectUserEventSettings(), clientContext); + this.purgeUserEventsCallable = + callableFactory.createUnaryCallable( + purgeUserEventsTransportSettings, settings.purgeUserEventsSettings(), clientContext); + this.purgeUserEventsOperationCallable = + callableFactory.createOperationCallable( + purgeUserEventsTransportSettings, + settings.purgeUserEventsOperationSettings(), + clientContext, + operationsStub); + this.importUserEventsCallable = + callableFactory.createUnaryCallable( + importUserEventsTransportSettings, settings.importUserEventsSettings(), clientContext); + this.importUserEventsOperationCallable = + callableFactory.createOperationCallable( + importUserEventsTransportSettings, + settings.importUserEventsOperationSettings(), + clientContext, + operationsStub); + this.rejoinUserEventsCallable = + callableFactory.createUnaryCallable( + rejoinUserEventsTransportSettings, settings.rejoinUserEventsSettings(), clientContext); + this.rejoinUserEventsOperationCallable = + callableFactory.createOperationCallable( + rejoinUserEventsTransportSettings, + settings.rejoinUserEventsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable writeUserEventCallable() { + return writeUserEventCallable; + } + + @Override + public UnaryCallable collectUserEventCallable() { + return collectUserEventCallable; + } + + @Override + public UnaryCallable purgeUserEventsCallable() { + return purgeUserEventsCallable; + } + + @Override + public OperationCallable + purgeUserEventsOperationCallable() { + return purgeUserEventsOperationCallable; + } + + @Override + public UnaryCallable importUserEventsCallable() { + return importUserEventsCallable; + } + + @Override + public OperationCallable + importUserEventsOperationCallable() { + return importUserEventsOperationCallable; + } + + @Override + public UnaryCallable rejoinUserEventsCallable() { + return rejoinUserEventsCallable; + } + + @Override + public OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + return rejoinUserEventsOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStub.java new file mode 100644 index 00000000..ee7bb77e --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStub.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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.PredictRequest; +import com.google.cloud.retail.v2alpha.PredictResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class PredictionServiceStub implements BackgroundResource { + + public UnaryCallable predictCallable() { + throw new UnsupportedOperationException("Not implemented: predictCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java new file mode 100644 index 00000000..edc0d9e1 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java @@ -0,0 +1,279 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.PredictRequest; +import com.google.cloud.retail.v2alpha.PredictResponse; +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 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 PredictionServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceStubSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder
+ *             .predictSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceStubSettings predictionServiceSettings =
+ *     predictionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceStubSettings 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 predictSettings; + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return predictSettings; + } + + public PredictionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 PredictionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + predictSettings = settingsBuilder.predictSettings().build(); + } + + /** Builder for PredictionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder predictSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + predictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + initDefaults(this); + } + + protected Builder(PredictionServiceStubSettings settings) { + super(settings); + + predictSettings = settings.predictSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + } + + 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 initDefaults(Builder builder) { + builder + .predictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 predict. */ + public UnaryCallSettings.Builder predictSettings() { + return predictSettings; + } + + @Override + public PredictionServiceStubSettings build() throws IOException { + return new PredictionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStub.java new file mode 100644 index 00000000..5f5f0e8f --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStub.java @@ -0,0 +1,174 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ProductServiceClient.ListProductsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.CreateProductRequest; +import com.google.cloud.retail.v2alpha.DeleteProductRequest; +import com.google.cloud.retail.v2alpha.GetProductRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportProductsRequest; +import com.google.cloud.retail.v2alpha.ImportProductsResponse; +import com.google.cloud.retail.v2alpha.ListProductsRequest; +import com.google.cloud.retail.v2alpha.ListProductsResponse; +import com.google.cloud.retail.v2alpha.Product; +import com.google.cloud.retail.v2alpha.PurgeProductsMetadata; +import com.google.cloud.retail.v2alpha.PurgeProductsRequest; +import com.google.cloud.retail.v2alpha.PurgeProductsResponse; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.SetInventoryMetadata; +import com.google.cloud.retail.v2alpha.SetInventoryRequest; +import com.google.cloud.retail.v2alpha.SetInventoryResponse; +import com.google.cloud.retail.v2alpha.UpdateProductRequest; +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 ProductService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ProductServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createProductCallable() { + throw new UnsupportedOperationException("Not implemented: createProductCallable()"); + } + + public UnaryCallable getProductCallable() { + throw new UnsupportedOperationException("Not implemented: getProductCallable()"); + } + + public UnaryCallable listProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsPagedCallable()"); + } + + public UnaryCallable listProductsCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsCallable()"); + } + + public UnaryCallable updateProductCallable() { + throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); + } + + public UnaryCallable deleteProductCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); + } + + public OperationCallable + purgeProductsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: purgeProductsOperationCallable()"); + } + + public UnaryCallable purgeProductsCallable() { + throw new UnsupportedOperationException("Not implemented: purgeProductsCallable()"); + } + + public OperationCallable + importProductsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importProductsOperationCallable()"); + } + + public UnaryCallable importProductsCallable() { + throw new UnsupportedOperationException("Not implemented: importProductsCallable()"); + } + + public OperationCallable + setInventoryOperationCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryOperationCallable()"); + } + + public UnaryCallable setInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryCallable()"); + } + + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: addFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable addFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: addFulfillmentPlacesCallable()"); + } + + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable + removeFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: removeFulfillmentPlacesCallable()"); + } + + public OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: addLocalInventoriesOperationCallable()"); + } + + public UnaryCallable addLocalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: addLocalInventoriesCallable()"); + } + + public OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeLocalInventoriesOperationCallable()"); + } + + public UnaryCallable removeLocalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: removeLocalInventoriesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java new file mode 100644 index 00000000..c8b64468 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java @@ -0,0 +1,1025 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ProductServiceClient.ListProductsPagedResponse; + +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.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.v2alpha.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.CreateProductRequest; +import com.google.cloud.retail.v2alpha.DeleteProductRequest; +import com.google.cloud.retail.v2alpha.GetProductRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportProductsRequest; +import com.google.cloud.retail.v2alpha.ImportProductsResponse; +import com.google.cloud.retail.v2alpha.ListProductsRequest; +import com.google.cloud.retail.v2alpha.ListProductsResponse; +import com.google.cloud.retail.v2alpha.Product; +import com.google.cloud.retail.v2alpha.PurgeProductsMetadata; +import com.google.cloud.retail.v2alpha.PurgeProductsRequest; +import com.google.cloud.retail.v2alpha.PurgeProductsResponse; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2alpha.SetInventoryMetadata; +import com.google.cloud.retail.v2alpha.SetInventoryRequest; +import com.google.cloud.retail.v2alpha.SetInventoryResponse; +import com.google.cloud.retail.v2alpha.UpdateProductRequest; +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 ProductServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceStubSettings.Builder productServiceSettingsBuilder =
+ *     ProductServiceStubSettings.newBuilder();
+ * productServiceSettingsBuilder
+ *     .createProductSettings()
+ *     .setRetrySettings(
+ *         productServiceSettingsBuilder
+ *             .createProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProductServiceStubSettings productServiceSettings = productServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceStubSettings 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 createProductSettings; + private final UnaryCallSettings getProductSettings; + private final PagedCallSettings< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings updateProductSettings; + private final UnaryCallSettings deleteProductSettings; + private final UnaryCallSettings purgeProductsSettings; + private final OperationCallSettings< + PurgeProductsRequest, PurgeProductsResponse, PurgeProductsMetadata> + purgeProductsOperationSettings; + private final UnaryCallSettings importProductsSettings; + private final OperationCallSettings + importProductsOperationSettings; + private final UnaryCallSettings setInventorySettings; + private final OperationCallSettings< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings + addFulfillmentPlacesSettings; + private final OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings + removeFulfillmentPlacesSettings; + private final OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; + private final UnaryCallSettings + addLocalInventoriesSettings; + private final OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings; + private final UnaryCallSettings + removeLocalInventoriesSettings; + private final OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings; + + private static final PagedListDescriptor + LIST_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsRequest injectToken(ListProductsRequest payload, String token) { + return ListProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductsRequest injectPageSize(ListProductsRequest payload, int pageSize) { + return ListProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsResponse payload) { + return payload.getProductsList() == null + ? ImmutableList.of() + : payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + LIST_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PRODUCTS_PAGE_STR_DESC, request, context); + return ListProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return createProductSettings; + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return getProductSettings; + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return updateProductSettings; + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + public UnaryCallSettings purgeProductsSettings() { + return purgeProductsSettings; + } + + /** Returns the object with the settings used for calls to purgeProducts. */ + public OperationCallSettings + purgeProductsOperationSettings() { + return purgeProductsOperationSettings; + } + + /** Returns the object with the settings used for calls to importProducts. */ + public UnaryCallSettings importProductsSettings() { + return importProductsSettings; + } + + /** Returns the object with the settings used for calls to importProducts. */ + public OperationCallSettings + importProductsOperationSettings() { + return importProductsOperationSettings; + } + + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return setInventorySettings; + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public UnaryCallSettings addLocalInventoriesSettings() { + return addLocalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return addLocalInventoriesOperationSettings; + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings + removeLocalInventoriesSettings() { + return removeLocalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return removeLocalInventoriesOperationSettings; + } + + public ProductServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcProductServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ProductServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ProductServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createProductSettings = settingsBuilder.createProductSettings().build(); + getProductSettings = settingsBuilder.getProductSettings().build(); + listProductsSettings = settingsBuilder.listProductsSettings().build(); + updateProductSettings = settingsBuilder.updateProductSettings().build(); + deleteProductSettings = settingsBuilder.deleteProductSettings().build(); + purgeProductsSettings = settingsBuilder.purgeProductsSettings().build(); + purgeProductsOperationSettings = settingsBuilder.purgeProductsOperationSettings().build(); + importProductsSettings = settingsBuilder.importProductsSettings().build(); + importProductsOperationSettings = settingsBuilder.importProductsOperationSettings().build(); + setInventorySettings = settingsBuilder.setInventorySettings().build(); + setInventoryOperationSettings = settingsBuilder.setInventoryOperationSettings().build(); + addFulfillmentPlacesSettings = settingsBuilder.addFulfillmentPlacesSettings().build(); + addFulfillmentPlacesOperationSettings = + settingsBuilder.addFulfillmentPlacesOperationSettings().build(); + removeFulfillmentPlacesSettings = settingsBuilder.removeFulfillmentPlacesSettings().build(); + removeFulfillmentPlacesOperationSettings = + settingsBuilder.removeFulfillmentPlacesOperationSettings().build(); + addLocalInventoriesSettings = settingsBuilder.addLocalInventoriesSettings().build(); + addLocalInventoriesOperationSettings = + settingsBuilder.addLocalInventoriesOperationSettings().build(); + removeLocalInventoriesSettings = settingsBuilder.removeLocalInventoriesSettings().build(); + removeLocalInventoriesOperationSettings = + settingsBuilder.removeLocalInventoriesOperationSettings().build(); + } + + /** Builder for ProductServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createProductSettings; + private final UnaryCallSettings.Builder getProductSettings; + private final PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings.Builder updateProductSettings; + private final UnaryCallSettings.Builder deleteProductSettings; + private final UnaryCallSettings.Builder purgeProductsSettings; + private final OperationCallSettings.Builder< + PurgeProductsRequest, PurgeProductsResponse, PurgeProductsMetadata> + purgeProductsOperationSettings; + private final UnaryCallSettings.Builder + importProductsSettings; + private final OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings; + private final UnaryCallSettings.Builder setInventorySettings; + private final OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings.Builder + addFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings.Builder + removeFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; + private final UnaryCallSettings.Builder + addLocalInventoriesSettings; + private final OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings; + private final UnaryCallSettings.Builder + removeLocalInventoriesSettings; + private final OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(300000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT); + updateProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeProductsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeProductsOperationSettings = OperationCallSettings.newBuilder(); + importProductsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importProductsOperationSettings = OperationCallSettings.newBuilder(); + setInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setInventoryOperationSettings = OperationCallSettings.newBuilder(); + addFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); + removeFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); + addLocalInventoriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addLocalInventoriesOperationSettings = OperationCallSettings.newBuilder(); + removeLocalInventoriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeLocalInventoriesOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSettings, + getProductSettings, + listProductsSettings, + updateProductSettings, + deleteProductSettings, + purgeProductsSettings, + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings, + addLocalInventoriesSettings, + removeLocalInventoriesSettings); + initDefaults(this); + } + + protected Builder(ProductServiceStubSettings settings) { + super(settings); + + createProductSettings = settings.createProductSettings.toBuilder(); + getProductSettings = settings.getProductSettings.toBuilder(); + listProductsSettings = settings.listProductsSettings.toBuilder(); + updateProductSettings = settings.updateProductSettings.toBuilder(); + deleteProductSettings = settings.deleteProductSettings.toBuilder(); + purgeProductsSettings = settings.purgeProductsSettings.toBuilder(); + purgeProductsOperationSettings = settings.purgeProductsOperationSettings.toBuilder(); + importProductsSettings = settings.importProductsSettings.toBuilder(); + importProductsOperationSettings = settings.importProductsOperationSettings.toBuilder(); + setInventorySettings = settings.setInventorySettings.toBuilder(); + setInventoryOperationSettings = settings.setInventoryOperationSettings.toBuilder(); + addFulfillmentPlacesSettings = settings.addFulfillmentPlacesSettings.toBuilder(); + addFulfillmentPlacesOperationSettings = + settings.addFulfillmentPlacesOperationSettings.toBuilder(); + removeFulfillmentPlacesSettings = settings.removeFulfillmentPlacesSettings.toBuilder(); + removeFulfillmentPlacesOperationSettings = + settings.removeFulfillmentPlacesOperationSettings.toBuilder(); + addLocalInventoriesSettings = settings.addLocalInventoriesSettings.toBuilder(); + addLocalInventoriesOperationSettings = + settings.addLocalInventoriesOperationSettings.toBuilder(); + removeLocalInventoriesSettings = settings.removeLocalInventoriesSettings.toBuilder(); + removeLocalInventoriesOperationSettings = + settings.removeLocalInventoriesOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSettings, + getProductSettings, + listProductsSettings, + updateProductSettings, + deleteProductSettings, + purgeProductsSettings, + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings, + addLocalInventoriesSettings, + removeLocalInventoriesSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .purgeProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .setInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .addFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .removeFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .addLocalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .removeLocalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .purgeProductsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PurgeProductsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PurgeProductsMetadata.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 + .importProductsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportProductsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 + .setInventoryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SetInventoryResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SetInventoryMetadata.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 + .addFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AddFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AddFulfillmentPlacesMetadata.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 + .removeFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RemoveFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + RemoveFulfillmentPlacesMetadata.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 + .addLocalInventoriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AddLocalInventoriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AddLocalInventoriesMetadata.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 + .removeLocalInventoriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RemoveLocalInventoriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + RemoveLocalInventoriesMetadata.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 createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return createProductSettings; + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getProductSettings; + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return updateProductSettings; + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + public UnaryCallSettings.Builder purgeProductsSettings() { + return purgeProductsSettings; + } + + /** Returns the builder for the settings used for calls to purgeProducts. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeProductsRequest, PurgeProductsResponse, PurgeProductsMetadata> + purgeProductsOperationSettings() { + return purgeProductsOperationSettings; + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public UnaryCallSettings.Builder importProductsSettings() { + return importProductsSettings; + } + + /** Returns the builder for the settings used for calls to importProducts. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings() { + return importProductsOperationSettings; + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return setInventorySettings; + } + + /** Returns the builder for the settings used for calls to setInventory. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public UnaryCallSettings.Builder + addLocalInventoriesSettings() { + return addLocalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return addLocalInventoriesOperationSettings; + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings.Builder + removeLocalInventoriesSettings() { + return removeLocalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return removeLocalInventoriesOperationSettings; + } + + @Override + public ProductServiceStubSettings build() throws IOException { + return new ProductServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStub.java new file mode 100644 index 00000000..4e79f34d --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStub.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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.SearchServiceClient.SearchPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.SearchRequest; +import com.google.cloud.retail.v2alpha.SearchResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SearchServiceStub implements BackgroundResource { + + public UnaryCallable searchPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchPagedCallable()"); + } + + public UnaryCallable searchCallable() { + throw new UnsupportedOperationException("Not implemented: searchCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java new file mode 100644 index 00000000..8d50bddf --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java @@ -0,0 +1,342 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.SearchServiceClient.SearchPagedResponse; + +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.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.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.v2alpha.SearchRequest; +import com.google.cloud.retail.v2alpha.SearchResponse; +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 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 SearchServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceStubSettings.Builder searchServiceSettingsBuilder =
+ *     SearchServiceStubSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceStubSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceStubSettings 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 PagedCallSettings + searchSettings; + + private static final PagedListDescriptor< + SearchRequest, SearchResponse, SearchResponse.SearchResult> + SEARCH_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchRequest injectToken(SearchRequest payload, String token) { + return SearchRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchRequest injectPageSize(SearchRequest payload, int pageSize) { + return SearchRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchResponse payload) { + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); + } + }; + + private static final PagedListResponseFactory + SEARCH_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_PAGE_STR_DESC, request, context); + return SearchPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return searchSettings; + } + + public SearchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSearchServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 SearchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + searchSettings = settingsBuilder.searchSettings().build(); + } + + /** Builder for SearchServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder + searchSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + searchSettings = PagedCallSettings.newBuilder(SEARCH_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + initDefaults(this); + } + + protected Builder(SearchServiceStubSettings settings) { + super(settings); + + searchSettings = settings.searchSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + } + + 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 initDefaults(Builder builder) { + builder + .searchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 search. */ + public PagedCallSettings.Builder + searchSettings() { + return searchSettings; + } + + @Override + public SearchServiceStubSettings build() throws IOException { + return new SearchServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStub.java new file mode 100644 index 00000000..b15255fd --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStub.java @@ -0,0 +1,82 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.AddControlRequest; +import com.google.cloud.retail.v2alpha.CreateServingConfigRequest; +import com.google.cloud.retail.v2alpha.DeleteServingConfigRequest; +import com.google.cloud.retail.v2alpha.GetServingConfigRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsResponse; +import com.google.cloud.retail.v2alpha.RemoveControlRequest; +import com.google.cloud.retail.v2alpha.ServingConfig; +import com.google.cloud.retail.v2alpha.UpdateServingConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ServingConfigService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ServingConfigServiceStub implements BackgroundResource { + + public UnaryCallable createServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createServingConfigCallable()"); + } + + public UnaryCallable deleteServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteServingConfigCallable()"); + } + + public UnaryCallable updateServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateServingConfigCallable()"); + } + + public UnaryCallable getServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getServingConfigCallable()"); + } + + public UnaryCallable + listServingConfigsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listServingConfigsPagedCallable()"); + } + + public UnaryCallable + listServingConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listServingConfigsCallable()"); + } + + public UnaryCallable addControlCallable() { + throw new UnsupportedOperationException("Not implemented: addControlCallable()"); + } + + public UnaryCallable removeControlCallable() { + throw new UnsupportedOperationException("Not implemented: removeControlCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java new file mode 100644 index 00000000..78dd0b11 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java @@ -0,0 +1,500 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.retail.v2alpha.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.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.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.v2alpha.AddControlRequest; +import com.google.cloud.retail.v2alpha.CreateServingConfigRequest; +import com.google.cloud.retail.v2alpha.DeleteServingConfigRequest; +import com.google.cloud.retail.v2alpha.GetServingConfigRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsRequest; +import com.google.cloud.retail.v2alpha.ListServingConfigsResponse; +import com.google.cloud.retail.v2alpha.RemoveControlRequest; +import com.google.cloud.retail.v2alpha.ServingConfig; +import com.google.cloud.retail.v2alpha.UpdateServingConfigRequest; +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.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 ServingConfigServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceStubSettings.Builder servingConfigServiceSettingsBuilder =
+ *     ServingConfigServiceStubSettings.newBuilder();
+ * servingConfigServiceSettingsBuilder
+ *     .createServingConfigSettings()
+ *     .setRetrySettings(
+ *         servingConfigServiceSettingsBuilder
+ *             .createServingConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServingConfigServiceStubSettings servingConfigServiceSettings =
+ *     servingConfigServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceStubSettings + 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 + createServingConfigSettings; + private final UnaryCallSettings deleteServingConfigSettings; + private final UnaryCallSettings + updateServingConfigSettings; + private final UnaryCallSettings getServingConfigSettings; + private final PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings; + private final UnaryCallSettings addControlSettings; + private final UnaryCallSettings removeControlSettings; + + private static final PagedListDescriptor< + ListServingConfigsRequest, ListServingConfigsResponse, ServingConfig> + LIST_SERVING_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListServingConfigsRequest, ListServingConfigsResponse, ServingConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServingConfigsRequest injectToken( + ListServingConfigsRequest payload, String token) { + return ListServingConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListServingConfigsRequest injectPageSize( + ListServingConfigsRequest payload, int pageSize) { + return ListServingConfigsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListServingConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServingConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListServingConfigsResponse payload) { + return payload.getServingConfigsList() == null + ? ImmutableList.of() + : payload.getServingConfigsList(); + } + }; + + private static final PagedListResponseFactory< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + LIST_SERVING_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServingConfigsRequest, + ListServingConfigsResponse, + ListServingConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListServingConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SERVING_CONFIGS_PAGE_STR_DESC, request, context); + return ListServingConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createServingConfig. */ + public UnaryCallSettings + createServingConfigSettings() { + return createServingConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings deleteServingConfigSettings() { + return deleteServingConfigSettings; + } + + /** Returns the object with the settings used for calls to updateServingConfig. */ + public UnaryCallSettings + updateServingConfigSettings() { + return updateServingConfigSettings; + } + + /** Returns the object with the settings used for calls to getServingConfig. */ + public UnaryCallSettings getServingConfigSettings() { + return getServingConfigSettings; + } + + /** Returns the object with the settings used for calls to listServingConfigs. */ + public PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return listServingConfigsSettings; + } + + /** Returns the object with the settings used for calls to addControl. */ + public UnaryCallSettings addControlSettings() { + return addControlSettings; + } + + /** Returns the object with the settings used for calls to removeControl. */ + public UnaryCallSettings removeControlSettings() { + return removeControlSettings; + } + + public ServingConfigServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcServingConfigServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ServingConfigServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ServingConfigServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createServingConfigSettings = settingsBuilder.createServingConfigSettings().build(); + deleteServingConfigSettings = settingsBuilder.deleteServingConfigSettings().build(); + updateServingConfigSettings = settingsBuilder.updateServingConfigSettings().build(); + getServingConfigSettings = settingsBuilder.getServingConfigSettings().build(); + listServingConfigsSettings = settingsBuilder.listServingConfigsSettings().build(); + addControlSettings = settingsBuilder.addControlSettings().build(); + removeControlSettings = settingsBuilder.removeControlSettings().build(); + } + + /** Builder for ServingConfigServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createServingConfigSettings; + private final UnaryCallSettings.Builder + deleteServingConfigSettings; + private final UnaryCallSettings.Builder + updateServingConfigSettings; + private final UnaryCallSettings.Builder + getServingConfigSettings; + private final PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings; + private final UnaryCallSettings.Builder addControlSettings; + private final UnaryCallSettings.Builder + removeControlSettings; + 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); + + createServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServingConfigsSettings = PagedCallSettings.newBuilder(LIST_SERVING_CONFIGS_PAGE_STR_FACT); + addControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServingConfigSettings, + deleteServingConfigSettings, + updateServingConfigSettings, + getServingConfigSettings, + listServingConfigsSettings, + addControlSettings, + removeControlSettings); + initDefaults(this); + } + + protected Builder(ServingConfigServiceStubSettings settings) { + super(settings); + + createServingConfigSettings = settings.createServingConfigSettings.toBuilder(); + deleteServingConfigSettings = settings.deleteServingConfigSettings.toBuilder(); + updateServingConfigSettings = settings.updateServingConfigSettings.toBuilder(); + getServingConfigSettings = settings.getServingConfigSettings.toBuilder(); + listServingConfigsSettings = settings.listServingConfigsSettings.toBuilder(); + addControlSettings = settings.addControlSettings.toBuilder(); + removeControlSettings = settings.removeControlSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServingConfigSettings, + deleteServingConfigSettings, + updateServingConfigSettings, + getServingConfigSettings, + listServingConfigsSettings, + addControlSettings, + removeControlSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listServingConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .addControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .removeControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 createServingConfig. */ + public UnaryCallSettings.Builder + createServingConfigSettings() { + return createServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings.Builder + deleteServingConfigSettings() { + return deleteServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateServingConfig. */ + public UnaryCallSettings.Builder + updateServingConfigSettings() { + return updateServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to getServingConfig. */ + public UnaryCallSettings.Builder + getServingConfigSettings() { + return getServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to listServingConfigs. */ + public PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return listServingConfigsSettings; + } + + /** Returns the builder for the settings used for calls to addControl. */ + public UnaryCallSettings.Builder addControlSettings() { + return addControlSettings; + } + + /** Returns the builder for the settings used for calls to removeControl. */ + public UnaryCallSettings.Builder removeControlSettings() { + return removeControlSettings; + } + + @Override + public ServingConfigServiceStubSettings build() throws IOException { + return new ServingConfigServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStub.java new file mode 100644 index 00000000..ff715613 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStub.java @@ -0,0 +1,92 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.CollectUserEventRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportUserEventsRequest; +import com.google.cloud.retail.v2alpha.ImportUserEventsResponse; +import com.google.cloud.retail.v2alpha.PurgeMetadata; +import com.google.cloud.retail.v2alpha.PurgeUserEventsRequest; +import com.google.cloud.retail.v2alpha.PurgeUserEventsResponse; +import com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2alpha.RejoinUserEventsRequest; +import com.google.cloud.retail.v2alpha.RejoinUserEventsResponse; +import com.google.cloud.retail.v2alpha.UserEvent; +import com.google.cloud.retail.v2alpha.WriteUserEventRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the UserEventService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class UserEventServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable writeUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: writeUserEventCallable()"); + } + + public UnaryCallable collectUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: collectUserEventCallable()"); + } + + public OperationCallable + purgeUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsOperationCallable()"); + } + + public UnaryCallable purgeUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsCallable()"); + } + + public OperationCallable + importUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsOperationCallable()"); + } + + public UnaryCallable importUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsCallable()"); + } + + public OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: rejoinUserEventsOperationCallable()"); + } + + public UnaryCallable rejoinUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: rejoinUserEventsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java new file mode 100644 index 00000000..70384ba3 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java @@ -0,0 +1,568 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.CollectUserEventRequest; +import com.google.cloud.retail.v2alpha.ImportMetadata; +import com.google.cloud.retail.v2alpha.ImportUserEventsRequest; +import com.google.cloud.retail.v2alpha.ImportUserEventsResponse; +import com.google.cloud.retail.v2alpha.PurgeMetadata; +import com.google.cloud.retail.v2alpha.PurgeUserEventsRequest; +import com.google.cloud.retail.v2alpha.PurgeUserEventsResponse; +import com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2alpha.RejoinUserEventsRequest; +import com.google.cloud.retail.v2alpha.RejoinUserEventsResponse; +import com.google.cloud.retail.v2alpha.UserEvent; +import com.google.cloud.retail.v2alpha.WriteUserEventRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link UserEventServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceStubSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceStubSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder
+ *             .writeUserEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceStubSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceStubSettings 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 writeUserEventSettings; + private final UnaryCallSettings collectUserEventSettings; + private final UnaryCallSettings purgeUserEventsSettings; + private final OperationCallSettings< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings importUserEventsSettings; + private final OperationCallSettings< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + private final UnaryCallSettings rejoinUserEventsSettings; + private final OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings; + + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public OperationCallSettings + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public OperationCallSettings + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings rejoinUserEventsSettings() { + return rejoinUserEventsSettings; + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return rejoinUserEventsOperationSettings; + } + + public UserEventServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcUserEventServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(UserEventServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 UserEventServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + writeUserEventSettings = settingsBuilder.writeUserEventSettings().build(); + collectUserEventSettings = settingsBuilder.collectUserEventSettings().build(); + purgeUserEventsSettings = settingsBuilder.purgeUserEventsSettings().build(); + purgeUserEventsOperationSettings = settingsBuilder.purgeUserEventsOperationSettings().build(); + importUserEventsSettings = settingsBuilder.importUserEventsSettings().build(); + importUserEventsOperationSettings = settingsBuilder.importUserEventsOperationSettings().build(); + rejoinUserEventsSettings = settingsBuilder.rejoinUserEventsSettings().build(); + rejoinUserEventsOperationSettings = settingsBuilder.rejoinUserEventsOperationSettings().build(); + } + + /** Builder for UserEventServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + writeUserEventSettings; + private final UnaryCallSettings.Builder + collectUserEventSettings; + private final UnaryCallSettings.Builder + purgeUserEventsSettings; + private final OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings.Builder + importUserEventsSettings; + private final OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + private final UnaryCallSettings.Builder + rejoinUserEventsSettings; + private final OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(300000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + writeUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + collectUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsOperationSettings = OperationCallSettings.newBuilder(); + importUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importUserEventsOperationSettings = OperationCallSettings.newBuilder(); + rejoinUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rejoinUserEventsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings, + rejoinUserEventsSettings); + initDefaults(this); + } + + protected Builder(UserEventServiceStubSettings settings) { + super(settings); + + writeUserEventSettings = settings.writeUserEventSettings.toBuilder(); + collectUserEventSettings = settings.collectUserEventSettings.toBuilder(); + purgeUserEventsSettings = settings.purgeUserEventsSettings.toBuilder(); + purgeUserEventsOperationSettings = settings.purgeUserEventsOperationSettings.toBuilder(); + importUserEventsSettings = settings.importUserEventsSettings.toBuilder(); + importUserEventsOperationSettings = settings.importUserEventsOperationSettings.toBuilder(); + rejoinUserEventsSettings = settings.rejoinUserEventsSettings.toBuilder(); + rejoinUserEventsOperationSettings = settings.rejoinUserEventsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings, + rejoinUserEventsSettings); + } + + 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 initDefaults(Builder builder) { + builder + .writeUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .collectUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .purgeUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .rejoinUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .purgeUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PurgeUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PurgeMetadata.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 + .importUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 + .rejoinUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(RejoinUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RejoinUserEventsMetadata.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 writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings.Builder + rejoinUserEventsSettings() { + return rejoinUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return rejoinUserEventsOperationSettings; + } + + @Override + public UserEventServiceStubSettings build() throws IOException { + return new UserEventServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java new file mode 100644 index 00000000..27c0fbf8 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java @@ -0,0 +1,1442 @@ +/* + * 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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.CatalogServiceStub; +import com.google.cloud.retail.v2beta.stub.CatalogServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 managing catalog configuration. + * + *

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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ *   Catalog catalog = Catalog.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CatalogServiceClient 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 CatalogServiceSettings 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.
+ * CatalogServiceSettings catalogServiceSettings =
+ *     CatalogServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceClient implements BackgroundResource { + private final CatalogServiceSettings settings; + private final CatalogServiceStub stub; + + /** Constructs an instance of CatalogServiceClient with default settings. */ + public static final CatalogServiceClient create() throws IOException { + return create(CatalogServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient create(CatalogServiceSettings settings) + throws IOException { + return new CatalogServiceClient(settings); + } + + /** + * Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(CatalogServiceSettings). + */ + public static final CatalogServiceClient create(CatalogServiceStub stub) { + return new CatalogServiceClient(stub); + } + + /** + * Constructs an instance of CatalogServiceClient, 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 CatalogServiceClient(CatalogServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected CatalogServiceClient(CatalogServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CatalogServiceSettings getSettings() { + return settings; + } + + public CatalogServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project. + * + *

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()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account resource name with an associated location. + *

If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(LocationName parent) { + ListCatalogsRequest request = + ListCatalogsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project. + * + *

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()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account resource name with an associated location. + *

If the caller does not have permission to list + * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location, regardless of whether + * or not this location exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCatalogsPagedResponse listCatalogs(String parent) { + ListCatalogsRequest request = ListCatalogsRequest.newBuilder().setParent(parent).build(); + return listCatalogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Catalog element : catalogServiceClient.listCatalogs(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 ListCatalogsPagedResponse listCatalogs(ListCatalogsRequest request) { + return listCatalogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.listCatalogsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Catalog element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCatalogsPagedCallable() { + return stub.listCatalogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project. + * + *

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()) {
+   *   ListCatalogsRequest request =
+   *       ListCatalogsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListCatalogsResponse response = catalogServiceClient.listCatalogsCallable().call(request);
+   *     for (Catalog element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listCatalogsCallable() { + return stub.listCatalogsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. + * + *

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()) {
+   *   Catalog catalog = Catalog.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+   * }
+   * }
+ * + * @param catalog Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update. + *

If the caller does not have permission to update the + * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not exist, a + * NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [Catalog][google.cloud.retail.v2beta.Catalog] to update. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Catalog updateCatalog(Catalog catalog, FieldMask updateMask) { + UpdateCatalogRequest request = + UpdateCatalogRequest.newBuilder().setCatalog(catalog).setUpdateMask(updateMask).build(); + return updateCatalog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. + * + *

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()) {
+   *   UpdateCatalogRequest request =
+   *       UpdateCatalogRequest.newBuilder()
+   *           .setCatalog(Catalog.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Catalog response = catalogServiceClient.updateCatalog(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 Catalog updateCatalog(UpdateCatalogRequest request) { + return updateCatalogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. + * + *

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()) {
+   *   UpdateCatalogRequest request =
+   *       UpdateCatalogRequest.newBuilder()
+   *           .setCatalog(Catalog.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = catalogServiceClient.updateCatalogCallable().futureCall(request);
+   *   // Do something.
+   *   Catalog response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCatalogCallable() { + return stub.updateCatalogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(CatalogName catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   catalogServiceClient.setDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog Full resource name of the catalog, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void setDefaultBranch(String catalog) { + SetDefaultBranchRequest request = + SetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + setDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .setForce(true)
+   *           .build();
+   *   catalogServiceClient.setDefaultBranch(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 setDefaultBranch(SetDefaultBranchRequest request) { + setDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Set a specified branch id as default branch. API methods such as + * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], + * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], + * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will + * treat requests using "default_branch" to the actual branch id set as default. + * + *

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

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

CAUTION: If you have live predict/search traffic, switching the default branch could + * potentially cause outages if the ID space of the new branch is very different from the old one. + * + *

More specifically: + * + *

    + *
  • PredictionService will only return product IDs from branch {newBranch}. + *
  • SearchService will only return product IDs from branch {newBranch} (if branch is not + * explicitly set). + *
  • UserEventService will only join events with products from branch {newBranch}. + *
+ * + *

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()) {
+   *   SetDefaultBranchRequest request =
+   *       SetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setBranchId(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setNote("note3387378")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future = catalogServiceClient.setDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setDefaultBranchCallable() { + return stub.setDefaultBranchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(CatalogName catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder() + .setCatalog(catalog == null ? null : catalog.toString()) + .build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   String catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(catalog);
+   * }
+   * }
+ * + * @param catalog The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetDefaultBranchResponse getDefaultBranch(String catalog) { + GetDefaultBranchRequest request = + GetDefaultBranchRequest.newBuilder().setCatalog(catalog).build(); + return getDefaultBranch(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   GetDefaultBranchResponse response = catalogServiceClient.getDefaultBranch(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 GetDefaultBranchResponse getDefaultBranch(GetDefaultBranchRequest request) { + return getDefaultBranchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get which branch is currently default branch set by + * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] + * method under a specified parent catalog. + * + *

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()) {
+   *   GetDefaultBranchRequest request =
+   *       GetDefaultBranchRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getDefaultBranchCallable().futureCall(request);
+   *   // Do something.
+   *   GetDefaultBranchResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getDefaultBranchCallable() { + return stub.getDefaultBranchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + * + *

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()) {
+   *   CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full CompletionConfig resource name. Format: + * 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) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + * + *

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()) {
+   *   String name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full CompletionConfig resource name. Format: + * 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) { + GetCompletionConfigRequest request = + GetCompletionConfigRequest.newBuilder().setName(name).build(); + return getCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + * + *

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()) {
+   *   GetCompletionConfigRequest request =
+   *       GetCompletionConfigRequest.newBuilder()
+   *           .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   CompletionConfig response = catalogServiceClient.getCompletionConfig(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 CompletionConfig getCompletionConfig(GetCompletionConfigRequest request) { + return getCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + * + *

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()) {
+   *   GetCompletionConfigRequest request =
+   *       GetCompletionConfigRequest.newBuilder()
+   *           .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getCompletionConfigCallable().futureCall(request);
+   *   // Do something.
+   *   CompletionConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getCompletionConfigCallable() { + return stub.getCompletionConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s. + * + *

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()) {
+   *   CompletionConfig completionConfig = CompletionConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   CompletionConfig response =
+   *       catalogServiceClient.updateCompletionConfig(completionConfig, updateMask);
+   * }
+   * }
+ * + * @param completionConfig Required. The + * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. + *

If the caller does not have permission to update the + * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a PERMISSION_DENIED + * error is returned. + *

If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update does + * not exist, a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. The following + * are the only supported fields: + *

    + *
  • [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order] + *
  • [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions] + *
  • [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length] + *
  • [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompletionConfig updateCompletionConfig( + CompletionConfig completionConfig, FieldMask updateMask) { + UpdateCompletionConfigRequest request = + UpdateCompletionConfigRequest.newBuilder() + .setCompletionConfig(completionConfig) + .setUpdateMask(updateMask) + .build(); + return updateCompletionConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s. + * + *

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()) {
+   *   UpdateCompletionConfigRequest request =
+   *       UpdateCompletionConfigRequest.newBuilder()
+   *           .setCompletionConfig(CompletionConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CompletionConfig response = catalogServiceClient.updateCompletionConfig(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 CompletionConfig updateCompletionConfig(UpdateCompletionConfigRequest request) { + return updateCompletionConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s. + * + *

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()) {
+   *   UpdateCompletionConfigRequest request =
+   *       UpdateCompletionConfigRequest.newBuilder()
+   *           .setCompletionConfig(CompletionConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.updateCompletionConfigCallable().futureCall(request);
+   *   // Do something.
+   *   CompletionConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateCompletionConfigCallable() { + return stub.updateCompletionConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [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()) {
+   *   AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(AttributesConfigName name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [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()) {
+   *   String name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(name);
+   * }
+   * }
+ * + * @param name Required. Full AttributesConfig resource name. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig getAttributesConfig(String name) { + GetAttributesConfigRequest request = + GetAttributesConfigRequest.newBuilder().setName(name).build(); + return getAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [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()) {
+   *   GetAttributesConfigRequest request =
+   *       GetAttributesConfigRequest.newBuilder()
+   *           .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.getAttributesConfig(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 AttributesConfig getAttributesConfig(GetAttributesConfigRequest request) { + return getAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [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()) {
+   *   GetAttributesConfigRequest request =
+   *       GetAttributesConfigRequest.newBuilder()
+   *           .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.getAttributesConfigCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getAttributesConfigCallable() { + return stub.getAttributesConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   AttributesConfig attributesConfig = AttributesConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AttributesConfig response =
+   *       catalogServiceClient.updateAttributesConfig(attributesConfig, updateMask);
+   * }
+   * }
+ * + * @param attributesConfig Required. The + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. + * @param updateMask Indicates which fields in the provided + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. The following is + * the only supported field: + *
    + *
  • [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AttributesConfig updateAttributesConfig( + AttributesConfig attributesConfig, FieldMask updateMask) { + UpdateAttributesConfigRequest request = + UpdateAttributesConfigRequest.newBuilder() + .setAttributesConfig(attributesConfig) + .setUpdateMask(updateMask) + .build(); + return updateAttributesConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   UpdateAttributesConfigRequest request =
+   *       UpdateAttributesConfigRequest.newBuilder()
+   *           .setAttributesConfig(AttributesConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.updateAttributesConfig(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 AttributesConfig updateAttributesConfig(UpdateAttributesConfigRequest request) { + return updateAttributesConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   UpdateAttributesConfigRequest request =
+   *       UpdateAttributesConfigRequest.newBuilder()
+   *           .setAttributesConfig(AttributesConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.updateAttributesConfigCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateAttributesConfigCallable() { + return stub.updateAttributesConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   AddCatalogAttributeRequest request =
+   *       AddCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.addCatalogAttribute(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 AttributesConfig addCatalogAttribute(AddCatalogAttributeRequest request) { + return addCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   AddCatalogAttributeRequest request =
+   *       AddCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.addCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addCatalogAttributeCallable() { + return stub.addCatalogAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   RemoveCatalogAttributeRequest request =
+   *       RemoveCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setKey("key106079")
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.removeCatalogAttribute(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 AttributesConfig removeCatalogAttribute(RemoveCatalogAttributeRequest request) { + return removeCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

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

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()) {
+   *   RemoveCatalogAttributeRequest request =
+   *       RemoveCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setKey("key106079")
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.removeCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeCatalogAttributeCallable() { + return stub.removeCatalogAttributeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating the catalog + * attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. + * + *

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

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()) {
+   *   ReplaceCatalogAttributeRequest request =
+   *       ReplaceCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   AttributesConfig response = catalogServiceClient.replaceCatalogAttribute(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 AttributesConfig replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) { + return replaceCatalogAttributeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating the catalog + * attribute with the same + * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. + * + *

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

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()) {
+   *   ReplaceCatalogAttributeRequest request =
+   *       ReplaceCatalogAttributeRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setCatalogAttribute(CatalogAttribute.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.replaceCatalogAttributeCallable().futureCall(request);
+   *   // Do something.
+   *   AttributesConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + replaceCatalogAttributeCallable() { + return stub.replaceCatalogAttributeCallable(); + } + + @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 ListCatalogsPagedResponse + extends AbstractPagedListResponse< + ListCatalogsRequest, + ListCatalogsResponse, + Catalog, + ListCatalogsPage, + ListCatalogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCatalogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCatalogsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCatalogsPagedResponse(ListCatalogsPage page) { + super(page, ListCatalogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCatalogsPage + extends AbstractPage { + + private ListCatalogsPage( + PageContext context, + ListCatalogsResponse response) { + super(context, response); + } + + private static ListCatalogsPage createEmptyPage() { + return new ListCatalogsPage(null, null); + } + + @Override + protected ListCatalogsPage createPage( + PageContext context, + ListCatalogsResponse response) { + return new ListCatalogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCatalogsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCatalogsRequest, + ListCatalogsResponse, + Catalog, + ListCatalogsPage, + ListCatalogsFixedSizeCollection> { + + private ListCatalogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCatalogsFixedSizeCollection createEmptyCollection() { + return new ListCatalogsFixedSizeCollection(null, 0); + } + + @Override + protected ListCatalogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCatalogsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java new file mode 100644 index 00000000..071fbcd0 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java @@ -0,0 +1,307 @@ +/* + * 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.CatalogServiceClient.ListCatalogsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.CatalogServiceStubSettings; +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 CatalogServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .updateCatalogSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder
+ *             .updateCatalogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listCatalogs. */ + public PagedCallSettings + listCatalogsSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).listCatalogsSettings(); + } + + /** Returns the object with the settings used for calls to updateCatalog. */ + public UnaryCallSettings updateCatalogSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogSettings(); + } + + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).setDefaultBranchSettings(); + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getDefaultBranchSettings(); + } + + /** Returns the object with the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings + getCompletionConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getCompletionConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings + updateCompletionConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateCompletionConfigSettings(); + } + + /** Returns the object with the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings + getAttributesConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).getAttributesConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings + updateAttributesConfigSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).updateAttributesConfigSettings(); + } + + /** Returns the object with the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings + addCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).addCatalogAttributeSettings(); + } + + /** Returns the object with the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings + removeCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).removeCatalogAttributeSettings(); + } + + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings + replaceCatalogAttributeSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).replaceCatalogAttributeSettings(); + } + + public static final CatalogServiceSettings create(CatalogServiceStubSettings stub) + throws IOException { + return new CatalogServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CatalogServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CatalogServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CatalogServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CatalogServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CatalogServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CatalogServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CatalogServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CatalogServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CatalogServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CatalogServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CatalogServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CatalogServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CatalogServiceStubSettings.newBuilder()); + } + + public CatalogServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CatalogServiceStubSettings.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 listCatalogs. */ + public PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings() { + return getStubSettingsBuilder().listCatalogsSettings(); + } + + /** Returns the builder for the settings used for calls to updateCatalog. */ + public UnaryCallSettings.Builder updateCatalogSettings() { + return getStubSettingsBuilder().updateCatalogSettings(); + } + + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return getStubSettingsBuilder().setDefaultBranchSettings(); + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getStubSettingsBuilder().getDefaultBranchSettings(); + } + + /** Returns the builder for the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings.Builder + getCompletionConfigSettings() { + return getStubSettingsBuilder().getCompletionConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings.Builder + updateCompletionConfigSettings() { + return getStubSettingsBuilder().updateCompletionConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings.Builder + getAttributesConfigSettings() { + return getStubSettingsBuilder().getAttributesConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings.Builder + updateAttributesConfigSettings() { + return getStubSettingsBuilder().updateAttributesConfigSettings(); + } + + /** Returns the builder for the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings.Builder + addCatalogAttributeSettings() { + return getStubSettingsBuilder().addCatalogAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings.Builder + removeCatalogAttributeSettings() { + return getStubSettingsBuilder().removeCatalogAttributeSettings(); + } + + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings.Builder + replaceCatalogAttributeSettings() { + return getStubSettingsBuilder().replaceCatalogAttributeSettings(); + } + + @Override + public CatalogServiceSettings build() throws IOException { + return new CatalogServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java new file mode 100644 index 00000000..cb4be1ee --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java @@ -0,0 +1,382 @@ +/* + * 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.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.CompletionServiceStub; +import com.google.cloud.retail.v2beta.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the CompletionServiceClient 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 CompletionServiceSettings 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.
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CompletionServiceClient completionServiceClient =
+ *     CompletionServiceClient.create(completionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceClient implements BackgroundResource { + private final CompletionServiceSettings settings; + private final CompletionServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CompletionServiceClient with default settings. */ + public static final CompletionServiceClient create() throws IOException { + return create(CompletionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CompletionServiceClient, 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 CompletionServiceClient create(CompletionServiceSettings settings) + throws IOException { + return new CompletionServiceClient(settings); + } + + /** + * Constructs an instance of CompletionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CompletionServiceSettings). + */ + public static final CompletionServiceClient create(CompletionServiceStub stub) { + return new CompletionServiceClient(stub); + } + + /** + * Constructs an instance of CompletionServiceClient, 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 CompletionServiceClient(CompletionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CompletionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected CompletionServiceClient(CompletionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CompletionServiceSettings getSettings() { + return settings; + } + + public CompletionServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   CompleteQueryResponse response = completionServiceClient.completeQuery(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 CompleteQueryResponse completeQuery(CompleteQueryRequest request) { + return completeQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .addAllLanguageCodes(new ArrayList())
+   *           .setDeviceType("deviceType781190832")
+   *           .setDataset("dataset1443214456")
+   *           .setMaxSuggestions(618824852)
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.completeQueryCallable().futureCall(request);
+   *   // Do something.
+   *   CompleteQueryResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable completeQueryCallable() { + return stub.completeQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ImportCompletionDataResponse response =
+   *       completionServiceClient.importCompletionDataAsync(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 + importCompletionDataAsync(ImportCompletionDataRequest request) { + return importCompletionDataOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   OperationFuture future =
+   *       completionServiceClient.importCompletionDataOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportCompletionDataResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return stub.importCompletionDataOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of processed completion dataset. + * + *

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   ImportCompletionDataRequest request =
+   *       ImportCompletionDataRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(CompletionDataInputConfig.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.importCompletionDataCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + importCompletionDataCallable() { + return stub.importCompletionDataCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceSettings.java new file mode 100644 index 00000000..c6d4c94a --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceSettings.java @@ -0,0 +1,213 @@ +/* + * 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.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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.stub.CompletionServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return ((CompletionServiceStubSettings) getStubSettings()).completeQuerySettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return ((CompletionServiceStubSettings) getStubSettings()).importCompletionDataSettings(); + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return ((CompletionServiceStubSettings) getStubSettings()) + .importCompletionDataOperationSettings(); + } + + public static final CompletionServiceSettings create(CompletionServiceStubSettings stub) + throws IOException { + return new CompletionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CompletionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CompletionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CompletionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CompletionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CompletionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CompletionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CompletionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CompletionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CompletionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CompletionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CompletionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CompletionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CompletionServiceStubSettings.newBuilder()); + } + + public CompletionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CompletionServiceStubSettings.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 completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return getStubSettingsBuilder().completeQuerySettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return getStubSettingsBuilder().importCompletionDataSettings(); + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return getStubSettingsBuilder().importCompletionDataOperationSettings(); + } + + @Override + public CompletionServiceSettings build() throws IOException { + return new CompletionServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java new file mode 100644 index 00000000..8a4bdc41 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java @@ -0,0 +1,854 @@ +/* + * 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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.ControlServiceStub; +import com.google.cloud.retail.v2beta.stub.ControlServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 modifying Control. + * + *

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 (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   Control control = Control.newBuilder().build();
+ *   String controlId = "controlId-395080872";
+ *   Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ControlServiceClient 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 ControlServiceSettings 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.
+ * ControlServiceSettings controlServiceSettings =
+ *     ControlServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ControlServiceClient controlServiceClient = ControlServiceClient.create(controlServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceClient implements BackgroundResource { + private final ControlServiceSettings settings; + private final ControlServiceStub stub; + + /** Constructs an instance of ControlServiceClient with default settings. */ + public static final ControlServiceClient create() throws IOException { + return create(ControlServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ControlServiceClient, 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 ControlServiceClient create(ControlServiceSettings settings) + throws IOException { + return new ControlServiceClient(settings); + } + + /** + * Constructs an instance of ControlServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ControlServiceSettings). + */ + public static final ControlServiceClient create(ControlServiceStub stub) { + return new ControlServiceClient(stub); + } + + /** + * Constructs an instance of ControlServiceClient, 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 ControlServiceClient(ControlServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ControlServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ControlServiceClient(ControlServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ControlServiceSettings getSettings() { + return settings; + } + + public ControlServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   Control control = Control.newBuilder().build();
+   *   String controlId = "controlId-395080872";
+   *   Control response = controlServiceClient.createControl(parent, control, controlId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param control Required. The Control to create. + * @param controlId Required. The ID to use for the Control, which will become the final component + * of the Control's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control createControl(CatalogName parent, Control control, String controlId) { + CreateControlRequest request = + CreateControlRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setControl(control) + .setControlId(controlId) + .build(); + return createControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   Control control = Control.newBuilder().build();
+   *   String controlId = "controlId-395080872";
+   *   Control response = controlServiceClient.createControl(parent, control, controlId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent catalog. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param control Required. The Control to create. + * @param controlId Required. The ID to use for the Control, which will become the final component + * of the Control's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control createControl(String parent, Control control, String controlId) { + CreateControlRequest request = + CreateControlRequest.newBuilder() + .setParent(parent) + .setControl(control) + .setControlId(controlId) + .build(); + return createControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CreateControlRequest request =
+   *       CreateControlRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setControl(Control.newBuilder().build())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   Control response = controlServiceClient.createControl(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 Control createControl(CreateControlRequest request) { + return createControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   CreateControlRequest request =
+   *       CreateControlRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setControl(Control.newBuilder().build())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future = controlServiceClient.createControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createControlCallable() { + return stub.createControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+   *   controlServiceClient.deleteControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final void deleteControl(ControlName name) { + DeleteControlRequest request = + DeleteControlRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+   *   controlServiceClient.deleteControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final void deleteControl(String name) { + DeleteControlRequest request = DeleteControlRequest.newBuilder().setName(name).build(); + deleteControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   DeleteControlRequest request =
+   *       DeleteControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   controlServiceClient.deleteControl(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 deleteControl(DeleteControlRequest request) { + deleteControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Control. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   DeleteControlRequest request =
+   *       DeleteControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.deleteControlCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteControlCallable() { + return stub.deleteControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   Control control = Control.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Control response = controlServiceClient.updateControl(control, updateMask);
+   * }
+   * }
+ * + * @param control Required. The Control to update. + * @param updateMask Indicates which fields in the provided + * [Control][google.cloud.retail.v2beta.Control] to update. The following are NOT supported: + *
    + *
  • [Control.name][google.cloud.retail.v2beta.Control.name] + *
+ *

If not set or empty, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Control updateControl(Control control, FieldMask updateMask) { + UpdateControlRequest request = + UpdateControlRequest.newBuilder().setControl(control).setUpdateMask(updateMask).build(); + return updateControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   UpdateControlRequest request =
+   *       UpdateControlRequest.newBuilder()
+   *           .setControl(Control.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Control response = controlServiceClient.updateControl(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 Control updateControl(UpdateControlRequest request) { + return updateControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   UpdateControlRequest request =
+   *       UpdateControlRequest.newBuilder()
+   *           .setControl(Control.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.updateControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateControlCallable() { + return stub.updateControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
+   *   Control response = controlServiceClient.getControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final Control getControl(ControlName name) { + GetControlRequest request = + GetControlRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   String name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString();
+   *   Control response = controlServiceClient.getControl(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Control to delete. 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 + */ + public final Control getControl(String name) { + GetControlRequest request = GetControlRequest.newBuilder().setName(name).build(); + return getControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   GetControlRequest request =
+   *       GetControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   Control response = controlServiceClient.getControl(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 Control getControl(GetControlRequest request) { + return getControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   GetControlRequest request =
+   *       GetControlRequest.newBuilder()
+   *           .setName(
+   *               ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString())
+   *           .build();
+   *   ApiFuture future = controlServiceClient.getControlCallable().futureCall(request);
+   *   // Do something.
+   *   Control response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getControlCallable() { + return stub.getControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Controls linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ListControlsRequest request =
+   *       ListControlsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Control element : controlServiceClient.listControls(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 ListControlsPagedResponse listControls(ListControlsRequest request) { + return listControlsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Controls linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+   *   ListControlsRequest request =
+   *       ListControlsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListControlsResponse response = controlServiceClient.listControlsCallable().call(request);
+   *     for (Control element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listControlsCallable() { + return stub.listControlsCallable(); + } + + @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 ListControlsPagedResponse + extends AbstractPagedListResponse< + ListControlsRequest, + ListControlsResponse, + Control, + ListControlsPage, + ListControlsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListControlsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListControlsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListControlsPagedResponse(ListControlsPage page) { + super(page, ListControlsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListControlsPage + extends AbstractPage { + + private ListControlsPage( + PageContext context, + ListControlsResponse response) { + super(context, response); + } + + private static ListControlsPage createEmptyPage() { + return new ListControlsPage(null, null); + } + + @Override + protected ListControlsPage createPage( + PageContext context, + ListControlsResponse response) { + return new ListControlsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListControlsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListControlsRequest, + ListControlsResponse, + Control, + ListControlsPage, + ListControlsFixedSizeCollection> { + + private ListControlsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListControlsFixedSizeCollection createEmptyCollection() { + return new ListControlsFixedSizeCollection(null, 0); + } + + @Override + protected ListControlsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListControlsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceSettings.java new file mode 100644 index 00000000..bf76392d --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceSettings.java @@ -0,0 +1,231 @@ +/* + * 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.ControlServiceClient.ListControlsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.ControlServiceStubSettings; +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 ControlServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceSettings.Builder controlServiceSettingsBuilder =
+ *     ControlServiceSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ *     .createControlSettings()
+ *     .setRetrySettings(
+ *         controlServiceSettingsBuilder
+ *             .createControlSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ControlServiceSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createControl. */ + public UnaryCallSettings createControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).createControlSettings(); + } + + /** Returns the object with the settings used for calls to deleteControl. */ + public UnaryCallSettings deleteControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).deleteControlSettings(); + } + + /** Returns the object with the settings used for calls to updateControl. */ + public UnaryCallSettings updateControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).updateControlSettings(); + } + + /** Returns the object with the settings used for calls to getControl. */ + public UnaryCallSettings getControlSettings() { + return ((ControlServiceStubSettings) getStubSettings()).getControlSettings(); + } + + /** Returns the object with the settings used for calls to listControls. */ + public PagedCallSettings + listControlsSettings() { + return ((ControlServiceStubSettings) getStubSettings()).listControlsSettings(); + } + + public static final ControlServiceSettings create(ControlServiceStubSettings stub) + throws IOException { + return new ControlServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ControlServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ControlServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ControlServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ControlServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ControlServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ControlServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ControlServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ControlServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ControlServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ControlServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ControlServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ControlServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ControlServiceStubSettings.newBuilder()); + } + + public ControlServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ControlServiceStubSettings.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 createControl. */ + public UnaryCallSettings.Builder createControlSettings() { + return getStubSettingsBuilder().createControlSettings(); + } + + /** Returns the builder for the settings used for calls to deleteControl. */ + public UnaryCallSettings.Builder deleteControlSettings() { + return getStubSettingsBuilder().deleteControlSettings(); + } + + /** Returns the builder for the settings used for calls to updateControl. */ + public UnaryCallSettings.Builder updateControlSettings() { + return getStubSettingsBuilder().updateControlSettings(); + } + + /** Returns the builder for the settings used for calls to getControl. */ + public UnaryCallSettings.Builder getControlSettings() { + return getStubSettingsBuilder().getControlSettings(); + } + + /** Returns the builder for the settings used for calls to listControls. */ + public PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings() { + return getStubSettingsBuilder().listControlsSettings(); + } + + @Override + public ControlServiceSettings build() throws IOException { + return new ControlServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java new file mode 100644 index 00000000..6819b8ca --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java @@ -0,0 +1,251 @@ +/* + * 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.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.PredictionServiceStub; +import com.google.cloud.retail.v2beta.stub.PredictionServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for making recommendation prediction. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   PredictRequest request =
+ *       PredictRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllLabels(new HashMap())
+ *           .build();
+ *   PredictResponse response = predictionServiceClient.predict(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the PredictionServiceClient 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 PredictionServiceSettings 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.
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceClient implements BackgroundResource { + private final PredictionServiceSettings settings; + private final PredictionServiceStub stub; + + /** Constructs an instance of PredictionServiceClient with default settings. */ + public static final PredictionServiceClient create() throws IOException { + return create(PredictionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient create(PredictionServiceSettings settings) + throws IOException { + return new PredictionServiceClient(settings); + } + + /** + * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(PredictionServiceSettings). + */ + public static final PredictionServiceClient create(PredictionServiceStub stub) { + return new PredictionServiceClient(stub); + } + + /** + * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient(PredictionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected PredictionServiceClient(PredictionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final PredictionServiceSettings getSettings() { + return settings; + } + + public PredictionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Makes a recommendation prediction. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   PredictResponse response = predictionServiceClient.predict(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 PredictResponse predict(PredictRequest request) { + return predictCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Makes a recommendation prediction. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.predictCallable().futureCall(request);
+   *   // Do something.
+   *   PredictResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable predictCallable() { + return stub.predictCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceSettings.java new file mode 100644 index 00000000..f822c478 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceSettings.java @@ -0,0 +1,184 @@ +/* + * 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.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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.stub.PredictionServiceStubSettings; +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 PredictionServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder
+ *             .predictSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); + } + + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) + throws IOException { + return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 PredictionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(PredictionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(PredictionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(PredictionServiceStubSettings.newBuilder()); + } + + public PredictionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionServiceStubSettings.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 predict. */ + public UnaryCallSettings.Builder predictSettings() { + return getStubSettingsBuilder().predictSettings(); + } + + @Override + public PredictionServiceSettings build() throws IOException { + return new PredictionServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java new file mode 100644 index 00000000..75a3d8da --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java @@ -0,0 +1,2279 @@ +/* + * 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.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.ProductServiceStub; +import com.google.cloud.retail.v2beta.stub.ProductServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +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 ingesting [Product][google.cloud.retail.v2beta.Product] + * information of the customer's website. + * + *

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 (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "productId-1051830678";
+ *   Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ProductServiceClient 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 ProductServiceSettings 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.
+ * ProductServiceSettings productServiceSettings =
+ *     ProductServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceClient implements BackgroundResource { + private final ProductServiceSettings settings; + private final ProductServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ProductServiceClient with default settings. */ + public static final ProductServiceClient create() throws IOException { + return create(ProductServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProductServiceClient, 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 ProductServiceClient create(ProductServiceSettings settings) + throws IOException { + return new ProductServiceClient(settings); + } + + /** + * Constructs an instance of ProductServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ProductServiceSettings). + */ + public static final ProductServiceClient create(ProductServiceStub stub) { + return new ProductServiceClient(stub); + } + + /** + * Constructs an instance of ProductServiceClient, 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 ProductServiceClient(ProductServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProductServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ProductServiceClient(ProductServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ProductServiceSettings getSettings() { + return settings; + } + + public ProductServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "productId-1051830678";
+   *   Product response = productServiceClient.createProduct(parent, product, productId);
+   * }
+   * }
+ * + * @param parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * @param product Required. The [Product][google.cloud.retail.v2beta.Product] to create. + * @param productId Required. The ID to use for the [Product][google.cloud.retail.v2beta.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2beta.Product.name]. + *

If the caller does not have permission to create the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

This field must be unique among all [Product][google.cloud.retail.v2beta.Product]s with + * the same [parent][google.cloud.retail.v2beta.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + *

This field must be a UTF-8 encoded string with a length limit of 128 characters. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(BranchName parent, Product product, String productId) { + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+   *   Product product = Product.newBuilder().build();
+   *   String productId = "productId-1051830678";
+   *   Product response = productServiceClient.createProduct(parent, product, productId);
+   * }
+   * }
+ * + * @param parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + * @param product Required. The [Product][google.cloud.retail.v2beta.Product] to create. + * @param productId Required. The ID to use for the [Product][google.cloud.retail.v2beta.Product], + * which will become the final component of the + * [Product.name][google.cloud.retail.v2beta.Product.name]. + *

If the caller does not have permission to create the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

This field must be unique among all [Product][google.cloud.retail.v2beta.Product]s with + * the same [parent][google.cloud.retail.v2beta.CreateProductRequest.parent]. Otherwise, an + * ALREADY_EXISTS error is returned. + *

This field must be a UTF-8 encoded string with a length limit of 128 characters. + * Otherwise, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product createProduct(String parent, Product product, String productId) { + CreateProductRequest request = + CreateProductRequest.newBuilder() + .setParent(parent) + .setProduct(product) + .setProductId(productId) + .build(); + return createProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   CreateProductRequest request =
+   *       CreateProductRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setProduct(Product.newBuilder().build())
+   *           .setProductId("productId-1051830678")
+   *           .build();
+   *   Product response = productServiceClient.createProduct(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 Product createProduct(CreateProductRequest request) { + return createProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   CreateProductRequest request =
+   *       CreateProductRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setProduct(Product.newBuilder().build())
+   *           .setProductId("productId-1051830678")
+   *           .build();
+   *   ApiFuture future = productServiceClient.createProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createProductCallable() { + return stub.createProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   Product response = productServiceClient.getProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], such + * as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the requested [Product][google.cloud.retail.v2beta.Product] does not exist, a + * NOT_FOUND error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(ProductName name) { + GetProductRequest request = + GetProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   Product response = productServiceClient.getProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], such + * as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the requested [Product][google.cloud.retail.v2beta.Product] does not exist, a + * NOT_FOUND error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product getProduct(String name) { + GetProductRequest request = GetProductRequest.newBuilder().setName(name).build(); + return getProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   GetProductRequest request =
+   *       GetProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   Product response = productServiceClient.getProduct(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 Product getProduct(GetProductRequest request) { + return getProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   GetProductRequest request =
+   *       GetProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = productServiceClient.getProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getProductCallable() { + return stub.getProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2beta.Product]s under this branch, regardless of whether or + * not this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(BranchName parent) { + ListProductsRequest request = + ListProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString();
+   *   for (Product element : productServiceClient.listProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` + * as the branch ID, to list products under the default branch. + *

If the caller does not have permission to list + * [Product][google.cloud.retail.v2beta.Product]s under this branch, regardless of whether or + * not this branch exists, a PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProductsPagedResponse listProducts(String parent) { + ListProductsRequest request = ListProductsRequest.newBuilder().setParent(parent).build(); + return listProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   for (Product element : productServiceClient.listProducts(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 ListProductsPagedResponse listProducts(ListProductsRequest request) { + return listProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.listProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProductsPagedCallable() { + return stub.listProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ListProductsRequest request =
+   *       ListProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     ListProductsResponse response = productServiceClient.listProductsCallable().call(request);
+   *     for (Product element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listProductsCallable() { + return stub.listProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   Product product = Product.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Product response = productServiceClient.updateProduct(product, updateMask);
+   * }
+   * }
+ * + * @param product Required. The product to update/create. + *

If the caller does not have permission to update the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2beta.Product] to update does not exist and + * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing] is not set, + * a NOT_FOUND error is returned. + * @param updateMask Indicates which fields in the provided + * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and output only + * fields are NOT supported. If not set, all supported fields (the fields that are neither + * immutable nor output only) are updated. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Product updateProduct(Product product, FieldMask updateMask) { + UpdateProductRequest request = + UpdateProductRequest.newBuilder().setProduct(product).setUpdateMask(updateMask).build(); + return updateProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   UpdateProductRequest request =
+   *       UpdateProductRequest.newBuilder()
+   *           .setProduct(Product.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Product response = productServiceClient.updateProduct(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 Product updateProduct(UpdateProductRequest request) { + return updateProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   UpdateProductRequest request =
+   *       UpdateProductRequest.newBuilder()
+   *           .setProduct(Product.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = productServiceClient.updateProductCallable().futureCall(request);
+   *   // Do something.
+   *   Product response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateProductCallable() { + return stub.updateProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   productServiceClient.deleteProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], such + * as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2beta.Product] to delete does not exist, a + * NOT_FOUND error is returned. + *

The [Product][google.cloud.retail.v2beta.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2beta.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2beta.Product] with more than one + * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT + * error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2beta.Product] + * will be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(ProductName name) { + DeleteProductRequest request = + DeleteProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String name =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   productServiceClient.deleteProduct(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], such + * as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to delete the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2beta.Product] to delete does not exist, a + * NOT_FOUND error is returned. + *

The [Product][google.cloud.retail.v2beta.Product] to delete can neither be a + * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION] + * [Product][google.cloud.retail.v2beta.Product] member nor a + * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + * [Product][google.cloud.retail.v2beta.Product] with more than one + * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT + * error is returned. + *

All inventory information for the named [Product][google.cloud.retail.v2beta.Product] + * will be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteProduct(String name) { + DeleteProductRequest request = DeleteProductRequest.newBuilder().setName(name).build(); + deleteProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   DeleteProductRequest request =
+   *       DeleteProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   productServiceClient.deleteProduct(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 deleteProduct(DeleteProductRequest request) { + deleteProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Product][google.cloud.retail.v2beta.Product]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   DeleteProductRequest request =
+   *       DeleteProductRequest.newBuilder()
+   *           .setName(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = productServiceClient.deleteProductCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteProductCallable() { + return stub.deleteProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ImportProductsResponse response = productServiceClient.importProductsAsync(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 importProductsAsync( + ImportProductsRequest request) { + return importProductsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.importProductsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportProductsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + importProductsOperationCallable() { + return stub.importProductsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. + * + *

Request processing may be synchronous. No partial updating is supported. Non-existing items + * are created. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ImportProductsRequest request =
+   *       ImportProductsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setInputConfig(ProductInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationPubsubTopic("notificationPubsubTopic-1361224991")
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.importProductsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importProductsCallable() { + return stub.importProductsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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 + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or + * [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. + * + *

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   Product inventory = Product.newBuilder().build();
+   *   FieldMask setMask = FieldMask.newBuilder().build();
+   *   SetInventoryResponse response =
+   *       productServiceClient.setInventoryAsync(inventory, setMask).get();
+   * }
+   * }
+ * + * @param inventory Required. The inventory information to update. The allowable fields to update + * are: + *
    + *
  • [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + *
  • [Product.availability][google.cloud.retail.v2beta.Product.availability] + *
  • [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info] The + * updated inventory fields must be specified in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]. + *
+ *

If [SetInventoryRequest.inventory.name][] is empty or invalid, an INVALID_ARGUMENT error + * is returned. + *

If the caller does not have permission to update the + * [Product][google.cloud.retail.v2beta.Product] named in + * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of whether or not it + * exists, a PERMISSION_DENIED error is returned. + *

If the [Product][google.cloud.retail.v2beta.Product] to update does not have existing + * inventory information, the provided inventory information will be inserted. + *

If the [Product][google.cloud.retail.v2beta.Product] to update has existing inventory + * information, the provided inventory information will be merged while respecting the last + * update time for each inventory field, using the provided or default value for + * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time]. + *

The caller can replace place IDs for a subset of fulfillment types in the following + * ways: + *

    + *
  • Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + *
  • Specifies only the desired fulfillment types and corresponding place IDs to update in + * [SetInventoryRequest.inventory.fulfillment_info][] + *
+ *

The caller can clear all place IDs from a subset of fulfillment types in the following + * ways: + *

    + *
  • Adds "fulfillment_info" in + * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + *
  • Specifies only the desired fulfillment types to clear in + * [SetInventoryRequest.inventory.fulfillment_info][] + *
  • Checks that only the desired fulfillment info types have empty + * [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + *
+ *

The last update time is recorded for the following inventory fields: + *

    + *
  • [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + *
  • [Product.availability][google.cloud.retail.v2beta.Product.availability] + *
  • [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity] + *
  • [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info] + *
+ *

If a full overwrite of inventory information while ignoring timestamps is needed, + * [UpdateProduct][] should be invoked instead. + * @param setMask Indicates which inventory fields in the provided + * [Product][google.cloud.retail.v2beta.Product] to update. + *

At least one field must be provided. + *

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned + * and the entire update will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture setInventoryAsync( + Product inventory, FieldMask setMask) { + SetInventoryRequest request = + SetInventoryRequest.newBuilder().setInventory(inventory).setSetMask(setMask).build(); + return setInventoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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 + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or + * [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. + * + *

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   SetInventoryResponse response = productServiceClient.setInventoryAsync(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 setInventoryAsync( + SetInventoryRequest request) { + return setInventoryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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 + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or + * [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. + * + *

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.setInventoryOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SetInventoryResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + setInventoryOperationCallable() { + return stub.setInventoryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while + * respecting the last update timestamps of each inventory field. + * + *

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

When inventory is updated with + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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 + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or + * [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. + * + *

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

Pre-existing inventory information can only be updated with + * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], + * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   SetInventoryRequest request =
+   *       SetInventoryRequest.newBuilder()
+   *           .setInventory(Product.newBuilder().build())
+   *           .setSetMask(FieldMask.newBuilder().build())
+   *           .setSetTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = productServiceClient.setInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setInventoryCallable() { + return stub.setInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the added place IDs are not immediately manifested in + * the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(ProductName product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the added place IDs are not immediately manifested in + * the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addFulfillmentPlacesAsync(String product) { + AddFulfillmentPlacesRequest request = + AddFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return addFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the added place IDs are not immediately manifested in + * the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AddFulfillmentPlacesResponse response =
+   *       productServiceClient.addFulfillmentPlacesAsync(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 + addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) { + return addFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the added place IDs are not immediately manifested in + * the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.addFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return stub.addFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally adds place IDs to + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the added place IDs are not immediately manifested in + * the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddFulfillmentPlacesRequest request =
+   *       AddFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.addFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + addFulfillmentPlacesCallable() { + return stub.addFulfillmentPlacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the removed place IDs are not immediately manifested + * in the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(ProductName product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the removed place IDs are not immediately manifested + * in the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeFulfillmentPlacesAsync(String product) { + RemoveFulfillmentPlacesRequest request = + RemoveFulfillmentPlacesRequest.newBuilder().setProduct(product).build(); + return removeFulfillmentPlacesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the removed place IDs are not immediately manifested + * in the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   RemoveFulfillmentPlacesResponse response =
+   *       productServiceClient.removeFulfillmentPlacesAsync(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 + removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) { + return removeFulfillmentPlacesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the removed place IDs are not immediately manifested + * in the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.removeFulfillmentPlacesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemoveFulfillmentPlacesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return stub.removeFulfillmentPlacesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Incrementally removes place IDs from a + * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + * + *

This process is asynchronous and does not require the + * [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. + * If the request is valid, the update will be enqueued and processed downstream. As a + * consequence, when a response is returned, the removed place IDs are not immediately manifested + * in the [Product][google.cloud.retail.v2beta.Product] queried by + * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveFulfillmentPlacesRequest request =
+   *       RemoveFulfillmentPlacesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .setType("type3575610")
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.removeFulfillmentPlacesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeFulfillmentPlacesCallable() { + return stub.removeFulfillmentPlacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addLocalInventoriesAsync(ProductName product) { + AddLocalInventoriesRequest request = + AddLocalInventoriesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return addLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + addLocalInventoriesAsync(String product) { + AddLocalInventoriesRequest request = + AddLocalInventoriesRequest.newBuilder().setProduct(product).build(); + return addLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   AddLocalInventoriesResponse response =
+   *       productServiceClient.addLocalInventoriesAsync(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 + addLocalInventoriesAsync(AddLocalInventoriesRequest request) { + return addLocalInventoriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.addLocalInventoriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AddLocalInventoriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + return stub.addLocalInventoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places, while respecting the last update timestamps of each inventory field. + * + *

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

Local inventory information can only be modified using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   AddLocalInventoriesRequest request =
+   *       AddLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllLocalInventories(new ArrayList())
+   *           .setAddMask(FieldMask.newBuilder().build())
+   *           .setAddTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.addLocalInventoriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addLocalInventoriesCallable() { + return stub.addLocalInventoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   ProductName product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeLocalInventoriesAsync(ProductName product) { + RemoveLocalInventoriesRequest request = + RemoveLocalInventoriesRequest.newBuilder() + .setProduct(product == null ? null : product.toString()) + .build(); + return removeLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   String product =
+   *       ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *           .toString();
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(product).get();
+   * }
+   * }
+ * + * @param product Required. Full resource name of [Product][google.cloud.retail.v2beta.Product], + * such as + * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + *

If the caller does not have permission to access the + * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not it exists, a + * PERMISSION_DENIED error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + removeLocalInventoriesAsync(String product) { + RemoveLocalInventoriesRequest request = + RemoveLocalInventoriesRequest.newBuilder().setProduct(product).build(); + return removeLocalInventoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   RemoveLocalInventoriesResponse response =
+   *       productServiceClient.removeLocalInventoriesAsync(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 + removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) { + return removeLocalInventoriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       productServiceClient.removeLocalInventoriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RemoveLocalInventoriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + return stub.removeLocalInventoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a + * list of places at a removal timestamp. + * + *

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

Local inventory information can only be removed using this method. + * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and + * [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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+   *   RemoveLocalInventoriesRequest request =
+   *       RemoveLocalInventoriesRequest.newBuilder()
+   *           .setProduct(
+   *               ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]")
+   *                   .toString())
+   *           .addAllPlaceIds(new ArrayList())
+   *           .setRemoveTime(Timestamp.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       productServiceClient.removeLocalInventoriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + removeLocalInventoriesCallable() { + return stub.removeLocalInventoriesCallable(); + } + + @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 ListProductsPagedResponse + extends AbstractPagedListResponse< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProductsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProductsPagedResponse(ListProductsPage page) { + super(page, ListProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProductsPage + extends AbstractPage { + + private ListProductsPage( + PageContext context, + ListProductsResponse response) { + super(context, response); + } + + private static ListProductsPage createEmptyPage() { + return new ListProductsPage(null, null); + } + + @Override + protected ListProductsPage createPage( + PageContext context, + ListProductsResponse response) { + return new ListProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProductsRequest, + ListProductsResponse, + Product, + ListProductsPage, + ListProductsFixedSizeCollection> { + + private ListProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProductsFixedSizeCollection createEmptyCollection() { + return new ListProductsFixedSizeCollection(null, 0); + } + + @Override + protected ListProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProductsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceSettings.java new file mode 100644 index 00000000..fb3b0c17 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceSettings.java @@ -0,0 +1,391 @@ +/* + * 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.ProductServiceClient.ListProductsPagedResponse; + +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.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.ProductServiceStubSettings; +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 ProductServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceSettings.Builder productServiceSettingsBuilder =
+ *     ProductServiceSettings.newBuilder();
+ * productServiceSettingsBuilder
+ *     .createProductSettings()
+ *     .setRetrySettings(
+ *         productServiceSettingsBuilder
+ *             .createProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProductServiceSettings productServiceSettings = productServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).createProductSettings(); + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).getProductSettings(); + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).listProductsSettings(); + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).updateProductSettings(); + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return ((ProductServiceStubSettings) getStubSettings()).deleteProductSettings(); + } + + /** Returns the object with the settings used for calls to importProducts. */ + public UnaryCallSettings importProductsSettings() { + return ((ProductServiceStubSettings) getStubSettings()).importProductsSettings(); + } + + /** Returns the object with the settings used for calls to importProducts. */ + public OperationCallSettings + importProductsOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).importProductsOperationSettings(); + } + + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventorySettings(); + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).setInventoryOperationSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addFulfillmentPlacesOperationSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).removeFulfillmentPlacesSettings(); + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()) + .removeFulfillmentPlacesOperationSettings(); + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public UnaryCallSettings addLocalInventoriesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addLocalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()).addLocalInventoriesOperationSettings(); + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings + removeLocalInventoriesSettings() { + return ((ProductServiceStubSettings) getStubSettings()).removeLocalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return ((ProductServiceStubSettings) getStubSettings()) + .removeLocalInventoriesOperationSettings(); + } + + public static final ProductServiceSettings create(ProductServiceStubSettings stub) + throws IOException { + return new ProductServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProductServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ProductServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ProductServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProductServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ProductServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProductServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProductServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ProductServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ProductServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ProductServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ProductServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProductServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ProductServiceStubSettings.newBuilder()); + } + + public ProductServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ProductServiceStubSettings.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 createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return getStubSettingsBuilder().createProductSettings(); + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getStubSettingsBuilder().getProductSettings(); + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return getStubSettingsBuilder().listProductsSettings(); + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return getStubSettingsBuilder().updateProductSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return getStubSettingsBuilder().deleteProductSettings(); + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public UnaryCallSettings.Builder importProductsSettings() { + return getStubSettingsBuilder().importProductsSettings(); + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings() { + return getStubSettingsBuilder().importProductsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return getStubSettingsBuilder().setInventorySettings(); + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return getStubSettingsBuilder().setInventoryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().addFulfillmentPlacesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesSettings(); + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return getStubSettingsBuilder().removeFulfillmentPlacesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public UnaryCallSettings.Builder + addLocalInventoriesSettings() { + return getStubSettingsBuilder().addLocalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return getStubSettingsBuilder().addLocalInventoriesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings.Builder + removeLocalInventoriesSettings() { + return getStubSettingsBuilder().removeLocalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return getStubSettingsBuilder().removeLocalInventoriesOperationSettings(); + } + + @Override + public ProductServiceSettings build() throws IOException { + return new ProductServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java new file mode 100644 index 00000000..18a2867e --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java @@ -0,0 +1,431 @@ +/* + * 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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.SearchServiceStub; +import com.google.cloud.retail.v2beta.stub.SearchServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 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 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 (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SearchServiceClient 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 SearchServiceSettings 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.
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceClient implements BackgroundResource { + private final SearchServiceSettings settings; + private final SearchServiceStub stub; + + /** Constructs an instance of SearchServiceClient with default settings. */ + public static final SearchServiceClient create() throws IOException { + return create(SearchServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SearchServiceClient, 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 SearchServiceClient create(SearchServiceSettings settings) + throws IOException { + return new SearchServiceClient(settings); + } + + /** + * Constructs an instance of SearchServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SearchServiceSettings). + */ + public static final SearchServiceClient create(SearchServiceStub stub) { + return new SearchServiceClient(stub); + } + + /** + * Constructs an instance of SearchServiceClient, 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 SearchServiceClient(SearchServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SearchServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected SearchServiceClient(SearchServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final SearchServiceSettings getSettings() { + return settings; + } + + public SearchServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   for (SearchResponse.SearchResult element : searchServiceClient.search(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 SearchPagedResponse search(SearchRequest request) { + return searchPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       searchServiceClient.searchPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchResponse.SearchResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchPagedCallable() { + return stub.searchPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setPlacement("placement1792938725")
+   *           .setBranch(
+   *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+   *           .setQuery("query107944136")
+   *           .setVisitorId("visitorId1880545833")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setCanonicalFilter("canonicalFilter-722283124")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .addAllVariantRollupKeys(new ArrayList())
+   *           .addAllPageCategories(new ArrayList())
+   *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     SearchResponse response = searchServiceClient.searchCallable().call(request);
+   *     for (SearchResponse.SearchResult element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchCallable() { + return stub.searchCallable(); + } + + @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 SearchPagedResponse + extends AbstractPagedListResponse< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new SearchPagedResponse(input), MoreExecutors.directExecutor()); + } + + private SearchPagedResponse(SearchPage page) { + super(page, SearchFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchPage + extends AbstractPage { + + private SearchPage( + PageContext context, + SearchResponse response) { + super(context, response); + } + + private static SearchPage createEmptyPage() { + return new SearchPage(null, null); + } + + @Override + protected SearchPage createPage( + PageContext context, + SearchResponse response) { + return new SearchPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchRequest, + SearchResponse, + SearchResponse.SearchResult, + SearchPage, + SearchFixedSizeCollection> { + + private SearchFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchFixedSizeCollection createEmptyCollection() { + return new SearchFixedSizeCollection(null, 0); + } + + @Override + protected SearchFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceSettings.java new file mode 100644 index 00000000..2546b5a7 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceSettings.java @@ -0,0 +1,187 @@ +/* + * 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.SearchServiceClient.SearchPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.SearchServiceStubSettings; +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 SearchServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return ((SearchServiceStubSettings) getStubSettings()).searchSettings(); + } + + public static final SearchServiceSettings create(SearchServiceStubSettings stub) + throws IOException { + return new SearchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SearchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SearchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SearchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SearchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SearchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SearchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 SearchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SearchServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SearchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SearchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SearchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SearchServiceStubSettings.newBuilder()); + } + + public SearchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SearchServiceStubSettings.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 search. */ + public PagedCallSettings.Builder + searchSettings() { + return getStubSettingsBuilder().searchSettings(); + } + + @Override + public SearchServiceSettings build() throws IOException { + return new SearchServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java new file mode 100644 index 00000000..759b2a83 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java @@ -0,0 +1,1163 @@ +/* + * 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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.ServingConfigServiceStub; +import com.google.cloud.retail.v2beta.stub.ServingConfigServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 modifying ServingConfig. + * + *

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 (ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ *   String servingConfigId = "servingConfigId-831052759";
+ *   ServingConfig response =
+ *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ServingConfigServiceClient 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 ServingConfigServiceSettings + * 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.
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ *     ServingConfigServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create(servingConfigServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceClient implements BackgroundResource { + private final ServingConfigServiceSettings settings; + private final ServingConfigServiceStub stub; + + /** Constructs an instance of ServingConfigServiceClient with default settings. */ + public static final ServingConfigServiceClient create() throws IOException { + return create(ServingConfigServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient create(ServingConfigServiceSettings settings) + throws IOException { + return new ServingConfigServiceClient(settings); + } + + /** + * Constructs an instance of ServingConfigServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(ServingConfigServiceSettings). + */ + public static final ServingConfigServiceClient create(ServingConfigServiceStub stub) { + return new ServingConfigServiceClient(stub); + } + + /** + * Constructs an instance of ServingConfigServiceClient, 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 ServingConfigServiceClient(ServingConfigServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ServingConfigServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ServingConfigServiceClient(ServingConfigServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ServingConfigServiceSettings getSettings() { + return settings; + } + + public ServingConfigServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   String servingConfigId = "servingConfigId-831052759";
+   *   ServingConfig response =
+   *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param servingConfig Required. The ServingConfig to create. + * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the + * final component of the ServingConfig's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig createServingConfig( + CatalogName parent, ServingConfig servingConfig, String servingConfigId) { + CreateServingConfigRequest request = + CreateServingConfigRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setServingConfig(servingConfig) + .setServingConfigId(servingConfigId) + .build(); + return createServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   String servingConfigId = "servingConfigId-831052759";
+   *   ServingConfig response =
+   *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent. Format: + * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * @param servingConfig Required. The ServingConfig to create. + * @param servingConfigId Required. The ID to use for the ServingConfig, which will become the + * final component of the ServingConfig's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig createServingConfig( + String parent, ServingConfig servingConfig, String servingConfigId) { + CreateServingConfigRequest request = + CreateServingConfigRequest.newBuilder() + .setParent(parent) + .setServingConfig(servingConfig) + .setServingConfigId(servingConfigId) + .build(); + return createServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CreateServingConfigRequest request =
+   *       CreateServingConfigRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setServingConfigId("servingConfigId-831052759")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.createServingConfig(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 ServingConfig createServingConfig(CreateServingConfigRequest request) { + return createServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ServingConfig. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CreateServingConfigRequest request =
+   *       CreateServingConfigRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setServingConfigId("servingConfigId-831052759")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.createServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createServingConfigCallable() { + return stub.createServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   servingConfigServiceClient.deleteServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServingConfig(ServingConfigName name) { + DeleteServingConfigRequest request = + DeleteServingConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   servingConfigServiceClient.deleteServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServingConfig(String name) { + DeleteServingConfigRequest request = + DeleteServingConfigRequest.newBuilder().setName(name).build(); + deleteServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   DeleteServingConfigRequest request =
+   *       DeleteServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   servingConfigServiceClient.deleteServingConfig(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 deleteServingConfig(DeleteServingConfigRequest request) { + deleteServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   DeleteServingConfigRequest request =
+   *       DeleteServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.deleteServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteServingConfigCallable() { + return stub.deleteServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ServingConfig response =
+   *       servingConfigServiceClient.updateServingConfig(servingConfig, updateMask);
+   * }
+   * }
+ * + * @param servingConfig Required. The ServingConfig to update. + * @param updateMask Indicates which fields in the provided + * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The following are NOT + * supported: + *
    + *
  • [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name] + *
+ *

If not set, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig updateServingConfig( + ServingConfig servingConfig, FieldMask updateMask) { + UpdateServingConfigRequest request = + UpdateServingConfigRequest.newBuilder() + .setServingConfig(servingConfig) + .setUpdateMask(updateMask) + .build(); + return updateServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   UpdateServingConfigRequest request =
+   *       UpdateServingConfigRequest.newBuilder()
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.updateServingConfig(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 ServingConfig updateServingConfig(UpdateServingConfigRequest request) { + return updateServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   UpdateServingConfigRequest request =
+   *       UpdateServingConfigRequest.newBuilder()
+   *           .setServingConfig(ServingConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.updateServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateServingConfigCallable() { + return stub.updateServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig getServingConfig(ServingConfigName name) { + GetServingConfigRequest request = + GetServingConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String name =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServingConfig getServingConfig(String name) { + GetServingConfigRequest request = GetServingConfigRequest.newBuilder().setName(name).build(); + return getServingConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   GetServingConfigRequest request =
+   *       GetServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.getServingConfig(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 ServingConfig getServingConfig(GetServingConfigRequest request) { + return getServingConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a ServingConfig. + * + *

Returns a NotFound error if the ServingConfig does not exist. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   GetServingConfigRequest request =
+   *       GetServingConfigRequest.newBuilder()
+   *           .setName(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.getServingConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getServingConfigCallable() { + return stub.getServingConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The catalog resource name. Format: + * 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) { + ListServingConfigsRequest request = + ListServingConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServingConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The catalog resource name. Format: + * 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) { + ListServingConfigsRequest request = + ListServingConfigsRequest.newBuilder().setParent(parent).build(); + return listServingConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ListServingConfigsRequest request =
+   *       ListServingConfigsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ServingConfig element :
+   *       servingConfigServiceClient.listServingConfigs(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 ListServingConfigsPagedResponse listServingConfigs( + ListServingConfigsRequest request) { + return listServingConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ServingConfigs linked to this catalog. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ListServingConfigsRequest request =
+   *       ListServingConfigsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListServingConfigsResponse response =
+   *         servingConfigServiceClient.listServingConfigsCallable().call(request);
+   *     for (ServingConfig element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listServingConfigsCallable() { + return stub.listServingConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + AddControlRequest request = + AddControlRequest.newBuilder() + .setServingConfig(servingConfig == null ? null : servingConfig.toString()) + .build(); + return addControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.addControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + AddControlRequest request = + AddControlRequest.newBuilder().setServingConfig(servingConfig).build(); + return addControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   AddControlRequest request =
+   *       AddControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.addControl(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 ServingConfig addControl(AddControlRequest request) { + return addControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enables a Control on the specified ServingConfig. The control is added in the last position of + * the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the + * last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has + * already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum + * number of control allowed for that type of control. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   AddControlRequest request =
+   *       AddControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.addControlCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addControlCallable() { + return stub.addControlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   ServingConfigName servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
+   *   ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + RemoveControlRequest request = + RemoveControlRequest.newBuilder() + .setServingConfig(servingConfig == null ? null : servingConfig.toString()) + .build(); + return removeControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   String servingConfig =
+   *       ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *           .toString();
+   *   ServingConfig response = servingConfigServiceClient.removeControl(servingConfig);
+   * }
+   * }
+ * + * @param servingConfig Required. The source ServingConfig resource name . Format: + * 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) { + RemoveControlRequest request = + RemoveControlRequest.newBuilder().setServingConfig(servingConfig).build(); + return removeControl(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   RemoveControlRequest request =
+   *       RemoveControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ServingConfig response = servingConfigServiceClient.removeControl(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 ServingConfig removeControl(RemoveControlRequest request) { + return removeControlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Disables a Control on the specified ServingConfig. The control is removed from the + * ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ServingConfigServiceClient servingConfigServiceClient =
+   *     ServingConfigServiceClient.create()) {
+   *   RemoveControlRequest request =
+   *       RemoveControlRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setControlId("controlId-395080872")
+   *           .build();
+   *   ApiFuture future =
+   *       servingConfigServiceClient.removeControlCallable().futureCall(request);
+   *   // Do something.
+   *   ServingConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable removeControlCallable() { + return stub.removeControlCallable(); + } + + @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 ListServingConfigsPagedResponse + extends AbstractPagedListResponse< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage, + ListServingConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServingConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListServingConfigsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListServingConfigsPagedResponse(ListServingConfigsPage page) { + super(page, ListServingConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServingConfigsPage + extends AbstractPage< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage> { + + private ListServingConfigsPage( + PageContext context, + ListServingConfigsResponse response) { + super(context, response); + } + + private static ListServingConfigsPage createEmptyPage() { + return new ListServingConfigsPage(null, null); + } + + @Override + protected ListServingConfigsPage createPage( + PageContext context, + ListServingConfigsResponse response) { + return new ListServingConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServingConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServingConfigsRequest, + ListServingConfigsResponse, + ServingConfig, + ListServingConfigsPage, + ListServingConfigsFixedSizeCollection> { + + private ListServingConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServingConfigsFixedSizeCollection createEmptyCollection() { + return new ListServingConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListServingConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServingConfigsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceSettings.java new file mode 100644 index 00000000..60d56863 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceSettings.java @@ -0,0 +1,260 @@ +/* + * 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.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.ServingConfigServiceStubSettings; +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 ServingConfigServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceSettings.Builder servingConfigServiceSettingsBuilder =
+ *     ServingConfigServiceSettings.newBuilder();
+ * servingConfigServiceSettingsBuilder
+ *     .createServingConfigSettings()
+ *     .setRetrySettings(
+ *         servingConfigServiceSettingsBuilder
+ *             .createServingConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServingConfigServiceSettings servingConfigServiceSettings =
+ *     servingConfigServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createServingConfig. */ + public UnaryCallSettings + createServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).createServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings deleteServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).deleteServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateServingConfig. */ + public UnaryCallSettings + updateServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).updateServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to getServingConfig. */ + public UnaryCallSettings getServingConfigSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).getServingConfigSettings(); + } + + /** Returns the object with the settings used for calls to listServingConfigs. */ + public PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).listServingConfigsSettings(); + } + + /** Returns the object with the settings used for calls to addControl. */ + public UnaryCallSettings addControlSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).addControlSettings(); + } + + /** Returns the object with the settings used for calls to removeControl. */ + public UnaryCallSettings removeControlSettings() { + return ((ServingConfigServiceStubSettings) getStubSettings()).removeControlSettings(); + } + + public static final ServingConfigServiceSettings create(ServingConfigServiceStubSettings stub) + throws IOException { + return new ServingConfigServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ServingConfigServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ServingConfigServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ServingConfigServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ServingConfigServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ServingConfigServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ServingConfigServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServingConfigServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ServingConfigServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ServingConfigServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ServingConfigServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ServingConfigServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ServingConfigServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ServingConfigServiceStubSettings.newBuilder()); + } + + public ServingConfigServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ServingConfigServiceStubSettings.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 createServingConfig. */ + public UnaryCallSettings.Builder + createServingConfigSettings() { + return getStubSettingsBuilder().createServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings.Builder + deleteServingConfigSettings() { + return getStubSettingsBuilder().deleteServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateServingConfig. */ + public UnaryCallSettings.Builder + updateServingConfigSettings() { + return getStubSettingsBuilder().updateServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getServingConfig. */ + public UnaryCallSettings.Builder + getServingConfigSettings() { + return getStubSettingsBuilder().getServingConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listServingConfigs. */ + public PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return getStubSettingsBuilder().listServingConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to addControl. */ + public UnaryCallSettings.Builder addControlSettings() { + return getStubSettingsBuilder().addControlSettings(); + } + + /** Returns the builder for the settings used for calls to removeControl. */ + public UnaryCallSettings.Builder removeControlSettings() { + return getStubSettingsBuilder().removeControlSettings(); + } + + @Override + public ServingConfigServiceSettings build() throws IOException { + return new ServingConfigServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java new file mode 100644 index 00000000..7ee1b39c --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java @@ -0,0 +1,586 @@ +/* + * 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.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.UserEventServiceStub; +import com.google.cloud.retail.v2beta.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for ingesting end user actions on the customer website. + * + *

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 (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the UserEventServiceClient 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 UserEventServiceSettings 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.
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * UserEventServiceClient userEventServiceClient =
+ *     UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceClient implements BackgroundResource { + private final UserEventServiceSettings settings; + private final UserEventServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of UserEventServiceClient with default settings. */ + public static final UserEventServiceClient create() throws IOException { + return create(UserEventServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient create(UserEventServiceSettings settings) + throws IOException { + return new UserEventServiceClient(settings); + } + + /** + * Constructs an instance of UserEventServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(UserEventServiceSettings). + */ + public static final UserEventServiceClient create(UserEventServiceStub stub) { + return new UserEventServiceClient(stub); + } + + /** + * Constructs an instance of UserEventServiceClient, 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 UserEventServiceClient(UserEventServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((UserEventServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected UserEventServiceClient(UserEventServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final UserEventServiceSettings getSettings() { + return settings; + } + + public UserEventServiceStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .build();
+   *   UserEvent response = userEventServiceClient.writeUserEvent(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 UserEvent writeUserEvent(WriteUserEventRequest request) { + return writeUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.writeUserEventCallable().futureCall(request);
+   *   // Do something.
+   *   UserEvent response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable writeUserEventCallable() { + return stub.writeUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent("userEvent315571599")
+   *           .setUri("uri116076")
+   *           .setEts(100772)
+   *           .build();
+   *   HttpBody response = userEventServiceClient.collectUserEvent(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 HttpBody collectUserEvent(CollectUserEventRequest request) { + return collectUserEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event from the browser. This uses a GET request to due to browser + * restriction of POST-ing to a 3rd party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setUserEvent("userEvent315571599")
+   *           .setUri("uri116076")
+   *           .setEts(100772)
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.collectUserEventCallable().futureCall(request);
+   *   // Do something.
+   *   HttpBody response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable collectUserEventCallable() { + return stub.collectUserEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(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 purgeUserEventsAsync( + PurgeUserEventsRequest request) { + return purgeUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PurgeUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + purgeUserEventsOperationCallable() { + return stub.purgeUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes permanently all user events specified by the filter provided. Depending on the number + * of events specified by the filter, this operation could take hours or days to complete. To test + * a filter, use the list command first. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.purgeUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable purgeUserEventsCallable() { + return stub.purgeUserEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   ImportUserEventsResponse response =
+   *       userEventServiceClient.importUserEventsAsync(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 importUserEventsAsync( + ImportUserEventsRequest request) { + return importUserEventsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + importUserEventsOperationCallable() { + return stub.importUserEventsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setInputConfig(UserEventInputConfig.newBuilder().build())
+   *           .setErrorsConfig(ImportErrorsConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.importUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importUserEventsCallable() { + return stub.importUserEventsCallable(); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   RejoinUserEventsResponse response =
+   *       userEventServiceClient.rejoinUserEventsAsync(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 + rejoinUserEventsAsync(RejoinUserEventsRequest request) { + return rejoinUserEventsOperationCallable().futureCall(request); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   OperationFuture future =
+   *       userEventServiceClient.rejoinUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RejoinUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + return stub.rejoinUserEventsOperationCallable(); + } + + // 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 + * wrong product catalog. A rejoin operation can take hours or days to complete. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   RejoinUserEventsRequest request =
+   *       RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build();
+   *   ApiFuture future =
+   *       userEventServiceClient.rejoinUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable rejoinUserEventsCallable() { + return stub.rejoinUserEventsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceSettings.java new file mode 100644 index 00000000..68ae15b2 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceSettings.java @@ -0,0 +1,269 @@ +/* + * 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.HttpBody; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link UserEventServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder
+ *             .writeUserEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).writeUserEventSettings(); + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).collectUserEventSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public OperationCallSettings + purgeUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsOperationSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public OperationCallSettings + importUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsOperationSettings(); + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings rejoinUserEventsSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).rejoinUserEventsSettings(); + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).rejoinUserEventsOperationSettings(); + } + + public static final UserEventServiceSettings create(UserEventServiceStubSettings stub) + throws IOException { + return new UserEventServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return UserEventServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return UserEventServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return UserEventServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return UserEventServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return UserEventServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return UserEventServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return UserEventServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 UserEventServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for UserEventServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(UserEventServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(UserEventServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(UserEventServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(UserEventServiceStubSettings.newBuilder()); + } + + public UserEventServiceStubSettings.Builder getStubSettingsBuilder() { + return ((UserEventServiceStubSettings.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 writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return getStubSettingsBuilder().writeUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return getStubSettingsBuilder().collectUserEventSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return getStubSettingsBuilder().purgeUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings() { + return getStubSettingsBuilder().purgeUserEventsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return getStubSettingsBuilder().importUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return getStubSettingsBuilder().importUserEventsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings.Builder + rejoinUserEventsSettings() { + return getStubSettingsBuilder().rejoinUserEventsSettings(); + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return getStubSettingsBuilder().rejoinUserEventsOperationSettings(); + } + + @Override + public UserEventServiceSettings build() throws IOException { + return new UserEventServiceSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json new file mode 100644 index 00000000..e5e1a255 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json @@ -0,0 +1,210 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.retail.v2beta", + "libraryPackage": "com.google.cloud.retail.v2beta", + "services": { + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "CatalogServiceClient", + "rpcs": { + "AddCatalogAttribute": { + "methods": ["addCatalogAttribute", "addCatalogAttributeCallable"] + }, + "GetAttributesConfig": { + "methods": ["getAttributesConfig", "getAttributesConfig", "getAttributesConfig", "getAttributesConfigCallable"] + }, + "GetCompletionConfig": { + "methods": ["getCompletionConfig", "getCompletionConfig", "getCompletionConfig", "getCompletionConfigCallable"] + }, + "GetDefaultBranch": { + "methods": ["getDefaultBranch", "getDefaultBranch", "getDefaultBranch", "getDefaultBranchCallable"] + }, + "ListCatalogs": { + "methods": ["listCatalogs", "listCatalogs", "listCatalogs", "listCatalogsPagedCallable", "listCatalogsCallable"] + }, + "RemoveCatalogAttribute": { + "methods": ["removeCatalogAttribute", "removeCatalogAttributeCallable"] + }, + "ReplaceCatalogAttribute": { + "methods": ["replaceCatalogAttribute", "replaceCatalogAttributeCallable"] + }, + "SetDefaultBranch": { + "methods": ["setDefaultBranch", "setDefaultBranch", "setDefaultBranch", "setDefaultBranchCallable"] + }, + "UpdateAttributesConfig": { + "methods": ["updateAttributesConfig", "updateAttributesConfig", "updateAttributesConfigCallable"] + }, + "UpdateCatalog": { + "methods": ["updateCatalog", "updateCatalog", "updateCatalogCallable"] + }, + "UpdateCompletionConfig": { + "methods": ["updateCompletionConfig", "updateCompletionConfig", "updateCompletionConfigCallable"] + } + } + } + } + }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": ["completeQuery", "completeQueryCallable"] + }, + "ImportCompletionData": { + "methods": ["importCompletionDataAsync", "importCompletionDataOperationCallable", "importCompletionDataCallable"] + } + } + } + } + }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "ControlServiceClient", + "rpcs": { + "CreateControl": { + "methods": ["createControl", "createControl", "createControl", "createControlCallable"] + }, + "DeleteControl": { + "methods": ["deleteControl", "deleteControl", "deleteControl", "deleteControlCallable"] + }, + "GetControl": { + "methods": ["getControl", "getControl", "getControl", "getControlCallable"] + }, + "ListControls": { + "methods": ["listControls", "listControls", "listControls", "listControlsPagedCallable", "listControlsCallable"] + }, + "UpdateControl": { + "methods": ["updateControl", "updateControl", "updateControlCallable"] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": ["predict", "predictCallable"] + } + } + } + } + }, + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "ProductServiceClient", + "rpcs": { + "AddFulfillmentPlaces": { + "methods": ["addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesAsync", "addFulfillmentPlacesOperationCallable", "addFulfillmentPlacesCallable"] + }, + "AddLocalInventories": { + "methods": ["addLocalInventoriesAsync", "addLocalInventoriesAsync", "addLocalInventoriesAsync", "addLocalInventoriesOperationCallable", "addLocalInventoriesCallable"] + }, + "CreateProduct": { + "methods": ["createProduct", "createProduct", "createProduct", "createProductCallable"] + }, + "DeleteProduct": { + "methods": ["deleteProduct", "deleteProduct", "deleteProduct", "deleteProductCallable"] + }, + "GetProduct": { + "methods": ["getProduct", "getProduct", "getProduct", "getProductCallable"] + }, + "ImportProducts": { + "methods": ["importProductsAsync", "importProductsOperationCallable", "importProductsCallable"] + }, + "ListProducts": { + "methods": ["listProducts", "listProducts", "listProducts", "listProductsPagedCallable", "listProductsCallable"] + }, + "RemoveFulfillmentPlaces": { + "methods": ["removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesAsync", "removeFulfillmentPlacesOperationCallable", "removeFulfillmentPlacesCallable"] + }, + "RemoveLocalInventories": { + "methods": ["removeLocalInventoriesAsync", "removeLocalInventoriesAsync", "removeLocalInventoriesAsync", "removeLocalInventoriesOperationCallable", "removeLocalInventoriesCallable"] + }, + "SetInventory": { + "methods": ["setInventoryAsync", "setInventoryAsync", "setInventoryOperationCallable", "setInventoryCallable"] + }, + "UpdateProduct": { + "methods": ["updateProduct", "updateProduct", "updateProductCallable"] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": ["search", "searchPagedCallable", "searchCallable"] + } + } + } + } + }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "ServingConfigServiceClient", + "rpcs": { + "AddControl": { + "methods": ["addControl", "addControl", "addControl", "addControlCallable"] + }, + "CreateServingConfig": { + "methods": ["createServingConfig", "createServingConfig", "createServingConfig", "createServingConfigCallable"] + }, + "DeleteServingConfig": { + "methods": ["deleteServingConfig", "deleteServingConfig", "deleteServingConfig", "deleteServingConfigCallable"] + }, + "GetServingConfig": { + "methods": ["getServingConfig", "getServingConfig", "getServingConfig", "getServingConfigCallable"] + }, + "ListServingConfigs": { + "methods": ["listServingConfigs", "listServingConfigs", "listServingConfigs", "listServingConfigsPagedCallable", "listServingConfigsCallable"] + }, + "RemoveControl": { + "methods": ["removeControl", "removeControl", "removeControl", "removeControlCallable"] + }, + "UpdateServingConfig": { + "methods": ["updateServingConfig", "updateServingConfig", "updateServingConfigCallable"] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventServiceClient", + "rpcs": { + "CollectUserEvent": { + "methods": ["collectUserEvent", "collectUserEventCallable"] + }, + "ImportUserEvents": { + "methods": ["importUserEventsAsync", "importUserEventsOperationCallable", "importUserEventsCallable"] + }, + "PurgeUserEvents": { + "methods": ["purgeUserEventsAsync", "purgeUserEventsOperationCallable", "purgeUserEventsCallable"] + }, + "RejoinUserEvents": { + "methods": ["rejoinUserEventsAsync", "rejoinUserEventsOperationCallable", "rejoinUserEventsCallable"] + }, + "WriteUserEvent": { + "methods": ["writeUserEvent", "writeUserEventCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java new file mode 100644 index 00000000..3c8101af --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java @@ -0,0 +1,207 @@ +/* + * 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. + */ + +/** + * A client to Retail API + * + *

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

======================= CatalogServiceClient ======================= + * + *

Service Description: Service for managing catalog configuration. + * + *

Sample for CatalogServiceClient: + * + *

{@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()) {
+ *   Catalog catalog = Catalog.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
+ * }
+ * }
+ * + *

======================= CompletionServiceClient ======================= + * + *

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

Sample for CompletionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .addAllLanguageCodes(new ArrayList())
+ *           .setDeviceType("deviceType781190832")
+ *           .setDataset("dataset1443214456")
+ *           .setMaxSuggestions(618824852)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

======================= ControlServiceClient ======================= + * + *

Service Description: Service for modifying Control. + * + *

Sample for ControlServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ControlServiceClient controlServiceClient = ControlServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   Control control = Control.newBuilder().build();
+ *   String controlId = "controlId-395080872";
+ *   Control response = controlServiceClient.createControl(parent, control, controlId);
+ * }
+ * }
+ * + *

======================= PredictionServiceClient ======================= + * + *

Service Description: Service for making recommendation prediction. + * + *

Sample for PredictionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   PredictRequest request =
+ *       PredictRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllLabels(new HashMap())
+ *           .build();
+ *   PredictResponse response = predictionServiceClient.predict(request);
+ * }
+ * }
+ * + *

======================= ProductServiceClient ======================= + * + *

Service Description: Service for ingesting [Product][google.cloud.retail.v2beta.Product] + * information of the customer's website. + * + *

Sample for ProductServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
+ *   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
+ *   Product product = Product.newBuilder().build();
+ *   String productId = "productId-1051830678";
+ *   Product response = productServiceClient.createProduct(parent, product, productId);
+ * }
+ * }
+ * + *

======================= SearchServiceClient ======================= + * + *

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

Sample for SearchServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setPlacement("placement1792938725")
+ *           .setBranch(
+ *               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
+ *           .setQuery("query107944136")
+ *           .setVisitorId("visitorId1880545833")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setCanonicalFilter("canonicalFilter-722283124")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .addAllVariantRollupKeys(new ArrayList())
+ *           .addAllPageCategories(new ArrayList())
+ *           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

======================= ServingConfigServiceClient ======================= + * + *

Service Description: Service for modifying ServingConfig. + * + *

Sample for ServingConfigServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ServingConfigServiceClient servingConfigServiceClient =
+ *     ServingConfigServiceClient.create()) {
+ *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ *   ServingConfig servingConfig = ServingConfig.newBuilder().build();
+ *   String servingConfigId = "servingConfigId-831052759";
+ *   ServingConfig response =
+ *       servingConfigServiceClient.createServingConfig(parent, servingConfig, servingConfigId);
+ * }
+ * }
+ * + *

======================= UserEventServiceClient ======================= + * + *

Service Description: Service for ingesting end user actions on the customer website. + * + *

Sample for UserEventServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.retail.v2beta; + +import javax.annotation.Generated; diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java new file mode 100644 index 00000000..dc42b194 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java @@ -0,0 +1,108 @@ +/* + * 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.CatalogServiceClient.ListCatalogsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +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.Catalog; +import com.google.cloud.retail.v2beta.CompletionConfig; +import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; +import com.google.cloud.retail.v2beta.GetCompletionConfigRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchResponse; +import com.google.cloud.retail.v2beta.ListCatalogsRequest; +import com.google.cloud.retail.v2beta.ListCatalogsResponse; +import com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.SetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2beta.UpdateCatalogRequest; +import com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CatalogService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CatalogServiceStub implements BackgroundResource { + + public UnaryCallable listCatalogsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogsPagedCallable()"); + } + + public UnaryCallable listCatalogsCallable() { + throw new UnsupportedOperationException("Not implemented: listCatalogsCallable()"); + } + + public UnaryCallable updateCatalogCallable() { + throw new UnsupportedOperationException("Not implemented: updateCatalogCallable()"); + } + + public UnaryCallable setDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: setDefaultBranchCallable()"); + } + + public UnaryCallable + getDefaultBranchCallable() { + throw new UnsupportedOperationException("Not implemented: getDefaultBranchCallable()"); + } + + public UnaryCallable getCompletionConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getCompletionConfigCallable()"); + } + + public UnaryCallable + updateCompletionConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateCompletionConfigCallable()"); + } + + public UnaryCallable getAttributesConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getAttributesConfigCallable()"); + } + + public UnaryCallable + updateAttributesConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateAttributesConfigCallable()"); + } + + public UnaryCallable addCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: addCatalogAttributeCallable()"); + } + + public UnaryCallable + removeCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: removeCatalogAttributeCallable()"); + } + + public UnaryCallable + replaceCatalogAttributeCallable() { + throw new UnsupportedOperationException("Not implemented: replaceCatalogAttributeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java new file mode 100644 index 00000000..eb8c5830 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java @@ -0,0 +1,617 @@ +/* + * 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.CatalogServiceClient.ListCatalogsPagedResponse; + +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.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.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.AddCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.Catalog; +import com.google.cloud.retail.v2beta.CompletionConfig; +import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; +import com.google.cloud.retail.v2beta.GetCompletionConfigRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchResponse; +import com.google.cloud.retail.v2beta.ListCatalogsRequest; +import com.google.cloud.retail.v2beta.ListCatalogsResponse; +import com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.SetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2beta.UpdateCatalogRequest; +import com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest; +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.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 CatalogServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CatalogServiceStubSettings.Builder catalogServiceSettingsBuilder =
+ *     CatalogServiceStubSettings.newBuilder();
+ * catalogServiceSettingsBuilder
+ *     .updateCatalogSettings()
+ *     .setRetrySettings(
+ *         catalogServiceSettingsBuilder
+ *             .updateCatalogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CatalogServiceStubSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CatalogServiceStubSettings 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 PagedCallSettings< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings; + private final UnaryCallSettings updateCatalogSettings; + private final UnaryCallSettings setDefaultBranchSettings; + private final UnaryCallSettings + getDefaultBranchSettings; + private final UnaryCallSettings + getCompletionConfigSettings; + private final UnaryCallSettings + updateCompletionConfigSettings; + private final UnaryCallSettings + getAttributesConfigSettings; + private final UnaryCallSettings + updateAttributesConfigSettings; + private final UnaryCallSettings + addCatalogAttributeSettings; + private final UnaryCallSettings + removeCatalogAttributeSettings; + private final UnaryCallSettings + replaceCatalogAttributeSettings; + + private static final PagedListDescriptor + LIST_CATALOGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCatalogsRequest injectToken(ListCatalogsRequest payload, String token) { + return ListCatalogsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCatalogsRequest injectPageSize(ListCatalogsRequest payload, int pageSize) { + return ListCatalogsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCatalogsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCatalogsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCatalogsResponse payload) { + return payload.getCatalogsList() == null + ? ImmutableList.of() + : payload.getCatalogsList(); + } + }; + + private static final PagedListResponseFactory< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + LIST_CATALOGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCatalogsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CATALOGS_PAGE_STR_DESC, request, context); + return ListCatalogsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listCatalogs. */ + public PagedCallSettings + listCatalogsSettings() { + return listCatalogsSettings; + } + + /** Returns the object with the settings used for calls to updateCatalog. */ + public UnaryCallSettings updateCatalogSettings() { + return updateCatalogSettings; + } + + /** Returns the object with the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the object with the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + + /** Returns the object with the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings + getCompletionConfigSettings() { + return getCompletionConfigSettings; + } + + /** Returns the object with the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings + updateCompletionConfigSettings() { + return updateCompletionConfigSettings; + } + + /** Returns the object with the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings + getAttributesConfigSettings() { + return getAttributesConfigSettings; + } + + /** Returns the object with the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings + updateAttributesConfigSettings() { + return updateAttributesConfigSettings; + } + + /** Returns the object with the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings + addCatalogAttributeSettings() { + return addCatalogAttributeSettings; + } + + /** Returns the object with the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings + removeCatalogAttributeSettings() { + return removeCatalogAttributeSettings; + } + + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings + replaceCatalogAttributeSettings() { + return replaceCatalogAttributeSettings; + } + + public CatalogServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCatalogServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CatalogServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CatalogServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listCatalogsSettings = settingsBuilder.listCatalogsSettings().build(); + updateCatalogSettings = settingsBuilder.updateCatalogSettings().build(); + setDefaultBranchSettings = settingsBuilder.setDefaultBranchSettings().build(); + getDefaultBranchSettings = settingsBuilder.getDefaultBranchSettings().build(); + getCompletionConfigSettings = settingsBuilder.getCompletionConfigSettings().build(); + updateCompletionConfigSettings = settingsBuilder.updateCompletionConfigSettings().build(); + getAttributesConfigSettings = settingsBuilder.getAttributesConfigSettings().build(); + updateAttributesConfigSettings = settingsBuilder.updateAttributesConfigSettings().build(); + addCatalogAttributeSettings = settingsBuilder.addCatalogAttributeSettings().build(); + removeCatalogAttributeSettings = settingsBuilder.removeCatalogAttributeSettings().build(); + replaceCatalogAttributeSettings = settingsBuilder.replaceCatalogAttributeSettings().build(); + } + + /** Builder for CatalogServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings; + private final UnaryCallSettings.Builder updateCatalogSettings; + private final UnaryCallSettings.Builder + setDefaultBranchSettings; + private final UnaryCallSettings.Builder + getDefaultBranchSettings; + private final UnaryCallSettings.Builder + getCompletionConfigSettings; + private final UnaryCallSettings.Builder + updateCompletionConfigSettings; + private final UnaryCallSettings.Builder + getAttributesConfigSettings; + private final UnaryCallSettings.Builder + updateAttributesConfigSettings; + private final UnaryCallSettings.Builder + addCatalogAttributeSettings; + private final UnaryCallSettings.Builder + removeCatalogAttributeSettings; + private final UnaryCallSettings.Builder + replaceCatalogAttributeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listCatalogsSettings = PagedCallSettings.newBuilder(LIST_CATALOGS_PAGE_STR_FACT); + updateCatalogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDefaultBranchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCompletionConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCompletionConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getAttributesConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAttributesConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + replaceCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings, + getCompletionConfigSettings, + updateCompletionConfigSettings, + getAttributesConfigSettings, + updateAttributesConfigSettings, + addCatalogAttributeSettings, + removeCatalogAttributeSettings, + replaceCatalogAttributeSettings); + initDefaults(this); + } + + protected Builder(CatalogServiceStubSettings settings) { + super(settings); + + listCatalogsSettings = settings.listCatalogsSettings.toBuilder(); + updateCatalogSettings = settings.updateCatalogSettings.toBuilder(); + setDefaultBranchSettings = settings.setDefaultBranchSettings.toBuilder(); + getDefaultBranchSettings = settings.getDefaultBranchSettings.toBuilder(); + getCompletionConfigSettings = settings.getCompletionConfigSettings.toBuilder(); + updateCompletionConfigSettings = settings.updateCompletionConfigSettings.toBuilder(); + getAttributesConfigSettings = settings.getAttributesConfigSettings.toBuilder(); + updateAttributesConfigSettings = settings.updateAttributesConfigSettings.toBuilder(); + addCatalogAttributeSettings = settings.addCatalogAttributeSettings.toBuilder(); + removeCatalogAttributeSettings = settings.removeCatalogAttributeSettings.toBuilder(); + replaceCatalogAttributeSettings = settings.replaceCatalogAttributeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listCatalogsSettings, + updateCatalogSettings, + setDefaultBranchSettings, + getDefaultBranchSettings, + getCompletionConfigSettings, + updateCompletionConfigSettings, + getAttributesConfigSettings, + updateAttributesConfigSettings, + addCatalogAttributeSettings, + removeCatalogAttributeSettings, + replaceCatalogAttributeSettings); + } + + 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 initDefaults(Builder builder) { + builder + .listCatalogsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateCatalogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getDefaultBranchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getCompletionConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateCompletionConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getAttributesConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateAttributesConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .addCatalogAttributeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .removeCatalogAttributeSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 listCatalogs. */ + public PagedCallSettings.Builder< + ListCatalogsRequest, ListCatalogsResponse, ListCatalogsPagedResponse> + listCatalogsSettings() { + return listCatalogsSettings; + } + + /** Returns the builder for the settings used for calls to updateCatalog. */ + public UnaryCallSettings.Builder updateCatalogSettings() { + return updateCatalogSettings; + } + + /** Returns the builder for the settings used for calls to setDefaultBranch. */ + public UnaryCallSettings.Builder setDefaultBranchSettings() { + return setDefaultBranchSettings; + } + + /** Returns the builder for the settings used for calls to getDefaultBranch. */ + public UnaryCallSettings.Builder + getDefaultBranchSettings() { + return getDefaultBranchSettings; + } + + /** Returns the builder for the settings used for calls to getCompletionConfig. */ + public UnaryCallSettings.Builder + getCompletionConfigSettings() { + return getCompletionConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateCompletionConfig. */ + public UnaryCallSettings.Builder + updateCompletionConfigSettings() { + return updateCompletionConfigSettings; + } + + /** Returns the builder for the settings used for calls to getAttributesConfig. */ + public UnaryCallSettings.Builder + getAttributesConfigSettings() { + return getAttributesConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateAttributesConfig. */ + public UnaryCallSettings.Builder + updateAttributesConfigSettings() { + return updateAttributesConfigSettings; + } + + /** Returns the builder for the settings used for calls to addCatalogAttribute. */ + public UnaryCallSettings.Builder + addCatalogAttributeSettings() { + return addCatalogAttributeSettings; + } + + /** Returns the builder for the settings used for calls to removeCatalogAttribute. */ + public UnaryCallSettings.Builder + removeCatalogAttributeSettings() { + return removeCatalogAttributeSettings; + } + + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ + public UnaryCallSettings.Builder + replaceCatalogAttributeSettings() { + return replaceCatalogAttributeSettings; + } + + @Override + public CatalogServiceStubSettings build() throws IOException { + return new CatalogServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStub.java new file mode 100644 index 00000000..055478f2 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStub.java @@ -0,0 +1,63 @@ +/* + * 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.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.CompleteQueryRequest; +import com.google.cloud.retail.v2beta.CompleteQueryResponse; +import com.google.cloud.retail.v2beta.ImportCompletionDataRequest; +import com.google.cloud.retail.v2beta.ImportCompletionDataResponse; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CompletionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable completeQueryCallable() { + throw new UnsupportedOperationException("Not implemented: completeQueryCallable()"); + } + + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: importCompletionDataOperationCallable()"); + } + + public UnaryCallable importCompletionDataCallable() { + throw new UnsupportedOperationException("Not implemented: importCompletionDataCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java new file mode 100644 index 00000000..4fe5cbbc --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java @@ -0,0 +1,367 @@ +/* + * 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.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.CompleteQueryRequest; +import com.google.cloud.retail.v2beta.CompleteQueryResponse; +import com.google.cloud.retail.v2beta.ImportCompletionDataRequest; +import com.google.cloud.retail.v2beta.ImportCompletionDataResponse; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CompletionServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CompletionServiceStubSettings.Builder completionServiceSettingsBuilder =
+ *     CompletionServiceStubSettings.newBuilder();
+ * completionServiceSettingsBuilder
+ *     .completeQuerySettings()
+ *     .setRetrySettings(
+ *         completionServiceSettingsBuilder
+ *             .completeQuerySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CompletionServiceStubSettings completionServiceSettings =
+ *     completionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CompletionServiceStubSettings 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 + completeQuerySettings; + private final UnaryCallSettings + importCompletionDataSettings; + private final OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public UnaryCallSettings importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the object with the settings used for calls to importCompletionData. */ + public OperationCallSettings< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + public CompletionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCompletionServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CompletionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 CompletionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + completeQuerySettings = settingsBuilder.completeQuerySettings().build(); + importCompletionDataSettings = settingsBuilder.importCompletionDataSettings().build(); + importCompletionDataOperationSettings = + settingsBuilder.importCompletionDataOperationSettings().build(); + } + + /** Builder for CompletionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + completeQuerySettings; + private final UnaryCallSettings.Builder + importCompletionDataSettings; + private final OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + completeQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importCompletionDataOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + initDefaults(this); + } + + protected Builder(CompletionServiceStubSettings settings) { + super(settings); + + completeQuerySettings = settings.completeQuerySettings.toBuilder(); + importCompletionDataSettings = settings.importCompletionDataSettings.toBuilder(); + importCompletionDataOperationSettings = + settings.importCompletionDataOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + completeQuerySettings, importCompletionDataSettings); + } + + 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 initDefaults(Builder builder) { + builder + .completeQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .importCompletionDataOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ImportCompletionDataResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return completeQuerySettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + public UnaryCallSettings.Builder + importCompletionDataSettings() { + return importCompletionDataSettings; + } + + /** Returns the builder for the settings used for calls to importCompletionData. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationSettings() { + return importCompletionDataOperationSettings; + } + + @Override + public CompletionServiceStubSettings build() throws IOException { + return new CompletionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStub.java new file mode 100644 index 00000000..69cd18e5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStub.java @@ -0,0 +1,70 @@ +/* + * 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.ControlServiceClient.ListControlsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.Control; +import com.google.cloud.retail.v2beta.CreateControlRequest; +import com.google.cloud.retail.v2beta.DeleteControlRequest; +import com.google.cloud.retail.v2beta.GetControlRequest; +import com.google.cloud.retail.v2beta.ListControlsRequest; +import com.google.cloud.retail.v2beta.ListControlsResponse; +import com.google.cloud.retail.v2beta.UpdateControlRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ControlService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ControlServiceStub implements BackgroundResource { + + public UnaryCallable createControlCallable() { + throw new UnsupportedOperationException("Not implemented: createControlCallable()"); + } + + public UnaryCallable deleteControlCallable() { + throw new UnsupportedOperationException("Not implemented: deleteControlCallable()"); + } + + public UnaryCallable updateControlCallable() { + throw new UnsupportedOperationException("Not implemented: updateControlCallable()"); + } + + public UnaryCallable getControlCallable() { + throw new UnsupportedOperationException("Not implemented: getControlCallable()"); + } + + public UnaryCallable listControlsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listControlsPagedCallable()"); + } + + public UnaryCallable listControlsCallable() { + throw new UnsupportedOperationException("Not implemented: listControlsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java new file mode 100644 index 00000000..8014e8b7 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java @@ -0,0 +1,429 @@ +/* + * 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.ControlServiceClient.ListControlsPagedResponse; + +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.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.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.Control; +import com.google.cloud.retail.v2beta.CreateControlRequest; +import com.google.cloud.retail.v2beta.DeleteControlRequest; +import com.google.cloud.retail.v2beta.GetControlRequest; +import com.google.cloud.retail.v2beta.ListControlsRequest; +import com.google.cloud.retail.v2beta.ListControlsResponse; +import com.google.cloud.retail.v2beta.UpdateControlRequest; +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.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 ControlServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ControlServiceStubSettings.Builder controlServiceSettingsBuilder =
+ *     ControlServiceStubSettings.newBuilder();
+ * controlServiceSettingsBuilder
+ *     .createControlSettings()
+ *     .setRetrySettings(
+ *         controlServiceSettingsBuilder
+ *             .createControlSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ControlServiceStubSettings controlServiceSettings = controlServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ControlServiceStubSettings 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 createControlSettings; + private final UnaryCallSettings deleteControlSettings; + private final UnaryCallSettings updateControlSettings; + private final UnaryCallSettings getControlSettings; + private final PagedCallSettings< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings; + + private static final PagedListDescriptor + LIST_CONTROLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListControlsRequest injectToken(ListControlsRequest payload, String token) { + return ListControlsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListControlsRequest injectPageSize(ListControlsRequest payload, int pageSize) { + return ListControlsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListControlsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListControlsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListControlsResponse payload) { + return payload.getControlsList() == null + ? ImmutableList.of() + : payload.getControlsList(); + } + }; + + private static final PagedListResponseFactory< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + LIST_CONTROLS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListControlsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONTROLS_PAGE_STR_DESC, request, context); + return ListControlsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createControl. */ + public UnaryCallSettings createControlSettings() { + return createControlSettings; + } + + /** Returns the object with the settings used for calls to deleteControl. */ + public UnaryCallSettings deleteControlSettings() { + return deleteControlSettings; + } + + /** Returns the object with the settings used for calls to updateControl. */ + public UnaryCallSettings updateControlSettings() { + return updateControlSettings; + } + + /** Returns the object with the settings used for calls to getControl. */ + public UnaryCallSettings getControlSettings() { + return getControlSettings; + } + + /** Returns the object with the settings used for calls to listControls. */ + public PagedCallSettings + listControlsSettings() { + return listControlsSettings; + } + + public ControlServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcControlServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ControlServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ControlServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createControlSettings = settingsBuilder.createControlSettings().build(); + deleteControlSettings = settingsBuilder.deleteControlSettings().build(); + updateControlSettings = settingsBuilder.updateControlSettings().build(); + getControlSettings = settingsBuilder.getControlSettings().build(); + listControlsSettings = settingsBuilder.listControlsSettings().build(); + } + + /** Builder for ControlServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createControlSettings; + private final UnaryCallSettings.Builder deleteControlSettings; + private final UnaryCallSettings.Builder updateControlSettings; + private final UnaryCallSettings.Builder getControlSettings; + private final PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings; + 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); + + createControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listControlsSettings = PagedCallSettings.newBuilder(LIST_CONTROLS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createControlSettings, + deleteControlSettings, + updateControlSettings, + getControlSettings, + listControlsSettings); + initDefaults(this); + } + + protected Builder(ControlServiceStubSettings settings) { + super(settings); + + createControlSettings = settings.createControlSettings.toBuilder(); + deleteControlSettings = settings.deleteControlSettings.toBuilder(); + updateControlSettings = settings.updateControlSettings.toBuilder(); + getControlSettings = settings.getControlSettings.toBuilder(); + listControlsSettings = settings.listControlsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createControlSettings, + deleteControlSettings, + updateControlSettings, + getControlSettings, + listControlsSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listControlsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 createControl. */ + public UnaryCallSettings.Builder createControlSettings() { + return createControlSettings; + } + + /** Returns the builder for the settings used for calls to deleteControl. */ + public UnaryCallSettings.Builder deleteControlSettings() { + return deleteControlSettings; + } + + /** Returns the builder for the settings used for calls to updateControl. */ + public UnaryCallSettings.Builder updateControlSettings() { + return updateControlSettings; + } + + /** Returns the builder for the settings used for calls to getControl. */ + public UnaryCallSettings.Builder getControlSettings() { + return getControlSettings; + } + + /** Returns the builder for the settings used for calls to listControls. */ + public PagedCallSettings.Builder< + ListControlsRequest, ListControlsResponse, ListControlsPagedResponse> + listControlsSettings() { + return listControlsSettings; + } + + @Override + public ControlServiceStubSettings build() throws IOException { + return new ControlServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceCallableFactory.java new file mode 100644 index 00000000..cf242099 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceCallableFactory.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 CatalogService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCatalogServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java new file mode 100644 index 00000000..67facb2d --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java @@ -0,0 +1,525 @@ +/* + * 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.CatalogServiceClient.ListCatalogsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.AddCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.Catalog; +import com.google.cloud.retail.v2beta.CompletionConfig; +import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; +import com.google.cloud.retail.v2beta.GetCompletionConfigRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.GetDefaultBranchResponse; +import com.google.cloud.retail.v2beta.ListCatalogsRequest; +import com.google.cloud.retail.v2beta.ListCatalogsResponse; +import com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest; +import com.google.cloud.retail.v2beta.SetDefaultBranchRequest; +import com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest; +import com.google.cloud.retail.v2beta.UpdateCatalogRequest; +import com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest; +import com.google.common.collect.ImmutableMap; +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 CatalogService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCatalogServiceStub extends CatalogServiceStub { + private static final MethodDescriptor + listCatalogsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/ListCatalogs") + .setRequestMarshaller(ProtoUtils.marshaller(ListCatalogsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCatalogsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCatalogMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/UpdateCatalog") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCatalogRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Catalog.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/SetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(SetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getDefaultBranchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/GetDefaultBranch") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDefaultBranchRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GetDefaultBranchResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCompletionConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/GetCompletionConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCompletionConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCompletionConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/UpdateCompletionConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCompletionConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAttributesConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/GetAttributesConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAttributesConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAttributesConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/UpdateAttributesConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAttributesConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/AddCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(AddCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CatalogService/RemoveCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + replaceCatalogAttributeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.CatalogService/ReplaceCatalogAttribute") + .setRequestMarshaller( + ProtoUtils.marshaller(ReplaceCatalogAttributeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) + .build(); + + private final UnaryCallable listCatalogsCallable; + private final UnaryCallable + listCatalogsPagedCallable; + private final UnaryCallable updateCatalogCallable; + private final UnaryCallable setDefaultBranchCallable; + private final UnaryCallable + getDefaultBranchCallable; + private final UnaryCallable + getCompletionConfigCallable; + private final UnaryCallable + updateCompletionConfigCallable; + private final UnaryCallable + getAttributesConfigCallable; + private final UnaryCallable + updateAttributesConfigCallable; + private final UnaryCallable + addCatalogAttributeCallable; + private final UnaryCallable + removeCatalogAttributeCallable; + private final UnaryCallable + replaceCatalogAttributeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCatalogServiceStub create(CatalogServiceStubSettings settings) + throws IOException { + return new GrpcCatalogServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCatalogServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCatalogServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCatalogServiceStub( + CatalogServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub(CatalogServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCatalogServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCatalogServiceStub, 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 GrpcCatalogServiceStub( + CatalogServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listCatalogsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCatalogsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateCatalogTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCatalogMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog.name", String.valueOf(request.getCatalog().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setDefaultBranchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings + getDefaultBranchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDefaultBranchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings + getCompletionConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCompletionConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateCompletionConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCompletionConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "completion_config.name", + String.valueOf(request.getCompletionConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getAttributesConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAttributesConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateAttributesConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAttributesConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config.name", + String.valueOf(request.getAttributesConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + addCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings + replaceCatalogAttributeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(replaceCatalogAttributeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); + + this.listCatalogsCallable = + callableFactory.createUnaryCallable( + listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext); + this.listCatalogsPagedCallable = + callableFactory.createPagedCallable( + listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext); + this.updateCatalogCallable = + callableFactory.createUnaryCallable( + updateCatalogTransportSettings, settings.updateCatalogSettings(), clientContext); + this.setDefaultBranchCallable = + callableFactory.createUnaryCallable( + setDefaultBranchTransportSettings, settings.setDefaultBranchSettings(), clientContext); + this.getDefaultBranchCallable = + callableFactory.createUnaryCallable( + getDefaultBranchTransportSettings, settings.getDefaultBranchSettings(), clientContext); + this.getCompletionConfigCallable = + callableFactory.createUnaryCallable( + getCompletionConfigTransportSettings, + settings.getCompletionConfigSettings(), + clientContext); + this.updateCompletionConfigCallable = + callableFactory.createUnaryCallable( + updateCompletionConfigTransportSettings, + settings.updateCompletionConfigSettings(), + clientContext); + this.getAttributesConfigCallable = + callableFactory.createUnaryCallable( + getAttributesConfigTransportSettings, + settings.getAttributesConfigSettings(), + clientContext); + this.updateAttributesConfigCallable = + callableFactory.createUnaryCallable( + updateAttributesConfigTransportSettings, + settings.updateAttributesConfigSettings(), + clientContext); + this.addCatalogAttributeCallable = + callableFactory.createUnaryCallable( + addCatalogAttributeTransportSettings, + settings.addCatalogAttributeSettings(), + clientContext); + this.removeCatalogAttributeCallable = + callableFactory.createUnaryCallable( + removeCatalogAttributeTransportSettings, + settings.removeCatalogAttributeSettings(), + clientContext); + this.replaceCatalogAttributeCallable = + callableFactory.createUnaryCallable( + replaceCatalogAttributeTransportSettings, + settings.replaceCatalogAttributeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listCatalogsCallable() { + return listCatalogsCallable; + } + + @Override + public UnaryCallable listCatalogsPagedCallable() { + return listCatalogsPagedCallable; + } + + @Override + public UnaryCallable updateCatalogCallable() { + return updateCatalogCallable; + } + + @Override + public UnaryCallable setDefaultBranchCallable() { + return setDefaultBranchCallable; + } + + @Override + public UnaryCallable + getDefaultBranchCallable() { + return getDefaultBranchCallable; + } + + @Override + public UnaryCallable getCompletionConfigCallable() { + return getCompletionConfigCallable; + } + + @Override + public UnaryCallable + updateCompletionConfigCallable() { + return updateCompletionConfigCallable; + } + + @Override + public UnaryCallable getAttributesConfigCallable() { + return getAttributesConfigCallable; + } + + @Override + public UnaryCallable + updateAttributesConfigCallable() { + return updateAttributesConfigCallable; + } + + @Override + public UnaryCallable addCatalogAttributeCallable() { + return addCatalogAttributeCallable; + } + + @Override + public UnaryCallable + removeCatalogAttributeCallable() { + return removeCatalogAttributeCallable; + } + + @Override + public UnaryCallable + replaceCatalogAttributeCallable() { + return replaceCatalogAttributeCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceCallableFactory.java new file mode 100644 index 00000000..63a28128 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceCallableFactory.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 CompletionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceStub.java new file mode 100644 index 00000000..e89640b7 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCompletionServiceStub.java @@ -0,0 +1,218 @@ +/* + * 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.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.CompleteQueryRequest; +import com.google.cloud.retail.v2beta.CompleteQueryResponse; +import com.google.cloud.retail.v2beta.ImportCompletionDataRequest; +import com.google.cloud.retail.v2beta.ImportCompletionDataResponse; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CompletionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCompletionServiceStub extends CompletionServiceStub { + private static final MethodDescriptor + completeQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.CompletionService/CompleteQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CompleteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CompleteQueryResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importCompletionDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.CompletionService/ImportCompletionData") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportCompletionDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable completeQueryCallable; + private final UnaryCallable importCompletionDataCallable; + private final OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCompletionServiceStub create(CompletionServiceStubSettings settings) + throws IOException { + return new GrpcCompletionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCompletionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCompletionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCompletionServiceStub( + CompletionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, 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 GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCompletionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCompletionServiceStub, 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 GrpcCompletionServiceStub( + CompletionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings completeQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(completeQueryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("catalog", String.valueOf(request.getCatalog())); + return params.build(); + }) + .build(); + GrpcCallSettings importCompletionDataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importCompletionDataMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.completeQueryCallable = + callableFactory.createUnaryCallable( + completeQueryTransportSettings, settings.completeQuerySettings(), clientContext); + this.importCompletionDataCallable = + callableFactory.createUnaryCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataSettings(), + clientContext); + this.importCompletionDataOperationCallable = + callableFactory.createOperationCallable( + importCompletionDataTransportSettings, + settings.importCompletionDataOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable completeQueryCallable() { + return completeQueryCallable; + } + + @Override + public UnaryCallable importCompletionDataCallable() { + return importCompletionDataCallable; + } + + @Override + public OperationCallable< + ImportCompletionDataRequest, ImportCompletionDataResponse, ImportMetadata> + importCompletionDataOperationCallable() { + return importCompletionDataOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceCallableFactory.java new file mode 100644 index 00000000..22fb13e2 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceCallableFactory.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 ControlService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcControlServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceStub.java new file mode 100644 index 00000000..0810c309 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcControlServiceStub.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.stub; + +import static com.google.cloud.retail.v2beta.ControlServiceClient.ListControlsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.Control; +import com.google.cloud.retail.v2beta.CreateControlRequest; +import com.google.cloud.retail.v2beta.DeleteControlRequest; +import com.google.cloud.retail.v2beta.GetControlRequest; +import com.google.cloud.retail.v2beta.ListControlsRequest; +import com.google.cloud.retail.v2beta.ListControlsResponse; +import com.google.cloud.retail.v2beta.UpdateControlRequest; +import com.google.common.collect.ImmutableMap; +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 ControlService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcControlServiceStub extends ControlServiceStub { + private static final MethodDescriptor + createControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ControlService/CreateControl") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ControlService/DeleteControl") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ControlService/UpdateControl") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ControlService/GetControl") + .setRequestMarshaller(ProtoUtils.marshaller(GetControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Control.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listControlsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ControlService/ListControls") + .setRequestMarshaller(ProtoUtils.marshaller(ListControlsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListControlsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createControlCallable; + private final UnaryCallable deleteControlCallable; + private final UnaryCallable updateControlCallable; + private final UnaryCallable getControlCallable; + private final UnaryCallable listControlsCallable; + private final UnaryCallable + listControlsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcControlServiceStub create(ControlServiceStubSettings settings) + throws IOException { + return new GrpcControlServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcControlServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcControlServiceStub( + ControlServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcControlServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcControlServiceStub( + ControlServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcControlServiceStub, 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 GrpcControlServiceStub(ControlServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcControlServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcControlServiceStub, 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 GrpcControlServiceStub( + ControlServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("control.name", String.valueOf(request.getControl().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listControlsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listControlsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createControlCallable = + callableFactory.createUnaryCallable( + createControlTransportSettings, settings.createControlSettings(), clientContext); + this.deleteControlCallable = + callableFactory.createUnaryCallable( + deleteControlTransportSettings, settings.deleteControlSettings(), clientContext); + this.updateControlCallable = + callableFactory.createUnaryCallable( + updateControlTransportSettings, settings.updateControlSettings(), clientContext); + this.getControlCallable = + callableFactory.createUnaryCallable( + getControlTransportSettings, settings.getControlSettings(), clientContext); + this.listControlsCallable = + callableFactory.createUnaryCallable( + listControlsTransportSettings, settings.listControlsSettings(), clientContext); + this.listControlsPagedCallable = + callableFactory.createPagedCallable( + listControlsTransportSettings, settings.listControlsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createControlCallable() { + return createControlCallable; + } + + @Override + public UnaryCallable deleteControlCallable() { + return deleteControlCallable; + } + + @Override + public UnaryCallable updateControlCallable() { + return updateControlCallable; + } + + @Override + public UnaryCallable getControlCallable() { + return getControlCallable; + } + + @Override + public UnaryCallable listControlsCallable() { + return listControlsCallable; + } + + @Override + public UnaryCallable listControlsPagedCallable() { + return listControlsPagedCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 00000000..f9aedff6 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceCallableFactory.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 PredictionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceStub.java new file mode 100644 index 00000000..49bee487 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,162 @@ +/* + * 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.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.UnaryCallable; +import com.google.cloud.retail.v2beta.PredictRequest; +import com.google.cloud.retail.v2beta.PredictResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceStub extends PredictionServiceStub { + private static final MethodDescriptor predictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.PredictionService/Predict") + .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable predictCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new GrpcPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings predictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("placement", String.valueOf(request.getPlacement())); + return params.build(); + }) + .build(); + + this.predictCallable = + callableFactory.createUnaryCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable predictCallable() { + return predictCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceCallableFactory.java new file mode 100644 index 00000000..28205e84 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceCallableFactory.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 ProductService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcProductServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceStub.java new file mode 100644 index 00000000..b7a6d400 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcProductServiceStub.java @@ -0,0 +1,601 @@ +/* + * 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.ProductServiceClient.ListProductsPagedResponse; + +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.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.CreateProductRequest; +import com.google.cloud.retail.v2beta.DeleteProductRequest; +import com.google.cloud.retail.v2beta.GetProductRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportProductsRequest; +import com.google.cloud.retail.v2beta.ImportProductsResponse; +import com.google.cloud.retail.v2beta.ListProductsRequest; +import com.google.cloud.retail.v2beta.ListProductsResponse; +import com.google.cloud.retail.v2beta.Product; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.SetInventoryMetadata; +import com.google.cloud.retail.v2beta.SetInventoryRequest; +import com.google.cloud.retail.v2beta.SetInventoryResponse; +import com.google.cloud.retail.v2beta.UpdateProductRequest; +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 ProductService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcProductServiceStub extends ProductServiceStub { + private static final MethodDescriptor + createProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/CreateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/GetProduct") + .setRequestMarshaller(ProtoUtils.marshaller(GetProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/ListProducts") + .setRequestMarshaller(ProtoUtils.marshaller(ListProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProductsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/UpdateProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/DeleteProduct") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/ImportProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportProductsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + setInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/SetInventory") + .setRequestMarshaller(ProtoUtils.marshaller(SetInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/AddFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(AddFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeFulfillmentPlacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.ProductService/RemoveFulfillmentPlaces") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveFulfillmentPlacesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addLocalInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/AddLocalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(AddLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeLocalInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ProductService/RemoveLocalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable createProductCallable; + private final UnaryCallable getProductCallable; + private final UnaryCallable listProductsCallable; + private final UnaryCallable + listProductsPagedCallable; + private final UnaryCallable updateProductCallable; + private final UnaryCallable deleteProductCallable; + private final UnaryCallable importProductsCallable; + private final OperationCallable + importProductsOperationCallable; + private final UnaryCallable setInventoryCallable; + private final OperationCallable + setInventoryOperationCallable; + private final UnaryCallable addFulfillmentPlacesCallable; + private final OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable; + private final UnaryCallable + removeFulfillmentPlacesCallable; + private final OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable; + private final UnaryCallable addLocalInventoriesCallable; + private final OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable; + private final UnaryCallable + removeLocalInventoriesCallable; + private final OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcProductServiceStub create(ProductServiceStubSettings settings) + throws IOException { + return new GrpcProductServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcProductServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcProductServiceStub( + ProductServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcProductServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcProductServiceStub( + ProductServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcProductServiceStub, 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 GrpcProductServiceStub(ProductServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcProductServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcProductServiceStub, 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 GrpcProductServiceStub( + ProductServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProductsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product.name", String.valueOf(request.getProduct().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProductMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings importProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importProductsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings setInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("inventory.name", String.valueOf(request.getInventory().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings addFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeFulfillmentPlacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeFulfillmentPlacesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings addLocalInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addLocalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + GrpcCallSettings + removeLocalInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeLocalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("product", String.valueOf(request.getProduct())); + return params.build(); + }) + .build(); + + this.createProductCallable = + callableFactory.createUnaryCallable( + createProductTransportSettings, settings.createProductSettings(), clientContext); + this.getProductCallable = + callableFactory.createUnaryCallable( + getProductTransportSettings, settings.getProductSettings(), clientContext); + this.listProductsCallable = + callableFactory.createUnaryCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.listProductsPagedCallable = + callableFactory.createPagedCallable( + listProductsTransportSettings, settings.listProductsSettings(), clientContext); + this.updateProductCallable = + callableFactory.createUnaryCallable( + updateProductTransportSettings, settings.updateProductSettings(), clientContext); + this.deleteProductCallable = + callableFactory.createUnaryCallable( + deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); + this.importProductsCallable = + callableFactory.createUnaryCallable( + importProductsTransportSettings, settings.importProductsSettings(), clientContext); + this.importProductsOperationCallable = + callableFactory.createOperationCallable( + importProductsTransportSettings, + settings.importProductsOperationSettings(), + clientContext, + operationsStub); + this.setInventoryCallable = + callableFactory.createUnaryCallable( + setInventoryTransportSettings, settings.setInventorySettings(), clientContext); + this.setInventoryOperationCallable = + callableFactory.createOperationCallable( + setInventoryTransportSettings, + settings.setInventoryOperationSettings(), + clientContext, + operationsStub); + this.addFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesSettings(), + clientContext); + this.addFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + addFulfillmentPlacesTransportSettings, + settings.addFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); + this.removeFulfillmentPlacesCallable = + callableFactory.createUnaryCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesSettings(), + clientContext); + this.removeFulfillmentPlacesOperationCallable = + callableFactory.createOperationCallable( + removeFulfillmentPlacesTransportSettings, + settings.removeFulfillmentPlacesOperationSettings(), + clientContext, + operationsStub); + this.addLocalInventoriesCallable = + callableFactory.createUnaryCallable( + addLocalInventoriesTransportSettings, + settings.addLocalInventoriesSettings(), + clientContext); + this.addLocalInventoriesOperationCallable = + callableFactory.createOperationCallable( + addLocalInventoriesTransportSettings, + settings.addLocalInventoriesOperationSettings(), + clientContext, + operationsStub); + this.removeLocalInventoriesCallable = + callableFactory.createUnaryCallable( + removeLocalInventoriesTransportSettings, + settings.removeLocalInventoriesSettings(), + clientContext); + this.removeLocalInventoriesOperationCallable = + callableFactory.createOperationCallable( + removeLocalInventoriesTransportSettings, + settings.removeLocalInventoriesOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createProductCallable() { + return createProductCallable; + } + + @Override + public UnaryCallable getProductCallable() { + return getProductCallable; + } + + @Override + public UnaryCallable listProductsCallable() { + return listProductsCallable; + } + + @Override + public UnaryCallable listProductsPagedCallable() { + return listProductsPagedCallable; + } + + @Override + public UnaryCallable updateProductCallable() { + return updateProductCallable; + } + + @Override + public UnaryCallable deleteProductCallable() { + return deleteProductCallable; + } + + @Override + public UnaryCallable importProductsCallable() { + return importProductsCallable; + } + + @Override + public OperationCallable + importProductsOperationCallable() { + return importProductsOperationCallable; + } + + @Override + public UnaryCallable setInventoryCallable() { + return setInventoryCallable; + } + + @Override + public OperationCallable + setInventoryOperationCallable() { + return setInventoryOperationCallable; + } + + @Override + public UnaryCallable addFulfillmentPlacesCallable() { + return addFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + return addFulfillmentPlacesOperationCallable; + } + + @Override + public UnaryCallable + removeFulfillmentPlacesCallable() { + return removeFulfillmentPlacesCallable; + } + + @Override + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + return removeFulfillmentPlacesOperationCallable; + } + + @Override + public UnaryCallable addLocalInventoriesCallable() { + return addLocalInventoriesCallable; + } + + @Override + public OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + return addLocalInventoriesOperationCallable; + } + + @Override + public UnaryCallable removeLocalInventoriesCallable() { + return removeLocalInventoriesCallable; + } + + @Override + public OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + return removeLocalInventoriesOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceCallableFactory.java new file mode 100644 index 00000000..05ff39f4 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceCallableFactory.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 SearchService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSearchServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceStub.java new file mode 100644 index 00000000..3bec905b --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcSearchServiceStub.java @@ -0,0 +1,171 @@ +/* + * 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.SearchServiceClient.SearchPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.SearchRequest; +import com.google.cloud.retail.v2beta.SearchResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSearchServiceStub extends SearchServiceStub { + private static final MethodDescriptor searchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.SearchService/Search") + .setRequestMarshaller(ProtoUtils.marshaller(SearchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SearchResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable searchCallable; + private final UnaryCallable searchPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSearchServiceStub create(SearchServiceStubSettings settings) + throws IOException { + return new GrpcSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSearchServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcSearchServiceStub(SearchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSearchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSearchServiceStub( + SearchServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, 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 GrpcSearchServiceStub(SearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSearchServiceStub, 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 GrpcSearchServiceStub( + SearchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings searchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("placement", String.valueOf(request.getPlacement())); + return params.build(); + }) + .build(); + + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.searchPagedCallable = + callableFactory.createPagedCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable searchCallable() { + return searchCallable; + } + + @Override + public UnaryCallable searchPagedCallable() { + return searchPagedCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceCallableFactory.java new file mode 100644 index 00000000..daab757c --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceCallableFactory.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 ServingConfigService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcServingConfigServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceStub.java new file mode 100644 index 00000000..6d5b53ab --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcServingConfigServiceStub.java @@ -0,0 +1,382 @@ +/* + * 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.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.AddControlRequest; +import com.google.cloud.retail.v2beta.CreateServingConfigRequest; +import com.google.cloud.retail.v2beta.DeleteServingConfigRequest; +import com.google.cloud.retail.v2beta.GetServingConfigRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsResponse; +import com.google.cloud.retail.v2beta.RemoveControlRequest; +import com.google.cloud.retail.v2beta.ServingConfig; +import com.google.cloud.retail.v2beta.UpdateServingConfigRequest; +import com.google.common.collect.ImmutableMap; +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 ServingConfigService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcServingConfigServiceStub extends ServingConfigServiceStub { + private static final MethodDescriptor + createServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.ServingConfigService/CreateServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.ServingConfigService/DeleteServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.ServingConfigService/UpdateServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getServingConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ServingConfigService/GetServingConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetServingConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listServingConfigsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.ServingConfigService/ListServingConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListServingConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServingConfigsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + addControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ServingConfigService/AddControl") + .setRequestMarshaller(ProtoUtils.marshaller(AddControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + removeControlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ServingConfigService/RemoveControl") + .setRequestMarshaller( + ProtoUtils.marshaller(RemoveControlRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServingConfig.getDefaultInstance())) + .build(); + + private final UnaryCallable + createServingConfigCallable; + private final UnaryCallable deleteServingConfigCallable; + private final UnaryCallable + updateServingConfigCallable; + private final UnaryCallable getServingConfigCallable; + private final UnaryCallable + listServingConfigsCallable; + private final UnaryCallable + listServingConfigsPagedCallable; + private final UnaryCallable addControlCallable; + private final UnaryCallable removeControlCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcServingConfigServiceStub create(ServingConfigServiceStubSettings settings) + throws IOException { + return new GrpcServingConfigServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcServingConfigServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcServingConfigServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcServingConfigServiceStub, 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 GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcServingConfigServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcServingConfigServiceStub, 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 GrpcServingConfigServiceStub( + ServingConfigServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "serving_config.name", + String.valueOf(request.getServingConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getServingConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServingConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listServingConfigsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listServingConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings addControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("serving_config", String.valueOf(request.getServingConfig())); + return params.build(); + }) + .build(); + GrpcCallSettings removeControlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(removeControlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("serving_config", String.valueOf(request.getServingConfig())); + return params.build(); + }) + .build(); + + this.createServingConfigCallable = + callableFactory.createUnaryCallable( + createServingConfigTransportSettings, + settings.createServingConfigSettings(), + clientContext); + this.deleteServingConfigCallable = + callableFactory.createUnaryCallable( + deleteServingConfigTransportSettings, + settings.deleteServingConfigSettings(), + clientContext); + this.updateServingConfigCallable = + callableFactory.createUnaryCallable( + updateServingConfigTransportSettings, + settings.updateServingConfigSettings(), + clientContext); + this.getServingConfigCallable = + callableFactory.createUnaryCallable( + getServingConfigTransportSettings, settings.getServingConfigSettings(), clientContext); + this.listServingConfigsCallable = + callableFactory.createUnaryCallable( + listServingConfigsTransportSettings, + settings.listServingConfigsSettings(), + clientContext); + this.listServingConfigsPagedCallable = + callableFactory.createPagedCallable( + listServingConfigsTransportSettings, + settings.listServingConfigsSettings(), + clientContext); + this.addControlCallable = + callableFactory.createUnaryCallable( + addControlTransportSettings, settings.addControlSettings(), clientContext); + this.removeControlCallable = + callableFactory.createUnaryCallable( + removeControlTransportSettings, settings.removeControlSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createServingConfigCallable() { + return createServingConfigCallable; + } + + @Override + public UnaryCallable deleteServingConfigCallable() { + return deleteServingConfigCallable; + } + + @Override + public UnaryCallable updateServingConfigCallable() { + return updateServingConfigCallable; + } + + @Override + public UnaryCallable getServingConfigCallable() { + return getServingConfigCallable; + } + + @Override + public UnaryCallable + listServingConfigsCallable() { + return listServingConfigsCallable; + } + + @Override + public UnaryCallable + listServingConfigsPagedCallable() { + return listServingConfigsPagedCallable; + } + + @Override + public UnaryCallable addControlCallable() { + return addControlCallable; + } + + @Override + public UnaryCallable removeControlCallable() { + return removeControlCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceCallableFactory.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceCallableFactory.java new file mode 100644 index 00000000..293a8e07 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceCallableFactory.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 UserEventService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcUserEventServiceCallableFactory 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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceStub.java new file mode 100644 index 00000000..96288e5c --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcUserEventServiceStub.java @@ -0,0 +1,337 @@ +/* + * 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.HttpBody; +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.CollectUserEventRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportUserEventsRequest; +import com.google.cloud.retail.v2beta.ImportUserEventsResponse; +import com.google.cloud.retail.v2beta.PurgeMetadata; +import com.google.cloud.retail.v2beta.PurgeUserEventsRequest; +import com.google.cloud.retail.v2beta.PurgeUserEventsResponse; +import com.google.cloud.retail.v2beta.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2beta.RejoinUserEventsRequest; +import com.google.cloud.retail.v2beta.RejoinUserEventsResponse; +import com.google.cloud.retail.v2beta.UserEvent; +import com.google.cloud.retail.v2beta.WriteUserEventRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the UserEventService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcUserEventServiceStub extends UserEventServiceStub { + private static final MethodDescriptor + writeUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.UserEventService/WriteUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(WriteUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(UserEvent.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + collectUserEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.UserEventService/CollectUserEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(CollectUserEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + purgeUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.UserEventService/PurgeUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.UserEventService/ImportUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + rejoinUserEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.UserEventService/RejoinUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(RejoinUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable writeUserEventCallable; + private final UnaryCallable collectUserEventCallable; + private final UnaryCallable purgeUserEventsCallable; + private final OperationCallable + purgeUserEventsOperationCallable; + private final UnaryCallable importUserEventsCallable; + private final OperationCallable + importUserEventsOperationCallable; + private final UnaryCallable rejoinUserEventsCallable; + private final OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcUserEventServiceStub create(UserEventServiceStubSettings settings) + throws IOException { + return new GrpcUserEventServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcUserEventServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcUserEventServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcUserEventServiceStub( + UserEventServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcUserEventServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcUserEventServiceStub, 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 GrpcUserEventServiceStub( + UserEventServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings writeUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeUserEventMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings collectUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectUserEventMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings purgeUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings importUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings rejoinUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rejoinUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.writeUserEventCallable = + callableFactory.createUnaryCallable( + writeUserEventTransportSettings, settings.writeUserEventSettings(), clientContext); + this.collectUserEventCallable = + callableFactory.createUnaryCallable( + collectUserEventTransportSettings, settings.collectUserEventSettings(), clientContext); + this.purgeUserEventsCallable = + callableFactory.createUnaryCallable( + purgeUserEventsTransportSettings, settings.purgeUserEventsSettings(), clientContext); + this.purgeUserEventsOperationCallable = + callableFactory.createOperationCallable( + purgeUserEventsTransportSettings, + settings.purgeUserEventsOperationSettings(), + clientContext, + operationsStub); + this.importUserEventsCallable = + callableFactory.createUnaryCallable( + importUserEventsTransportSettings, settings.importUserEventsSettings(), clientContext); + this.importUserEventsOperationCallable = + callableFactory.createOperationCallable( + importUserEventsTransportSettings, + settings.importUserEventsOperationSettings(), + clientContext, + operationsStub); + this.rejoinUserEventsCallable = + callableFactory.createUnaryCallable( + rejoinUserEventsTransportSettings, settings.rejoinUserEventsSettings(), clientContext); + this.rejoinUserEventsOperationCallable = + callableFactory.createOperationCallable( + rejoinUserEventsTransportSettings, + settings.rejoinUserEventsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable writeUserEventCallable() { + return writeUserEventCallable; + } + + @Override + public UnaryCallable collectUserEventCallable() { + return collectUserEventCallable; + } + + @Override + public UnaryCallable purgeUserEventsCallable() { + return purgeUserEventsCallable; + } + + @Override + public OperationCallable + purgeUserEventsOperationCallable() { + return purgeUserEventsOperationCallable; + } + + @Override + public UnaryCallable importUserEventsCallable() { + return importUserEventsCallable; + } + + @Override + public OperationCallable + importUserEventsOperationCallable() { + return importUserEventsOperationCallable; + } + + @Override + public UnaryCallable rejoinUserEventsCallable() { + return rejoinUserEventsCallable; + } + + @Override + public OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + return rejoinUserEventsOperationCallable; + } + + @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/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStub.java new file mode 100644 index 00000000..ea130bd9 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStub.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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.PredictRequest; +import com.google.cloud.retail.v2beta.PredictResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class PredictionServiceStub implements BackgroundResource { + + public UnaryCallable predictCallable() { + throw new UnsupportedOperationException("Not implemented: predictCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java new file mode 100644 index 00000000..3af1061b --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java @@ -0,0 +1,279 @@ +/* + * 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.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.PredictRequest; +import com.google.cloud.retail.v2beta.PredictResponse; +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 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 PredictionServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceStubSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder
+ *             .predictSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceStubSettings predictionServiceSettings =
+ *     predictionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class PredictionServiceStubSettings 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 predictSettings; + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return predictSettings; + } + + public PredictionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 PredictionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + predictSettings = settingsBuilder.predictSettings().build(); + } + + /** Builder for PredictionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder predictSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + predictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + initDefaults(this); + } + + protected Builder(PredictionServiceStubSettings settings) { + super(settings); + + predictSettings = settings.predictSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(predictSettings); + } + + 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 initDefaults(Builder builder) { + builder + .predictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 predict. */ + public UnaryCallSettings.Builder predictSettings() { + return predictSettings; + } + + @Override + public PredictionServiceStubSettings build() throws IOException { + return new PredictionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStub.java new file mode 100644 index 00000000..52979a6a --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStub.java @@ -0,0 +1,162 @@ +/* + * 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.ProductServiceClient.ListProductsPagedResponse; + +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.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.CreateProductRequest; +import com.google.cloud.retail.v2beta.DeleteProductRequest; +import com.google.cloud.retail.v2beta.GetProductRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportProductsRequest; +import com.google.cloud.retail.v2beta.ImportProductsResponse; +import com.google.cloud.retail.v2beta.ListProductsRequest; +import com.google.cloud.retail.v2beta.ListProductsResponse; +import com.google.cloud.retail.v2beta.Product; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.SetInventoryMetadata; +import com.google.cloud.retail.v2beta.SetInventoryRequest; +import com.google.cloud.retail.v2beta.SetInventoryResponse; +import com.google.cloud.retail.v2beta.UpdateProductRequest; +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 ProductService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ProductServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createProductCallable() { + throw new UnsupportedOperationException("Not implemented: createProductCallable()"); + } + + public UnaryCallable getProductCallable() { + throw new UnsupportedOperationException("Not implemented: getProductCallable()"); + } + + public UnaryCallable listProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsPagedCallable()"); + } + + public UnaryCallable listProductsCallable() { + throw new UnsupportedOperationException("Not implemented: listProductsCallable()"); + } + + public UnaryCallable updateProductCallable() { + throw new UnsupportedOperationException("Not implemented: updateProductCallable()"); + } + + public UnaryCallable deleteProductCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProductCallable()"); + } + + public OperationCallable + importProductsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importProductsOperationCallable()"); + } + + public UnaryCallable importProductsCallable() { + throw new UnsupportedOperationException("Not implemented: importProductsCallable()"); + } + + public OperationCallable + setInventoryOperationCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryOperationCallable()"); + } + + public UnaryCallable setInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: setInventoryCallable()"); + } + + public OperationCallable< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: addFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable addFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: addFulfillmentPlacesCallable()"); + } + + public OperationCallable< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeFulfillmentPlacesOperationCallable()"); + } + + public UnaryCallable + removeFulfillmentPlacesCallable() { + throw new UnsupportedOperationException("Not implemented: removeFulfillmentPlacesCallable()"); + } + + public OperationCallable< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: addLocalInventoriesOperationCallable()"); + } + + public UnaryCallable addLocalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: addLocalInventoriesCallable()"); + } + + public OperationCallable< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: removeLocalInventoriesOperationCallable()"); + } + + public UnaryCallable removeLocalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: removeLocalInventoriesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java new file mode 100644 index 00000000..2a16e4e8 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java @@ -0,0 +1,952 @@ +/* + * 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.ProductServiceClient.ListProductsPagedResponse; + +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.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.AddFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.AddLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.AddLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.CreateProductRequest; +import com.google.cloud.retail.v2beta.DeleteProductRequest; +import com.google.cloud.retail.v2beta.GetProductRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportProductsRequest; +import com.google.cloud.retail.v2beta.ImportProductsResponse; +import com.google.cloud.retail.v2beta.ListProductsRequest; +import com.google.cloud.retail.v2beta.ListProductsResponse; +import com.google.cloud.retail.v2beta.Product; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest; +import com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest; +import com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse; +import com.google.cloud.retail.v2beta.SetInventoryMetadata; +import com.google.cloud.retail.v2beta.SetInventoryRequest; +import com.google.cloud.retail.v2beta.SetInventoryResponse; +import com.google.cloud.retail.v2beta.UpdateProductRequest; +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 ProductServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ProductServiceStubSettings.Builder productServiceSettingsBuilder =
+ *     ProductServiceStubSettings.newBuilder();
+ * productServiceSettingsBuilder
+ *     .createProductSettings()
+ *     .setRetrySettings(
+ *         productServiceSettingsBuilder
+ *             .createProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProductServiceStubSettings productServiceSettings = productServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ProductServiceStubSettings 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 createProductSettings; + private final UnaryCallSettings getProductSettings; + private final PagedCallSettings< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings updateProductSettings; + private final UnaryCallSettings deleteProductSettings; + private final UnaryCallSettings importProductsSettings; + private final OperationCallSettings + importProductsOperationSettings; + private final UnaryCallSettings setInventorySettings; + private final OperationCallSettings< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings + addFulfillmentPlacesSettings; + private final OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings + removeFulfillmentPlacesSettings; + private final OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; + private final UnaryCallSettings + addLocalInventoriesSettings; + private final OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings; + private final UnaryCallSettings + removeLocalInventoriesSettings; + private final OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings; + + private static final PagedListDescriptor + LIST_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProductsRequest injectToken(ListProductsRequest payload, String token) { + return ListProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProductsRequest injectPageSize(ListProductsRequest payload, int pageSize) { + return ListProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProductsResponse payload) { + return payload.getProductsList() == null + ? ImmutableList.of() + : payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + LIST_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PRODUCTS_PAGE_STR_DESC, request, context); + return ListProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createProduct. */ + public UnaryCallSettings createProductSettings() { + return createProductSettings; + } + + /** Returns the object with the settings used for calls to getProduct. */ + public UnaryCallSettings getProductSettings() { + return getProductSettings; + } + + /** Returns the object with the settings used for calls to listProducts. */ + public PagedCallSettings + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the object with the settings used for calls to updateProduct. */ + public UnaryCallSettings updateProductSettings() { + return updateProductSettings; + } + + /** Returns the object with the settings used for calls to deleteProduct. */ + public UnaryCallSettings deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the object with the settings used for calls to importProducts. */ + public UnaryCallSettings importProductsSettings() { + return importProductsSettings; + } + + /** Returns the object with the settings used for calls to importProducts. */ + public OperationCallSettings + importProductsOperationSettings() { + return importProductsOperationSettings; + } + + /** Returns the object with the settings used for calls to setInventory. */ + public UnaryCallSettings setInventorySettings() { + return setInventorySettings; + } + + /** Returns the object with the settings used for calls to setInventory. */ + public OperationCallSettings + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to addFulfillmentPlaces. */ + public OperationCallSettings< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the object with the settings used for calls to removeFulfillmentPlaces. */ + public OperationCallSettings< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public UnaryCallSettings addLocalInventoriesSettings() { + return addLocalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to addLocalInventories. */ + public OperationCallSettings< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return addLocalInventoriesOperationSettings; + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings + removeLocalInventoriesSettings() { + return removeLocalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to removeLocalInventories. */ + public OperationCallSettings< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return removeLocalInventoriesOperationSettings; + } + + public ProductServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcProductServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ProductServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ProductServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createProductSettings = settingsBuilder.createProductSettings().build(); + getProductSettings = settingsBuilder.getProductSettings().build(); + listProductsSettings = settingsBuilder.listProductsSettings().build(); + updateProductSettings = settingsBuilder.updateProductSettings().build(); + deleteProductSettings = settingsBuilder.deleteProductSettings().build(); + importProductsSettings = settingsBuilder.importProductsSettings().build(); + importProductsOperationSettings = settingsBuilder.importProductsOperationSettings().build(); + setInventorySettings = settingsBuilder.setInventorySettings().build(); + setInventoryOperationSettings = settingsBuilder.setInventoryOperationSettings().build(); + addFulfillmentPlacesSettings = settingsBuilder.addFulfillmentPlacesSettings().build(); + addFulfillmentPlacesOperationSettings = + settingsBuilder.addFulfillmentPlacesOperationSettings().build(); + removeFulfillmentPlacesSettings = settingsBuilder.removeFulfillmentPlacesSettings().build(); + removeFulfillmentPlacesOperationSettings = + settingsBuilder.removeFulfillmentPlacesOperationSettings().build(); + addLocalInventoriesSettings = settingsBuilder.addLocalInventoriesSettings().build(); + addLocalInventoriesOperationSettings = + settingsBuilder.addLocalInventoriesOperationSettings().build(); + removeLocalInventoriesSettings = settingsBuilder.removeLocalInventoriesSettings().build(); + removeLocalInventoriesOperationSettings = + settingsBuilder.removeLocalInventoriesOperationSettings().build(); + } + + /** Builder for ProductServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createProductSettings; + private final UnaryCallSettings.Builder getProductSettings; + private final PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings; + private final UnaryCallSettings.Builder updateProductSettings; + private final UnaryCallSettings.Builder deleteProductSettings; + private final UnaryCallSettings.Builder + importProductsSettings; + private final OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings; + private final UnaryCallSettings.Builder setInventorySettings; + private final OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings; + private final UnaryCallSettings.Builder + addFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings; + private final UnaryCallSettings.Builder + removeFulfillmentPlacesSettings; + private final OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings; + private final UnaryCallSettings.Builder + addLocalInventoriesSettings; + private final OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings; + private final UnaryCallSettings.Builder + removeLocalInventoriesSettings; + private final OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(300000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT); + updateProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importProductsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importProductsOperationSettings = OperationCallSettings.newBuilder(); + setInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setInventoryOperationSettings = OperationCallSettings.newBuilder(); + addFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); + removeFulfillmentPlacesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeFulfillmentPlacesOperationSettings = OperationCallSettings.newBuilder(); + addLocalInventoriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addLocalInventoriesOperationSettings = OperationCallSettings.newBuilder(); + removeLocalInventoriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeLocalInventoriesOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSettings, + getProductSettings, + listProductsSettings, + updateProductSettings, + deleteProductSettings, + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings, + addLocalInventoriesSettings, + removeLocalInventoriesSettings); + initDefaults(this); + } + + protected Builder(ProductServiceStubSettings settings) { + super(settings); + + createProductSettings = settings.createProductSettings.toBuilder(); + getProductSettings = settings.getProductSettings.toBuilder(); + listProductsSettings = settings.listProductsSettings.toBuilder(); + updateProductSettings = settings.updateProductSettings.toBuilder(); + deleteProductSettings = settings.deleteProductSettings.toBuilder(); + importProductsSettings = settings.importProductsSettings.toBuilder(); + importProductsOperationSettings = settings.importProductsOperationSettings.toBuilder(); + setInventorySettings = settings.setInventorySettings.toBuilder(); + setInventoryOperationSettings = settings.setInventoryOperationSettings.toBuilder(); + addFulfillmentPlacesSettings = settings.addFulfillmentPlacesSettings.toBuilder(); + addFulfillmentPlacesOperationSettings = + settings.addFulfillmentPlacesOperationSettings.toBuilder(); + removeFulfillmentPlacesSettings = settings.removeFulfillmentPlacesSettings.toBuilder(); + removeFulfillmentPlacesOperationSettings = + settings.removeFulfillmentPlacesOperationSettings.toBuilder(); + addLocalInventoriesSettings = settings.addLocalInventoriesSettings.toBuilder(); + addLocalInventoriesOperationSettings = + settings.addLocalInventoriesOperationSettings.toBuilder(); + removeLocalInventoriesSettings = settings.removeLocalInventoriesSettings.toBuilder(); + removeLocalInventoriesOperationSettings = + settings.removeLocalInventoriesOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createProductSettings, + getProductSettings, + listProductsSettings, + updateProductSettings, + deleteProductSettings, + importProductsSettings, + setInventorySettings, + addFulfillmentPlacesSettings, + removeFulfillmentPlacesSettings, + addLocalInventoriesSettings, + removeLocalInventoriesSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importProductsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .setInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .addFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .removeFulfillmentPlacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .addLocalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .removeLocalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importProductsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportProductsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 + .setInventoryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SetInventoryResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SetInventoryMetadata.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 + .addFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AddFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AddFulfillmentPlacesMetadata.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 + .removeFulfillmentPlacesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RemoveFulfillmentPlacesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + RemoveFulfillmentPlacesMetadata.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 + .addLocalInventoriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + AddLocalInventoriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AddLocalInventoriesMetadata.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 + .removeLocalInventoriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RemoveLocalInventoriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + RemoveLocalInventoriesMetadata.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 createProduct. */ + public UnaryCallSettings.Builder createProductSettings() { + return createProductSettings; + } + + /** Returns the builder for the settings used for calls to getProduct. */ + public UnaryCallSettings.Builder getProductSettings() { + return getProductSettings; + } + + /** Returns the builder for the settings used for calls to listProducts. */ + public PagedCallSettings.Builder< + ListProductsRequest, ListProductsResponse, ListProductsPagedResponse> + listProductsSettings() { + return listProductsSettings; + } + + /** Returns the builder for the settings used for calls to updateProduct. */ + public UnaryCallSettings.Builder updateProductSettings() { + return updateProductSettings; + } + + /** Returns the builder for the settings used for calls to deleteProduct. */ + public UnaryCallSettings.Builder deleteProductSettings() { + return deleteProductSettings; + } + + /** Returns the builder for the settings used for calls to importProducts. */ + public UnaryCallSettings.Builder importProductsSettings() { + return importProductsSettings; + } + + /** Returns the builder for the settings used for calls to importProducts. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportProductsRequest, ImportProductsResponse, ImportMetadata> + importProductsOperationSettings() { + return importProductsOperationSettings; + } + + /** Returns the builder for the settings used for calls to setInventory. */ + public UnaryCallSettings.Builder setInventorySettings() { + return setInventorySettings; + } + + /** Returns the builder for the settings used for calls to setInventory. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> + setInventoryOperationSettings() { + return setInventoryOperationSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + public UnaryCallSettings.Builder + addFulfillmentPlacesSettings() { + return addFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to addFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> + addFulfillmentPlacesOperationSettings() { + return addFulfillmentPlacesOperationSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + public UnaryCallSettings.Builder + removeFulfillmentPlacesSettings() { + return removeFulfillmentPlacesSettings; + } + + /** Returns the builder for the settings used for calls to removeFulfillmentPlaces. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemoveFulfillmentPlacesRequest, + RemoveFulfillmentPlacesResponse, + RemoveFulfillmentPlacesMetadata> + removeFulfillmentPlacesOperationSettings() { + return removeFulfillmentPlacesOperationSettings; + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + public UnaryCallSettings.Builder + addLocalInventoriesSettings() { + return addLocalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to addLocalInventories. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> + addLocalInventoriesOperationSettings() { + return addLocalInventoriesOperationSettings; + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + public UnaryCallSettings.Builder + removeLocalInventoriesSettings() { + return removeLocalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to removeLocalInventories. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RemoveLocalInventoriesRequest, + RemoveLocalInventoriesResponse, + RemoveLocalInventoriesMetadata> + removeLocalInventoriesOperationSettings() { + return removeLocalInventoriesOperationSettings; + } + + @Override + public ProductServiceStubSettings build() throws IOException { + return new ProductServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStub.java new file mode 100644 index 00000000..a590a019 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStub.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.stub; + +import static com.google.cloud.retail.v2beta.SearchServiceClient.SearchPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.SearchRequest; +import com.google.cloud.retail.v2beta.SearchResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SearchServiceStub implements BackgroundResource { + + public UnaryCallable searchPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchPagedCallable()"); + } + + public UnaryCallable searchCallable() { + throw new UnsupportedOperationException("Not implemented: searchCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java new file mode 100644 index 00000000..5f1296a4 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java @@ -0,0 +1,342 @@ +/* + * 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.SearchServiceClient.SearchPagedResponse; + +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.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.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.SearchRequest; +import com.google.cloud.retail.v2beta.SearchResponse; +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 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 SearchServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * SearchServiceStubSettings.Builder searchServiceSettingsBuilder =
+ *     SearchServiceStubSettings.newBuilder();
+ * searchServiceSettingsBuilder
+ *     .searchSettings()
+ *     .setRetrySettings(
+ *         searchServiceSettingsBuilder
+ *             .searchSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SearchServiceStubSettings searchServiceSettings = searchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SearchServiceStubSettings 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 PagedCallSettings + searchSettings; + + private static final PagedListDescriptor< + SearchRequest, SearchResponse, SearchResponse.SearchResult> + SEARCH_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchRequest injectToken(SearchRequest payload, String token) { + return SearchRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchRequest injectPageSize(SearchRequest payload, int pageSize) { + return SearchRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchResponse payload) { + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); + } + }; + + private static final PagedListResponseFactory + SEARCH_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_PAGE_STR_DESC, request, context); + return SearchPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to search. */ + public PagedCallSettings searchSettings() { + return searchSettings; + } + + public SearchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSearchServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 SearchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + searchSettings = settingsBuilder.searchSettings().build(); + } + + /** Builder for SearchServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder + searchSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + searchSettings = PagedCallSettings.newBuilder(SEARCH_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + initDefaults(this); + } + + protected Builder(SearchServiceStubSettings settings) { + super(settings); + + searchSettings = settings.searchSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(searchSettings); + } + + 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 initDefaults(Builder builder) { + builder + .searchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + 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 search. */ + public PagedCallSettings.Builder + searchSettings() { + return searchSettings; + } + + @Override + public SearchServiceStubSettings build() throws IOException { + return new SearchServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStub.java new file mode 100644 index 00000000..9bd9c2d5 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStub.java @@ -0,0 +1,82 @@ +/* + * 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.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.AddControlRequest; +import com.google.cloud.retail.v2beta.CreateServingConfigRequest; +import com.google.cloud.retail.v2beta.DeleteServingConfigRequest; +import com.google.cloud.retail.v2beta.GetServingConfigRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsResponse; +import com.google.cloud.retail.v2beta.RemoveControlRequest; +import com.google.cloud.retail.v2beta.ServingConfig; +import com.google.cloud.retail.v2beta.UpdateServingConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ServingConfigService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ServingConfigServiceStub implements BackgroundResource { + + public UnaryCallable createServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createServingConfigCallable()"); + } + + public UnaryCallable deleteServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteServingConfigCallable()"); + } + + public UnaryCallable updateServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateServingConfigCallable()"); + } + + public UnaryCallable getServingConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getServingConfigCallable()"); + } + + public UnaryCallable + listServingConfigsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listServingConfigsPagedCallable()"); + } + + public UnaryCallable + listServingConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listServingConfigsCallable()"); + } + + public UnaryCallable addControlCallable() { + throw new UnsupportedOperationException("Not implemented: addControlCallable()"); + } + + public UnaryCallable removeControlCallable() { + throw new UnsupportedOperationException("Not implemented: removeControlCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java new file mode 100644 index 00000000..8b39f4b4 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java @@ -0,0 +1,500 @@ +/* + * 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.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.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.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.AddControlRequest; +import com.google.cloud.retail.v2beta.CreateServingConfigRequest; +import com.google.cloud.retail.v2beta.DeleteServingConfigRequest; +import com.google.cloud.retail.v2beta.GetServingConfigRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsRequest; +import com.google.cloud.retail.v2beta.ListServingConfigsResponse; +import com.google.cloud.retail.v2beta.RemoveControlRequest; +import com.google.cloud.retail.v2beta.ServingConfig; +import com.google.cloud.retail.v2beta.UpdateServingConfigRequest; +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.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 ServingConfigServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ServingConfigServiceStubSettings.Builder servingConfigServiceSettingsBuilder =
+ *     ServingConfigServiceStubSettings.newBuilder();
+ * servingConfigServiceSettingsBuilder
+ *     .createServingConfigSettings()
+ *     .setRetrySettings(
+ *         servingConfigServiceSettingsBuilder
+ *             .createServingConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServingConfigServiceStubSettings servingConfigServiceSettings =
+ *     servingConfigServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ServingConfigServiceStubSettings + 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 + createServingConfigSettings; + private final UnaryCallSettings deleteServingConfigSettings; + private final UnaryCallSettings + updateServingConfigSettings; + private final UnaryCallSettings getServingConfigSettings; + private final PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings; + private final UnaryCallSettings addControlSettings; + private final UnaryCallSettings removeControlSettings; + + private static final PagedListDescriptor< + ListServingConfigsRequest, ListServingConfigsResponse, ServingConfig> + LIST_SERVING_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListServingConfigsRequest, ListServingConfigsResponse, ServingConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServingConfigsRequest injectToken( + ListServingConfigsRequest payload, String token) { + return ListServingConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListServingConfigsRequest injectPageSize( + ListServingConfigsRequest payload, int pageSize) { + return ListServingConfigsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListServingConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServingConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListServingConfigsResponse payload) { + return payload.getServingConfigsList() == null + ? ImmutableList.of() + : payload.getServingConfigsList(); + } + }; + + private static final PagedListResponseFactory< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + LIST_SERVING_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServingConfigsRequest, + ListServingConfigsResponse, + ListServingConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListServingConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SERVING_CONFIGS_PAGE_STR_DESC, request, context); + return ListServingConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createServingConfig. */ + public UnaryCallSettings + createServingConfigSettings() { + return createServingConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings deleteServingConfigSettings() { + return deleteServingConfigSettings; + } + + /** Returns the object with the settings used for calls to updateServingConfig. */ + public UnaryCallSettings + updateServingConfigSettings() { + return updateServingConfigSettings; + } + + /** Returns the object with the settings used for calls to getServingConfig. */ + public UnaryCallSettings getServingConfigSettings() { + return getServingConfigSettings; + } + + /** Returns the object with the settings used for calls to listServingConfigs. */ + public PagedCallSettings< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return listServingConfigsSettings; + } + + /** Returns the object with the settings used for calls to addControl. */ + public UnaryCallSettings addControlSettings() { + return addControlSettings; + } + + /** Returns the object with the settings used for calls to removeControl. */ + public UnaryCallSettings removeControlSettings() { + return removeControlSettings; + } + + public ServingConfigServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcServingConfigServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ServingConfigServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 ServingConfigServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createServingConfigSettings = settingsBuilder.createServingConfigSettings().build(); + deleteServingConfigSettings = settingsBuilder.deleteServingConfigSettings().build(); + updateServingConfigSettings = settingsBuilder.updateServingConfigSettings().build(); + getServingConfigSettings = settingsBuilder.getServingConfigSettings().build(); + listServingConfigsSettings = settingsBuilder.listServingConfigsSettings().build(); + addControlSettings = settingsBuilder.addControlSettings().build(); + removeControlSettings = settingsBuilder.removeControlSettings().build(); + } + + /** Builder for ServingConfigServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createServingConfigSettings; + private final UnaryCallSettings.Builder + deleteServingConfigSettings; + private final UnaryCallSettings.Builder + updateServingConfigSettings; + private final UnaryCallSettings.Builder + getServingConfigSettings; + private final PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings; + private final UnaryCallSettings.Builder addControlSettings; + private final UnaryCallSettings.Builder + removeControlSettings; + 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); + + createServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getServingConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listServingConfigsSettings = PagedCallSettings.newBuilder(LIST_SERVING_CONFIGS_PAGE_STR_FACT); + addControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + removeControlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServingConfigSettings, + deleteServingConfigSettings, + updateServingConfigSettings, + getServingConfigSettings, + listServingConfigsSettings, + addControlSettings, + removeControlSettings); + initDefaults(this); + } + + protected Builder(ServingConfigServiceStubSettings settings) { + super(settings); + + createServingConfigSettings = settings.createServingConfigSettings.toBuilder(); + deleteServingConfigSettings = settings.deleteServingConfigSettings.toBuilder(); + updateServingConfigSettings = settings.updateServingConfigSettings.toBuilder(); + getServingConfigSettings = settings.getServingConfigSettings.toBuilder(); + listServingConfigsSettings = settings.listServingConfigsSettings.toBuilder(); + addControlSettings = settings.addControlSettings.toBuilder(); + removeControlSettings = settings.removeControlSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createServingConfigSettings, + deleteServingConfigSettings, + updateServingConfigSettings, + getServingConfigSettings, + listServingConfigsSettings, + addControlSettings, + removeControlSettings); + } + + 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 initDefaults(Builder builder) { + builder + .createServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getServingConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listServingConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .addControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .removeControlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 createServingConfig. */ + public UnaryCallSettings.Builder + createServingConfigSettings() { + return createServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteServingConfig. */ + public UnaryCallSettings.Builder + deleteServingConfigSettings() { + return deleteServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateServingConfig. */ + public UnaryCallSettings.Builder + updateServingConfigSettings() { + return updateServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to getServingConfig. */ + public UnaryCallSettings.Builder + getServingConfigSettings() { + return getServingConfigSettings; + } + + /** Returns the builder for the settings used for calls to listServingConfigs. */ + public PagedCallSettings.Builder< + ListServingConfigsRequest, ListServingConfigsResponse, ListServingConfigsPagedResponse> + listServingConfigsSettings() { + return listServingConfigsSettings; + } + + /** Returns the builder for the settings used for calls to addControl. */ + public UnaryCallSettings.Builder addControlSettings() { + return addControlSettings; + } + + /** Returns the builder for the settings used for calls to removeControl. */ + public UnaryCallSettings.Builder removeControlSettings() { + return removeControlSettings; + } + + @Override + public ServingConfigServiceStubSettings build() throws IOException { + return new ServingConfigServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStub.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStub.java new file mode 100644 index 00000000..d1661d09 --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStub.java @@ -0,0 +1,92 @@ +/* + * 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.HttpBody; +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.CollectUserEventRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportUserEventsRequest; +import com.google.cloud.retail.v2beta.ImportUserEventsResponse; +import com.google.cloud.retail.v2beta.PurgeMetadata; +import com.google.cloud.retail.v2beta.PurgeUserEventsRequest; +import com.google.cloud.retail.v2beta.PurgeUserEventsResponse; +import com.google.cloud.retail.v2beta.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2beta.RejoinUserEventsRequest; +import com.google.cloud.retail.v2beta.RejoinUserEventsResponse; +import com.google.cloud.retail.v2beta.UserEvent; +import com.google.cloud.retail.v2beta.WriteUserEventRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the UserEventService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class UserEventServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable writeUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: writeUserEventCallable()"); + } + + public UnaryCallable collectUserEventCallable() { + throw new UnsupportedOperationException("Not implemented: collectUserEventCallable()"); + } + + public OperationCallable + purgeUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsOperationCallable()"); + } + + public UnaryCallable purgeUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: purgeUserEventsCallable()"); + } + + public OperationCallable + importUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsOperationCallable()"); + } + + public UnaryCallable importUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsCallable()"); + } + + public OperationCallable< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: rejoinUserEventsOperationCallable()"); + } + + public UnaryCallable rejoinUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: rejoinUserEventsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java new file mode 100644 index 00000000..7fb8a01c --- /dev/null +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java @@ -0,0 +1,568 @@ +/* + * 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.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.CollectUserEventRequest; +import com.google.cloud.retail.v2beta.ImportMetadata; +import com.google.cloud.retail.v2beta.ImportUserEventsRequest; +import com.google.cloud.retail.v2beta.ImportUserEventsResponse; +import com.google.cloud.retail.v2beta.PurgeMetadata; +import com.google.cloud.retail.v2beta.PurgeUserEventsRequest; +import com.google.cloud.retail.v2beta.PurgeUserEventsResponse; +import com.google.cloud.retail.v2beta.RejoinUserEventsMetadata; +import com.google.cloud.retail.v2beta.RejoinUserEventsRequest; +import com.google.cloud.retail.v2beta.RejoinUserEventsResponse; +import com.google.cloud.retail.v2beta.UserEvent; +import com.google.cloud.retail.v2beta.WriteUserEventRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link UserEventServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceStubSettings.Builder userEventServiceSettingsBuilder =
+ *     UserEventServiceStubSettings.newBuilder();
+ * userEventServiceSettingsBuilder
+ *     .writeUserEventSettings()
+ *     .setRetrySettings(
+ *         userEventServiceSettingsBuilder
+ *             .writeUserEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * UserEventServiceStubSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class UserEventServiceStubSettings 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 writeUserEventSettings; + private final UnaryCallSettings collectUserEventSettings; + private final UnaryCallSettings purgeUserEventsSettings; + private final OperationCallSettings< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings importUserEventsSettings; + private final OperationCallSettings< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + private final UnaryCallSettings rejoinUserEventsSettings; + private final OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings; + + /** Returns the object with the settings used for calls to writeUserEvent. */ + public UnaryCallSettings writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the object with the settings used for calls to collectUserEvent. */ + public UnaryCallSettings collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the object with the settings used for calls to purgeUserEvents. */ + public OperationCallSettings + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public UnaryCallSettings importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the object with the settings used for calls to importUserEvents. */ + public OperationCallSettings + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings rejoinUserEventsSettings() { + return rejoinUserEventsSettings; + } + + /** Returns the object with the settings used for calls to rejoinUserEvents. */ + public OperationCallSettings< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return rejoinUserEventsOperationSettings; + } + + public UserEventServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcUserEventServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(UserEventServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 UserEventServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + writeUserEventSettings = settingsBuilder.writeUserEventSettings().build(); + collectUserEventSettings = settingsBuilder.collectUserEventSettings().build(); + purgeUserEventsSettings = settingsBuilder.purgeUserEventsSettings().build(); + purgeUserEventsOperationSettings = settingsBuilder.purgeUserEventsOperationSettings().build(); + importUserEventsSettings = settingsBuilder.importUserEventsSettings().build(); + importUserEventsOperationSettings = settingsBuilder.importUserEventsOperationSettings().build(); + rejoinUserEventsSettings = settingsBuilder.rejoinUserEventsSettings().build(); + rejoinUserEventsOperationSettings = settingsBuilder.rejoinUserEventsOperationSettings().build(); + } + + /** Builder for UserEventServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + writeUserEventSettings; + private final UnaryCallSettings.Builder + collectUserEventSettings; + private final UnaryCallSettings.Builder + purgeUserEventsSettings; + private final OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings.Builder + importUserEventsSettings; + private final OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings; + private final UnaryCallSettings.Builder + rejoinUserEventsSettings; + private final OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(300000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + writeUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + collectUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsOperationSettings = OperationCallSettings.newBuilder(); + importUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importUserEventsOperationSettings = OperationCallSettings.newBuilder(); + rejoinUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rejoinUserEventsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings, + rejoinUserEventsSettings); + initDefaults(this); + } + + protected Builder(UserEventServiceStubSettings settings) { + super(settings); + + writeUserEventSettings = settings.writeUserEventSettings.toBuilder(); + collectUserEventSettings = settings.collectUserEventSettings.toBuilder(); + purgeUserEventsSettings = settings.purgeUserEventsSettings.toBuilder(); + purgeUserEventsOperationSettings = settings.purgeUserEventsOperationSettings.toBuilder(); + importUserEventsSettings = settings.importUserEventsSettings.toBuilder(); + importUserEventsOperationSettings = settings.importUserEventsOperationSettings.toBuilder(); + rejoinUserEventsSettings = settings.rejoinUserEventsSettings.toBuilder(); + rejoinUserEventsOperationSettings = settings.rejoinUserEventsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings, + rejoinUserEventsSettings); + } + + 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 initDefaults(Builder builder) { + builder + .writeUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .collectUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .purgeUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .rejoinUserEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .purgeUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PurgeUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PurgeMetadata.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 + .importUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportMetadata.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 + .rejoinUserEventsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(RejoinUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RejoinUserEventsMetadata.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 writeUserEvent. */ + public UnaryCallSettings.Builder writeUserEventSettings() { + return writeUserEventSettings; + } + + /** Returns the builder for the settings used for calls to collectUserEvent. */ + public UnaryCallSettings.Builder collectUserEventSettings() { + return collectUserEventSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + public UnaryCallSettings.Builder purgeUserEventsSettings() { + return purgeUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to purgeUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeMetadata> + purgeUserEventsOperationSettings() { + return purgeUserEventsOperationSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + public UnaryCallSettings.Builder + importUserEventsSettings() { + return importUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to importUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportMetadata> + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + public UnaryCallSettings.Builder + rejoinUserEventsSettings() { + return rejoinUserEventsSettings; + } + + /** Returns the builder for the settings used for calls to rejoinUserEvents. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> + rejoinUserEventsOperationSettings() { + return rejoinUserEventsOperationSettings; + } + + @Override + public UserEventServiceStubSettings build() throws IOException { + return new UserEventServiceStubSettings(this); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CatalogServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CatalogServiceClientTest.java new file mode 100644 index 00000000..fec59de0 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CatalogServiceClientTest.java @@ -0,0 +1,794 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.CatalogServiceClient.ListCatalogsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +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 CatalogServiceClientTest { + private static MockCatalogService mockCatalogService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CatalogServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCatalogService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CatalogServiceSettings settings = + CatalogServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CatalogServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listCatalogsTest() throws Exception { + Catalog responsesElement = Catalog.newBuilder().build(); + ListCatalogsResponse expectedResponse = + ListCatalogsResponse.newBuilder() + .setNextPageToken("") + .addAllCatalogs(Arrays.asList(responsesElement)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCatalogsPagedResponse pagedListResponse = client.listCatalogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogsList().get(0), resources.get(0)); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCatalogsRequest actualRequest = ((ListCatalogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCatalogsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCatalogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCatalogsTest2() throws Exception { + Catalog responsesElement = Catalog.newBuilder().build(); + ListCatalogsResponse expectedResponse = + ListCatalogsResponse.newBuilder() + .setNextPageToken("") + .addAllCatalogs(Arrays.asList(responsesElement)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCatalogsPagedResponse pagedListResponse = client.listCatalogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogsList().get(0), resources.get(0)); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCatalogsRequest actualRequest = ((ListCatalogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCatalogsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCatalogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCatalogTest() throws Exception { + Catalog expectedResponse = + Catalog.newBuilder() + .setName(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setDisplayName("displayName1714148973") + .setProductLevelConfig(ProductLevelConfig.newBuilder().build()) + .setMerchantCenterLinkingConfig(MerchantCenterLinkingConfig.newBuilder().build()) + .build(); + mockCatalogService.addResponse(expectedResponse); + + Catalog catalog = Catalog.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Catalog actualResponse = client.updateCatalog(catalog, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCatalogRequest actualRequest = ((UpdateCatalogRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCatalogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + Catalog catalog = Catalog.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCatalog(catalog, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setDefaultBranchTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setDefaultBranchTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest2() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCompletionConfigTest() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + CompletionConfig actualResponse = client.getCompletionConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCompletionConfigRequest actualRequest = ((GetCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCompletionConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getCompletionConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCompletionConfigTest2() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + String name = "name3373707"; + + CompletionConfig actualResponse = client.getCompletionConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCompletionConfigRequest actualRequest = ((GetCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCompletionConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String name = "name3373707"; + client.getCompletionConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCompletionConfigTest() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CompletionConfig completionConfig = CompletionConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CompletionConfig actualResponse = client.updateCompletionConfig(completionConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCompletionConfigRequest actualRequest = + ((UpdateCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(completionConfig, actualRequest.getCompletionConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCompletionConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CompletionConfig completionConfig = CompletionConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCompletionConfig(completionConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributesConfigTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + AttributesConfig actualResponse = client.getAttributesConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributesConfigRequest actualRequest = ((GetAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributesConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getAttributesConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributesConfigTest2() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String name = "name3373707"; + + AttributesConfig actualResponse = client.getAttributesConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributesConfigRequest actualRequest = ((GetAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributesConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String name = "name3373707"; + client.getAttributesConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAttributesConfigTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AttributesConfig attributesConfig = AttributesConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AttributesConfig actualResponse = client.updateAttributesConfig(attributesConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAttributesConfigRequest actualRequest = + ((UpdateAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(attributesConfig, actualRequest.getAttributesConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAttributesConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AttributesConfig attributesConfig = AttributesConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAttributesConfig(attributesConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AddCatalogAttributeRequest request = + AddCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .build(); + + AttributesConfig actualResponse = client.addCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddCatalogAttributeRequest actualRequest = ((AddCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getCatalogAttribute(), actualRequest.getCatalogAttribute()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AddCatalogAttributeRequest request = + AddCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .build(); + client.addCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + RemoveCatalogAttributeRequest request = + RemoveCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setKey("key106079") + .build(); + + AttributesConfig actualResponse = client.removeCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveCatalogAttributeRequest actualRequest = + ((RemoveCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getKey(), actualRequest.getKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + RemoveCatalogAttributeRequest request = + RemoveCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setKey("key106079") + .build(); + client.removeCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void replaceCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + ReplaceCatalogAttributeRequest request = + ReplaceCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + AttributesConfig actualResponse = client.replaceCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReplaceCatalogAttributeRequest actualRequest = + ((ReplaceCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getCatalogAttribute(), actualRequest.getCatalogAttribute()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void replaceCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + ReplaceCatalogAttributeRequest request = + ReplaceCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.replaceCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CompletionServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CompletionServiceClientTest.java new file mode 100644 index 00000000..968cff01 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/CompletionServiceClientTest.java @@ -0,0 +1,207 @@ +/* + * 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.v2alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CompletionServiceClientTest { + private static MockCompletionService mockCompletionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CompletionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompletionService = new MockCompletionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCompletionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CompletionServiceSettings settings = + CompletionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CompletionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void completeQueryTest() throws Exception { + CompleteQueryResponse expectedResponse = + CompleteQueryResponse.newBuilder() + .addAllCompletionResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllRecentSearchResults(new ArrayList()) + .build(); + mockCompletionService.addResponse(expectedResponse); + + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + + CompleteQueryResponse actualResponse = client.completeQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CompleteQueryRequest actualRequest = ((CompleteQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCatalog(), actualRequest.getCatalog()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getLanguageCodesList(), actualRequest.getLanguageCodesList()); + Assert.assertEquals(request.getDeviceType(), actualRequest.getDeviceType()); + Assert.assertEquals(request.getDataset(), actualRequest.getDataset()); + Assert.assertEquals(request.getMaxSuggestions(), actualRequest.getMaxSuggestions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void completeQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + client.completeQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importCompletionDataTest() throws Exception { + ImportCompletionDataResponse expectedResponse = + ImportCompletionDataResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importCompletionDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCompletionService.addResponse(resultOperation); + + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + + ImportCompletionDataResponse actualResponse = client.importCompletionDataAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportCompletionDataRequest actualRequest = + ((ImportCompletionDataRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importCompletionDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + client.importCompletionDataAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ControlServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ControlServiceClientTest.java new file mode 100644 index 00000000..feb62dcd --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ControlServiceClientTest.java @@ -0,0 +1,464 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ControlServiceClient.ListControlsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 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 ControlServiceClientTest { + private static MockControlService mockControlService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ControlServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockControlService = new MockControlService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockControlService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ControlServiceSettings settings = + ControlServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ControlServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + + Control actualResponse = client.createControl(parent, control, controlId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateControlRequest actualRequest = ((CreateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(controlId, actualRequest.getControlId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + client.createControl(parent, control, controlId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createControlTest2() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + + Control actualResponse = client.createControl(parent, control, controlId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateControlRequest actualRequest = ((CreateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(controlId, actualRequest.getControlId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String parent = "parent-995424086"; + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + client.createControl(parent, control, controlId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteControlTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockControlService.addResponse(expectedResponse); + + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + + client.deleteControl(name); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteControlRequest actualRequest = ((DeleteControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + client.deleteControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteControlTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockControlService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteControl(name); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteControlRequest actualRequest = ((DeleteControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String name = "name3373707"; + client.deleteControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + Control control = Control.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Control actualResponse = client.updateControl(control, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateControlRequest actualRequest = ((UpdateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + Control control = Control.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateControl(control, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + + Control actualResponse = client.getControl(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetControlRequest actualRequest = ((GetControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + client.getControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getControlTest2() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + String name = "name3373707"; + + Control actualResponse = client.getControl(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetControlRequest actualRequest = ((GetControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String name = "name3373707"; + client.getControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listControlsTest() throws Exception { + Control responsesElement = Control.newBuilder().build(); + ListControlsResponse expectedResponse = + ListControlsResponse.newBuilder() + .setNextPageToken("") + .addAllControls(Arrays.asList(responsesElement)) + .build(); + mockControlService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListControlsPagedResponse pagedListResponse = client.listControls(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getControlsList().get(0), resources.get(0)); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListControlsRequest actualRequest = ((ListControlsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listControlsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listControls(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listControlsTest2() throws Exception { + Control responsesElement = Control.newBuilder().build(); + ListControlsResponse expectedResponse = + ListControlsResponse.newBuilder() + .setNextPageToken("") + .addAllControls(Arrays.asList(responsesElement)) + .build(); + mockControlService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListControlsPagedResponse pagedListResponse = client.listControls(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getControlsList().get(0), resources.get(0)); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListControlsRequest actualRequest = ((ListControlsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listControlsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listControls(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogService.java new file mode 100644 index 00000000..cce57872 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCatalogService implements MockGrpcService { + private final MockCatalogServiceImpl serviceImpl; + + public MockCatalogService() { + serviceImpl = new MockCatalogServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogServiceImpl.java new file mode 100644 index 00000000..6d1eeec5 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCatalogServiceImpl.java @@ -0,0 +1,292 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.CatalogServiceGrpc.CatalogServiceImplBase; +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 MockCatalogServiceImpl extends CatalogServiceImplBase { + private List requests; + private Queue responses; + + public MockCatalogServiceImpl() { + 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 listCatalogs( + ListCatalogsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCatalogsResponse) { + requests.add(request); + responseObserver.onNext(((ListCatalogsResponse) 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 ListCatalogs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCatalogsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCatalog( + UpdateCatalogRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Catalog) { + requests.add(request); + responseObserver.onNext(((Catalog) 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 UpdateCatalog, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Catalog.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setDefaultBranch( + SetDefaultBranchRequest 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 SetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDefaultBranch( + GetDefaultBranchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GetDefaultBranchResponse) { + requests.add(request); + responseObserver.onNext(((GetDefaultBranchResponse) 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 GetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GetDefaultBranchResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCompletionConfig( + GetCompletionConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompletionConfig) { + requests.add(request); + responseObserver.onNext(((CompletionConfig) 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 GetCompletionConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompletionConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCompletionConfig( + UpdateCompletionConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompletionConfig) { + requests.add(request); + responseObserver.onNext(((CompletionConfig) 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 UpdateCompletionConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompletionConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAttributesConfig( + GetAttributesConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 GetAttributesConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAttributesConfig( + UpdateAttributesConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 UpdateAttributesConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addCatalogAttribute( + AddCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 AddCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeCatalogAttribute( + RemoveCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 RemoveCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void replaceCatalogAttribute( + ReplaceCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 ReplaceCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionService.java new file mode 100644 index 00000000..b2703f68 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompletionService implements MockGrpcService { + private final MockCompletionServiceImpl serviceImpl; + + public MockCompletionService() { + serviceImpl = new MockCompletionServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionServiceImpl.java new file mode 100644 index 00000000..3bb766d2 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockCompletionServiceImpl.java @@ -0,0 +1,103 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.CompletionServiceGrpc.CompletionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompletionServiceImpl extends CompletionServiceImplBase { + private List requests; + private Queue responses; + + public MockCompletionServiceImpl() { + 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 completeQuery( + CompleteQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompleteQueryResponse) { + requests.add(request); + responseObserver.onNext(((CompleteQueryResponse) 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 CompleteQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompleteQueryResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importCompletionData( + ImportCompletionDataRequest 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 ImportCompletionData, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlService.java new file mode 100644 index 00000000..30efbf20 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockControlService implements MockGrpcService { + private final MockControlServiceImpl serviceImpl; + + public MockControlService() { + serviceImpl = new MockControlServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlServiceImpl.java new file mode 100644 index 00000000..82c5ee86 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockControlServiceImpl.java @@ -0,0 +1,164 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.ControlServiceGrpc.ControlServiceImplBase; +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 MockControlServiceImpl extends ControlServiceImplBase { + private List requests; + private Queue responses; + + public MockControlServiceImpl() { + 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 createControl( + CreateControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 CreateControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteControl(DeleteControlRequest 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 DeleteControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateControl( + UpdateControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 UpdateControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getControl(GetControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 GetControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listControls( + ListControlsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListControlsResponse) { + requests.add(request); + responseObserver.onNext(((ListControlsResponse) 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 ListControls, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListControlsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionService.java new file mode 100644 index 00000000..cf078fbf --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPredictionService implements MockGrpcService { + private final MockPredictionServiceImpl serviceImpl; + + public MockPredictionService() { + serviceImpl = new MockPredictionServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionServiceImpl.java new file mode 100644 index 00000000..27ba5e9b --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockPredictionServiceImpl.java @@ -0,0 +1,80 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPredictionServiceImpl extends PredictionServiceImplBase { + private List requests; + private Queue responses; + + public MockPredictionServiceImpl() { + 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 predict(PredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PredictResponse) { + requests.add(request); + responseObserver.onNext(((PredictResponse) 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 Predict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PredictResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductService.java new file mode 100644 index 00000000..f6c5392e --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockProductService implements MockGrpcService { + private final MockProductServiceImpl serviceImpl; + + public MockProductService() { + serviceImpl = new MockProductServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductServiceImpl.java new file mode 100644 index 00000000..261cdd46 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockProductServiceImpl.java @@ -0,0 +1,312 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.ProductServiceGrpc.ProductServiceImplBase; +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 MockProductServiceImpl extends ProductServiceImplBase { + private List requests; + private Queue responses; + + public MockProductServiceImpl() { + 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 createProduct( + CreateProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 CreateProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getProduct(GetProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 GetProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProducts( + ListProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProductsResponse) { + requests.add(request); + responseObserver.onNext(((ListProductsResponse) 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 ListProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProductsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateProduct( + UpdateProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 UpdateProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProduct(DeleteProductRequest 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 DeleteProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void purgeProducts( + PurgeProductsRequest 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 PurgeProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importProducts( + ImportProductsRequest 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 ImportProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setInventory( + SetInventoryRequest 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 SetInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addFulfillmentPlaces( + AddFulfillmentPlacesRequest 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 AddFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeFulfillmentPlaces( + RemoveFulfillmentPlacesRequest 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 RemoveFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addLocalInventories( + AddLocalInventoriesRequest 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 AddLocalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeLocalInventories( + RemoveLocalInventoriesRequest 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 RemoveLocalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchService.java new file mode 100644 index 00000000..809d82e6 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSearchService implements MockGrpcService { + private final MockSearchServiceImpl serviceImpl; + + public MockSearchService() { + serviceImpl = new MockSearchServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchServiceImpl.java new file mode 100644 index 00000000..baf092d0 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockSearchServiceImpl.java @@ -0,0 +1,80 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.SearchServiceGrpc.SearchServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSearchServiceImpl extends SearchServiceImplBase { + private List requests; + private Queue responses; + + public MockSearchServiceImpl() { + 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 search(SearchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchResponse) { + requests.add(request); + responseObserver.onNext(((SearchResponse) 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 Search, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigService.java new file mode 100644 index 00000000..dc864d3f --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockServingConfigService implements MockGrpcService { + private final MockServingConfigServiceImpl serviceImpl; + + public MockServingConfigService() { + serviceImpl = new MockServingConfigServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigServiceImpl.java new file mode 100644 index 00000000..6c8b714f --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockServingConfigServiceImpl.java @@ -0,0 +1,209 @@ +/* + * 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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.ServingConfigServiceGrpc.ServingConfigServiceImplBase; +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 MockServingConfigServiceImpl extends ServingConfigServiceImplBase { + private List requests; + private Queue responses; + + public MockServingConfigServiceImpl() { + 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 createServingConfig( + CreateServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 CreateServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteServingConfig( + DeleteServingConfigRequest 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 DeleteServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateServingConfig( + UpdateServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 UpdateServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getServingConfig( + GetServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 GetServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServingConfigs( + ListServingConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListServingConfigsResponse) { + requests.add(request); + responseObserver.onNext(((ListServingConfigsResponse) 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 ListServingConfigs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListServingConfigsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addControl( + AddControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 AddControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeControl( + RemoveControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 RemoveControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventService.java new file mode 100644 index 00000000..8d3f87e3 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventService.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.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockUserEventService implements MockGrpcService { + private final MockUserEventServiceImpl serviceImpl; + + public MockUserEventService() { + serviceImpl = new MockUserEventServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventServiceImpl.java new file mode 100644 index 00000000..12925483 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockUserEventServiceImpl.java @@ -0,0 +1,167 @@ +/* + * 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.v2alpha; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.UserEventServiceGrpc.UserEventServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockUserEventServiceImpl extends UserEventServiceImplBase { + private List requests; + private Queue responses; + + public MockUserEventServiceImpl() { + 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 writeUserEvent( + WriteUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UserEvent) { + requests.add(request); + responseObserver.onNext(((UserEvent) 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 WriteUserEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UserEvent.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void collectUserEvent( + CollectUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof HttpBody) { + requests.add(request); + responseObserver.onNext(((HttpBody) 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 CollectUserEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + HttpBody.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void purgeUserEvents( + PurgeUserEventsRequest 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 PurgeUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importUserEvents( + ImportUserEventsRequest 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 ImportUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rejoinUserEvents( + RejoinUserEventsRequest 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 RejoinUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/PredictionServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/PredictionServiceClientTest.java new file mode 100644 index 00000000..4987958e --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/PredictionServiceClientTest.java @@ -0,0 +1,148 @@ +/* + * 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.v2alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Value; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +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 PredictionServiceClientTest { + private static MockPredictionService mockPredictionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private PredictionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockPredictionService = new MockPredictionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockPredictionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void predictTest() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllMissingIds(new ArrayList()) + .setValidateOnly(true) + .build(); + mockPredictionService.addResponse(expectedResponse); + + PredictRequest request = + PredictRequest.newBuilder() + .setPlacement("placement1792938725") + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllLabels(new HashMap()) + .build(); + + PredictResponse actualResponse = client.predict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = ((PredictRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPlacement(), actualRequest.getPlacement()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap()); + Assert.assertEquals(request.getLabelsMap(), actualRequest.getLabelsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void predictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + PredictRequest request = + PredictRequest.newBuilder() + .setPlacement("placement1792938725") + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllLabels(new HashMap()) + .build(); + client.predict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ProductServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ProductServiceClientTest.java new file mode 100644 index 00000000..b2b10a97 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ProductServiceClientTest.java @@ -0,0 +1,1151 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ProductServiceClient.ListProductsPagedResponse; + +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.Int32Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 ProductServiceClientTest { + private static MockProductService mockProductService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ProductServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockProductService = new MockProductService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockProductService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ProductServiceSettings settings = + ProductServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProductServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + + Product actualResponse = client.createProduct(parent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = ((CreateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(productId, actualRequest.getProductId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + client.createProduct(parent, product, productId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createProductTest2() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + + Product actualResponse = client.createProduct(parent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = ((CreateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(productId, actualRequest.getProductId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String parent = "parent-995424086"; + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + client.createProduct(parent, product, productId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + Product actualResponse = client.getProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = ((GetProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.getProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProductTest2() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + String name = "name3373707"; + + Product actualResponse = client.getProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = ((GetProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String name = "name3373707"; + client.getProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProductsTest2() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Product actualResponse = client.updateProduct(product, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateProductRequest actualRequest = ((UpdateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateProduct(product, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProductTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductService.addResponse(expectedResponse); + + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + client.deleteProduct(name); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = ((DeleteProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.deleteProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProductTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteProduct(name); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = ((DeleteProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String name = "name3373707"; + client.deleteProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void purgeProductsTest() throws Exception { + PurgeProductsResponse expectedResponse = + PurgeProductsResponse.newBuilder() + .setPurgeCount(575305851) + .addAllPurgeSample(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeProductsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + PurgeProductsRequest request = + PurgeProductsRequest.newBuilder() + .setParent(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeProductsResponse actualResponse = client.purgeProductsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PurgeProductsRequest actualRequest = ((PurgeProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getForce(), actualRequest.getForce()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void purgeProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + PurgeProductsRequest request = + PurgeProductsRequest.newBuilder() + .setParent( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeProductsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void importProductsTest() throws Exception { + ImportProductsResponse expectedResponse = + ImportProductsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importProductsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ImportProductsRequest request = + ImportProductsRequest.newBuilder() + .setParent(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") + .setInputConfig(ProductInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + + ImportProductsResponse actualResponse = client.importProductsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportProductsRequest actualRequest = ((ImportProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals(request.getErrorsConfig(), actualRequest.getErrorsConfig()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertEquals(request.getReconciliationMode(), actualRequest.getReconciliationMode()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ImportProductsRequest request = + ImportProductsRequest.newBuilder() + .setParent( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") + .setInputConfig(ProductInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + client.importProductsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void setInventoryTest() throws Exception { + SetInventoryResponse expectedResponse = SetInventoryResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setInventoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + + SetInventoryResponse actualResponse = client.setInventoryAsync(inventory, setMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetInventoryRequest actualRequest = ((SetInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(inventory, actualRequest.getInventory()); + Assert.assertEquals(setMask, actualRequest.getSetMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + client.setInventoryAsync(inventory, setMask).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 addFulfillmentPlacesTest() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.addFulfillmentPlacesAsync(product).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 addFulfillmentPlacesTest2() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.addFulfillmentPlacesAsync(product).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 removeFulfillmentPlacesTest() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.removeFulfillmentPlacesAsync(product).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 removeFulfillmentPlacesTest2() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.removeFulfillmentPlacesAsync(product).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 addLocalInventoriesTest() throws Exception { + AddLocalInventoriesResponse expectedResponse = AddLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + AddLocalInventoriesResponse actualResponse = client.addLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddLocalInventoriesRequest actualRequest = ((AddLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addLocalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.addLocalInventoriesAsync(product).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 addLocalInventoriesTest2() throws Exception { + AddLocalInventoriesResponse expectedResponse = AddLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + AddLocalInventoriesResponse actualResponse = client.addLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddLocalInventoriesRequest actualRequest = ((AddLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addLocalInventoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.addLocalInventoriesAsync(product).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 removeLocalInventoriesTest() throws Exception { + RemoveLocalInventoriesResponse expectedResponse = + RemoveLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + RemoveLocalInventoriesResponse actualResponse = + client.removeLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveLocalInventoriesRequest actualRequest = + ((RemoveLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeLocalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.removeLocalInventoriesAsync(product).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 removeLocalInventoriesTest2() throws Exception { + RemoveLocalInventoriesResponse expectedResponse = + RemoveLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + RemoveLocalInventoriesResponse actualResponse = + client.removeLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveLocalInventoriesRequest actualRequest = + ((RemoveLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeLocalInventoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.removeLocalInventoriesAsync(product).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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/SearchServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/SearchServiceClientTest.java new file mode 100644 index 00000000..9c8842a3 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/SearchServiceClientTest.java @@ -0,0 +1,187 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.SearchServiceClient.SearchPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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 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 SearchServiceClientTest { + private static MockSearchService mockSearchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSearchService = new MockSearchService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSearchService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SearchServiceSettings settings = + SearchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SearchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void searchTest() throws Exception { + SearchResponse.SearchResult responsesElement = SearchResponse.SearchResult.newBuilder().build(); + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockSearchService.addResponse(expectedResponse); + + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) + .build(); + + SearchPagedResponse pagedListResponse = client.search(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchRequest actualRequest = ((SearchRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPlacement(), actualRequest.getPlacement()); + Assert.assertEquals(request.getBranch(), actualRequest.getBranch()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getUserInfo(), actualRequest.getUserInfo()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getOffset(), actualRequest.getOffset()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getCanonicalFilter(), actualRequest.getCanonicalFilter()); + Assert.assertEquals(request.getOrderBy(), actualRequest.getOrderBy()); + Assert.assertEquals(request.getFacetSpecsList(), actualRequest.getFacetSpecsList()); + Assert.assertEquals(request.getDynamicFacetSpec(), actualRequest.getDynamicFacetSpec()); + Assert.assertEquals(request.getBoostSpec(), actualRequest.getBoostSpec()); + Assert.assertEquals(request.getQueryExpansionSpec(), actualRequest.getQueryExpansionSpec()); + Assert.assertEquals(request.getRelevanceThreshold(), actualRequest.getRelevanceThreshold()); + Assert.assertEquals( + request.getVariantRollupKeysList(), actualRequest.getVariantRollupKeysList()); + Assert.assertEquals(request.getPageCategoriesList(), actualRequest.getPageCategoriesList()); + Assert.assertEquals(request.getSearchMode(), actualRequest.getSearchMode()); + Assert.assertEquals(request.getPersonalizationSpec(), actualRequest.getPersonalizationSpec()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSearchService.addException(exception); + + try { + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) + .build(); + client.search(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClientTest.java new file mode 100644 index 00000000..0513c2c7 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClientTest.java @@ -0,0 +1,768 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.retail.v2alpha.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 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 ServingConfigServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockServingConfigService mockServingConfigService; + private LocalChannelProvider channelProvider; + private ServingConfigServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockServingConfigService = new MockServingConfigService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockServingConfigService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ServingConfigServiceSettings settings = + ServingConfigServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServingConfigServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + + ServingConfig actualResponse = + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServingConfigRequest actualRequest = ((CreateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(servingConfigId, actualRequest.getServingConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createServingConfigTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + + ServingConfig actualResponse = + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServingConfigRequest actualRequest = ((CreateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(servingConfigId, actualRequest.getServingConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String parent = "parent-995424086"; + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteServingConfigTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + client.deleteServingConfig(name); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServingConfigRequest actualRequest = ((DeleteServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.deleteServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteServingConfigTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockServingConfigService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteServingConfig(name); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServingConfigRequest actualRequest = ((DeleteServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String name = "name3373707"; + client.deleteServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ServingConfig actualResponse = client.updateServingConfig(servingConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServingConfigRequest actualRequest = ((UpdateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateServingConfig(servingConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.getServingConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServingConfigRequest actualRequest = ((GetServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.getServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServingConfigTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String name = "name3373707"; + + ServingConfig actualResponse = client.getServingConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServingConfigRequest actualRequest = ((GetServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String name = "name3373707"; + client.getServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServingConfigsTest() throws Exception { + ServingConfig responsesElement = ServingConfig.newBuilder().build(); + ListServingConfigsResponse expectedResponse = + ListServingConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllServingConfigs(Arrays.asList(responsesElement)) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListServingConfigsPagedResponse pagedListResponse = client.listServingConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServingConfigsList().get(0), resources.get(0)); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServingConfigsRequest actualRequest = ((ListServingConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServingConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listServingConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServingConfigsTest2() throws Exception { + ServingConfig responsesElement = ServingConfig.newBuilder().build(); + ListServingConfigsResponse expectedResponse = + ListServingConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllServingConfigs(Arrays.asList(responsesElement)) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListServingConfigsPagedResponse pagedListResponse = client.listServingConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServingConfigsList().get(0), resources.get(0)); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServingConfigsRequest actualRequest = ((ListServingConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServingConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listServingConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addControlTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.addControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddControlRequest actualRequest = ((AddControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig.toString(), actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.addControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addControlTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String servingConfig = "servingConfig1237122670"; + + ServingConfig actualResponse = client.addControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddControlRequest actualRequest = ((AddControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String servingConfig = "servingConfig1237122670"; + client.addControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeControlTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.removeControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveControlRequest actualRequest = ((RemoveControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig.toString(), actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.removeControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeControlTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String servingConfig = "servingConfig1237122670"; + + ServingConfig actualResponse = client.removeControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveControlRequest actualRequest = ((RemoveControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String servingConfig = "servingConfig1237122670"; + client.removeControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/UserEventServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/UserEventServiceClientTest.java new file mode 100644 index 00000000..afc2182f --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/UserEventServiceClientTest.java @@ -0,0 +1,371 @@ +/* + * 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.v2alpha; + +import com.google.api.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 UserEventServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockUserEventService mockUserEventService; + private LocalChannelProvider channelProvider; + private UserEventServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockUserEventService = new MockUserEventService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockUserEventService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + UserEventServiceSettings settings = + UserEventServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = UserEventServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void writeUserEventTest() throws Exception { + UserEvent expectedResponse = + UserEvent.newBuilder() + .setEventType("eventType31430900") + .setVisitorId("visitorId1880545833") + .setSessionId("sessionId607796817") + .setEventTime(Timestamp.newBuilder().build()) + .addAllExperimentIds(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllProductDetails(new ArrayList()) + .setCompletionDetail(CompletionDetail.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCartId("cartId-1367589797") + .setPurchaseTransaction(PurchaseTransaction.newBuilder().build()) + .setSearchQuery("searchQuery-552137728") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setOffset(-1019779949) + .addAllPageCategories(new ArrayList()) + .setUserInfo(UserInfo.newBuilder().build()) + .setUri("uri116076") + .setReferrerUri("referrerUri348088525") + .setPageViewId("pageViewId1362499087") + .build(); + mockUserEventService.addResponse(expectedResponse); + + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + + UserEvent actualResponse = client.writeUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteUserEventRequest actualRequest = ((WriteUserEventRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + client.writeUserEvent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void collectUserEventTest() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockUserEventService.addResponse(expectedResponse); + + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + + HttpBody actualResponse = client.collectUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CollectUserEventRequest actualRequest = ((CollectUserEventRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertEquals(request.getUri(), actualRequest.getUri()); + Assert.assertEquals(request.getEts(), actualRequest.getEts()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void collectUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + client.collectUserEvent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void purgeUserEventsTest() throws Exception { + PurgeUserEventsResponse expectedResponse = + PurgeUserEventsResponse.newBuilder().setPurgedEventsCount(-310774833).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent("parent-995424086") + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeUserEventsResponse actualResponse = client.purgeUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PurgeUserEventsRequest actualRequest = ((PurgeUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getForce(), actualRequest.getForce()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void purgeUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent("parent-995424086") + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void importUserEventsTest() throws Exception { + ImportUserEventsResponse expectedResponse = + ImportUserEventsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setImportSummary(UserEventImportSummary.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(UserEventInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + + ImportUserEventsResponse actualResponse = client.importUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportUserEventsRequest actualRequest = ((ImportUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals(request.getErrorsConfig(), actualRequest.getErrorsConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(UserEventInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + client.importUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void rejoinUserEventsTest() throws Exception { + RejoinUserEventsResponse expectedResponse = + RejoinUserEventsResponse.newBuilder().setRejoinedUserEventsCount(-1152281574).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("rejoinUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + RejoinUserEventsRequest request = + RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + + RejoinUserEventsResponse actualResponse = client.rejoinUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RejoinUserEventsRequest actualRequest = ((RejoinUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEventRejoinScope(), actualRequest.getUserEventRejoinScope()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rejoinUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + RejoinUserEventsRequest request = + RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + client.rejoinUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java new file mode 100644 index 00000000..3978f47c --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java @@ -0,0 +1,794 @@ +/* + * 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.CatalogServiceClient.ListCatalogsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +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 CatalogServiceClientTest { + private static MockCatalogService mockCatalogService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CatalogServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCatalogService = new MockCatalogService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCatalogService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CatalogServiceSettings settings = + CatalogServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CatalogServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listCatalogsTest() throws Exception { + Catalog responsesElement = Catalog.newBuilder().build(); + ListCatalogsResponse expectedResponse = + ListCatalogsResponse.newBuilder() + .setNextPageToken("") + .addAllCatalogs(Arrays.asList(responsesElement)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCatalogsPagedResponse pagedListResponse = client.listCatalogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogsList().get(0), resources.get(0)); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCatalogsRequest actualRequest = ((ListCatalogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCatalogsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCatalogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCatalogsTest2() throws Exception { + Catalog responsesElement = Catalog.newBuilder().build(); + ListCatalogsResponse expectedResponse = + ListCatalogsResponse.newBuilder() + .setNextPageToken("") + .addAllCatalogs(Arrays.asList(responsesElement)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCatalogsPagedResponse pagedListResponse = client.listCatalogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCatalogsList().get(0), resources.get(0)); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCatalogsRequest actualRequest = ((ListCatalogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCatalogsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCatalogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCatalogTest() throws Exception { + Catalog expectedResponse = + Catalog.newBuilder() + .setName(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setDisplayName("displayName1714148973") + .setProductLevelConfig(ProductLevelConfig.newBuilder().build()) + .setMerchantCenterLinkingConfig(MerchantCenterLinkingConfig.newBuilder().build()) + .build(); + mockCatalogService.addResponse(expectedResponse); + + Catalog catalog = Catalog.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Catalog actualResponse = client.updateCatalog(catalog, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCatalogRequest actualRequest = ((UpdateCatalogRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCatalogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + Catalog catalog = Catalog.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCatalog(catalog, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setDefaultBranchTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setDefaultBranchTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + client.setDefaultBranch(catalog); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetDefaultBranchRequest actualRequest = ((SetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.setDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog.toString(), actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CatalogName catalog = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDefaultBranchTest2() throws Exception { + GetDefaultBranchResponse expectedResponse = + GetDefaultBranchResponse.newBuilder() + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setSetTime(Timestamp.newBuilder().build()) + .setNote("note3387378") + .build(); + mockCatalogService.addResponse(expectedResponse); + + String catalog = "catalog555704345"; + + GetDefaultBranchResponse actualResponse = client.getDefaultBranch(catalog); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDefaultBranchRequest actualRequest = ((GetDefaultBranchRequest) actualRequests.get(0)); + + Assert.assertEquals(catalog, actualRequest.getCatalog()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDefaultBranchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String catalog = "catalog555704345"; + client.getDefaultBranch(catalog); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCompletionConfigTest() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + CompletionConfig actualResponse = client.getCompletionConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCompletionConfigRequest actualRequest = ((GetCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCompletionConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CompletionConfigName name = CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getCompletionConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCompletionConfigTest2() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + String name = "name3373707"; + + CompletionConfig actualResponse = client.getCompletionConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCompletionConfigRequest actualRequest = ((GetCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCompletionConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String name = "name3373707"; + client.getCompletionConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCompletionConfigTest() throws Exception { + CompletionConfig expectedResponse = + CompletionConfig.newBuilder() + .setName(CompletionConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setMatchingOrder("matchingOrder-1366761135") + .setMaxSuggestions(618824852) + .setMinPrefixLength(96853510) + .setAutoLearning(true) + .setSuggestionsInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastSuggestionsImportOperation("lastSuggestionsImportOperation-245829751") + .setDenylistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastDenylistImportOperation("lastDenylistImportOperation1262341570") + .setAllowlistInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setLastAllowlistImportOperation("lastAllowlistImportOperation1624716689") + .build(); + mockCatalogService.addResponse(expectedResponse); + + CompletionConfig completionConfig = CompletionConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CompletionConfig actualResponse = client.updateCompletionConfig(completionConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCompletionConfigRequest actualRequest = + ((UpdateCompletionConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(completionConfig, actualRequest.getCompletionConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCompletionConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + CompletionConfig completionConfig = CompletionConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCompletionConfig(completionConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributesConfigTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + AttributesConfig actualResponse = client.getAttributesConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributesConfigRequest actualRequest = ((GetAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributesConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AttributesConfigName name = AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.getAttributesConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAttributesConfigTest2() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + String name = "name3373707"; + + AttributesConfig actualResponse = client.getAttributesConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAttributesConfigRequest actualRequest = ((GetAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAttributesConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + String name = "name3373707"; + client.getAttributesConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAttributesConfigTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AttributesConfig attributesConfig = AttributesConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AttributesConfig actualResponse = client.updateAttributesConfig(attributesConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAttributesConfigRequest actualRequest = + ((UpdateAttributesConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(attributesConfig, actualRequest.getAttributesConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAttributesConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AttributesConfig attributesConfig = AttributesConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAttributesConfig(attributesConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + AddCatalogAttributeRequest request = + AddCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .build(); + + AttributesConfig actualResponse = client.addCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddCatalogAttributeRequest actualRequest = ((AddCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getCatalogAttribute(), actualRequest.getCatalogAttribute()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + AddCatalogAttributeRequest request = + AddCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .build(); + client.addCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + RemoveCatalogAttributeRequest request = + RemoveCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setKey("key106079") + .build(); + + AttributesConfig actualResponse = client.removeCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveCatalogAttributeRequest actualRequest = + ((RemoveCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getKey(), actualRequest.getKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + RemoveCatalogAttributeRequest request = + RemoveCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setKey("key106079") + .build(); + client.removeCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void replaceCatalogAttributeTest() throws Exception { + AttributesConfig expectedResponse = + AttributesConfig.newBuilder() + .setName(AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .putAllCatalogAttributes(new HashMap()) + .setAttributeConfigLevel(AttributeConfigLevel.forNumber(0)) + .build(); + mockCatalogService.addResponse(expectedResponse); + + ReplaceCatalogAttributeRequest request = + ReplaceCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + AttributesConfig actualResponse = client.replaceCatalogAttribute(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReplaceCatalogAttributeRequest actualRequest = + ((ReplaceCatalogAttributeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getCatalogAttribute(), actualRequest.getCatalogAttribute()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void replaceCatalogAttributeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + ReplaceCatalogAttributeRequest request = + ReplaceCatalogAttributeRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setCatalogAttribute(CatalogAttribute.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.replaceCatalogAttribute(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CompletionServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CompletionServiceClientTest.java new file mode 100644 index 00000000..d5d995d0 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CompletionServiceClientTest.java @@ -0,0 +1,207 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CompletionServiceClientTest { + private static MockCompletionService mockCompletionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CompletionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompletionService = new MockCompletionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCompletionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CompletionServiceSettings settings = + CompletionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CompletionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void completeQueryTest() throws Exception { + CompleteQueryResponse expectedResponse = + CompleteQueryResponse.newBuilder() + .addAllCompletionResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllRecentSearchResults(new ArrayList()) + .build(); + mockCompletionService.addResponse(expectedResponse); + + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + + CompleteQueryResponse actualResponse = client.completeQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CompleteQueryRequest actualRequest = ((CompleteQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCatalog(), actualRequest.getCatalog()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getLanguageCodesList(), actualRequest.getLanguageCodesList()); + Assert.assertEquals(request.getDeviceType(), actualRequest.getDeviceType()); + Assert.assertEquals(request.getDataset(), actualRequest.getDataset()); + Assert.assertEquals(request.getMaxSuggestions(), actualRequest.getMaxSuggestions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void completeQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .addAllLanguageCodes(new ArrayList()) + .setDeviceType("deviceType781190832") + .setDataset("dataset1443214456") + .setMaxSuggestions(618824852) + .build(); + client.completeQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importCompletionDataTest() throws Exception { + ImportCompletionDataResponse expectedResponse = + ImportCompletionDataResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importCompletionDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCompletionService.addResponse(resultOperation); + + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + + ImportCompletionDataResponse actualResponse = client.importCompletionDataAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompletionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportCompletionDataRequest actualRequest = + ((ImportCompletionDataRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importCompletionDataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompletionService.addException(exception); + + try { + ImportCompletionDataRequest request = + ImportCompletionDataRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(CompletionDataInputConfig.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + client.importCompletionDataAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java new file mode 100644 index 00000000..7362283b --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java @@ -0,0 +1,459 @@ +/* + * 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.ControlServiceClient.ListControlsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 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 ControlServiceClientTest { + private static MockControlService mockControlService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ControlServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockControlService = new MockControlService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockControlService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ControlServiceSettings settings = + ControlServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ControlServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + + Control actualResponse = client.createControl(parent, control, controlId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateControlRequest actualRequest = ((CreateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(controlId, actualRequest.getControlId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + client.createControl(parent, control, controlId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createControlTest2() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + + Control actualResponse = client.createControl(parent, control, controlId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateControlRequest actualRequest = ((CreateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(controlId, actualRequest.getControlId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String parent = "parent-995424086"; + Control control = Control.newBuilder().build(); + String controlId = "controlId-395080872"; + client.createControl(parent, control, controlId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteControlTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockControlService.addResponse(expectedResponse); + + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + + client.deleteControl(name); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteControlRequest actualRequest = ((DeleteControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + client.deleteControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteControlTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockControlService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteControl(name); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteControlRequest actualRequest = ((DeleteControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String name = "name3373707"; + client.deleteControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + Control control = Control.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Control actualResponse = client.updateControl(control, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateControlRequest actualRequest = ((UpdateControlRequest) actualRequests.get(0)); + + Assert.assertEquals(control, actualRequest.getControl()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + Control control = Control.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateControl(control, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getControlTest() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + + Control actualResponse = client.getControl(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetControlRequest actualRequest = ((GetControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + ControlName name = ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"); + client.getControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getControlTest2() throws Exception { + Control expectedResponse = + Control.newBuilder() + .setName(ControlName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]").toString()) + .setDisplayName("displayName1714148973") + .addAllAssociatedServingConfigIds(new ArrayList()) + .addAllSolutionTypes(new ArrayList()) + .build(); + mockControlService.addResponse(expectedResponse); + + String name = "name3373707"; + + Control actualResponse = client.getControl(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetControlRequest actualRequest = ((GetControlRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String name = "name3373707"; + client.getControl(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listControlsTest() throws Exception { + Control responsesElement = Control.newBuilder().build(); + ListControlsResponse expectedResponse = + ListControlsResponse.newBuilder() + .setNextPageToken("") + .addAllControls(Arrays.asList(responsesElement)) + .build(); + mockControlService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListControlsPagedResponse pagedListResponse = client.listControls(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getControlsList().get(0), resources.get(0)); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListControlsRequest actualRequest = ((ListControlsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listControlsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listControls(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listControlsTest2() throws Exception { + Control responsesElement = Control.newBuilder().build(); + ListControlsResponse expectedResponse = + ListControlsResponse.newBuilder() + .setNextPageToken("") + .addAllControls(Arrays.asList(responsesElement)) + .build(); + mockControlService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListControlsPagedResponse pagedListResponse = client.listControls(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getControlsList().get(0), resources.get(0)); + + List actualRequests = mockControlService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListControlsRequest actualRequest = ((ListControlsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listControlsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockControlService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listControls(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogService.java new file mode 100644 index 00000000..444f6b52 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogService.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 MockCatalogService implements MockGrpcService { + private final MockCatalogServiceImpl serviceImpl; + + public MockCatalogService() { + serviceImpl = new MockCatalogServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java new file mode 100644 index 00000000..2898705e --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java @@ -0,0 +1,292 @@ +/* + * 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.CatalogServiceGrpc.CatalogServiceImplBase; +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 MockCatalogServiceImpl extends CatalogServiceImplBase { + private List requests; + private Queue responses; + + public MockCatalogServiceImpl() { + 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 listCatalogs( + ListCatalogsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCatalogsResponse) { + requests.add(request); + responseObserver.onNext(((ListCatalogsResponse) 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 ListCatalogs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCatalogsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCatalog( + UpdateCatalogRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Catalog) { + requests.add(request); + responseObserver.onNext(((Catalog) 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 UpdateCatalog, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Catalog.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setDefaultBranch( + SetDefaultBranchRequest 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 SetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDefaultBranch( + GetDefaultBranchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GetDefaultBranchResponse) { + requests.add(request); + responseObserver.onNext(((GetDefaultBranchResponse) 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 GetDefaultBranch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GetDefaultBranchResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCompletionConfig( + GetCompletionConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompletionConfig) { + requests.add(request); + responseObserver.onNext(((CompletionConfig) 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 GetCompletionConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompletionConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCompletionConfig( + UpdateCompletionConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompletionConfig) { + requests.add(request); + responseObserver.onNext(((CompletionConfig) 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 UpdateCompletionConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompletionConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAttributesConfig( + GetAttributesConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 GetAttributesConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAttributesConfig( + UpdateAttributesConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 UpdateAttributesConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addCatalogAttribute( + AddCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 AddCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeCatalogAttribute( + RemoveCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 RemoveCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void replaceCatalogAttribute( + ReplaceCatalogAttributeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttributesConfig) { + requests.add(request); + responseObserver.onNext(((AttributesConfig) 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 ReplaceCatalogAttribute, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AttributesConfig.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionService.java new file mode 100644 index 00000000..8c9e9784 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionService.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 MockCompletionService implements MockGrpcService { + private final MockCompletionServiceImpl serviceImpl; + + public MockCompletionService() { + serviceImpl = new MockCompletionServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionServiceImpl.java new file mode 100644 index 00000000..8e231163 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCompletionServiceImpl.java @@ -0,0 +1,103 @@ +/* + * 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.CompletionServiceGrpc.CompletionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompletionServiceImpl extends CompletionServiceImplBase { + private List requests; + private Queue responses; + + public MockCompletionServiceImpl() { + 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 completeQuery( + CompleteQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CompleteQueryResponse) { + requests.add(request); + responseObserver.onNext(((CompleteQueryResponse) 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 CompleteQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CompleteQueryResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importCompletionData( + ImportCompletionDataRequest 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 ImportCompletionData, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlService.java new file mode 100644 index 00000000..53ee4210 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlService.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 MockControlService implements MockGrpcService { + private final MockControlServiceImpl serviceImpl; + + public MockControlService() { + serviceImpl = new MockControlServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlServiceImpl.java new file mode 100644 index 00000000..8c7f2bae --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockControlServiceImpl.java @@ -0,0 +1,164 @@ +/* + * 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.ControlServiceGrpc.ControlServiceImplBase; +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 MockControlServiceImpl extends ControlServiceImplBase { + private List requests; + private Queue responses; + + public MockControlServiceImpl() { + 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 createControl( + CreateControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 CreateControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteControl(DeleteControlRequest 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 DeleteControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateControl( + UpdateControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 UpdateControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getControl(GetControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Control) { + requests.add(request); + responseObserver.onNext(((Control) 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 GetControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Control.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listControls( + ListControlsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListControlsResponse) { + requests.add(request); + responseObserver.onNext(((ListControlsResponse) 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 ListControls, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListControlsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionService.java new file mode 100644 index 00000000..d3ee99f0 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionService.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 MockPredictionService implements MockGrpcService { + private final MockPredictionServiceImpl serviceImpl; + + public MockPredictionService() { + serviceImpl = new MockPredictionServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionServiceImpl.java new file mode 100644 index 00000000..0f1ca56f --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockPredictionServiceImpl.java @@ -0,0 +1,80 @@ +/* + * 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.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPredictionServiceImpl extends PredictionServiceImplBase { + private List requests; + private Queue responses; + + public MockPredictionServiceImpl() { + 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 predict(PredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PredictResponse) { + requests.add(request); + responseObserver.onNext(((PredictResponse) 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 Predict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PredictResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductService.java new file mode 100644 index 00000000..738b2c3a --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductService.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 MockProductService implements MockGrpcService { + private final MockProductServiceImpl serviceImpl; + + public MockProductService() { + serviceImpl = new MockProductServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductServiceImpl.java new file mode 100644 index 00000000..1231dcd2 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockProductServiceImpl.java @@ -0,0 +1,291 @@ +/* + * 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.ProductServiceGrpc.ProductServiceImplBase; +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 MockProductServiceImpl extends ProductServiceImplBase { + private List requests; + private Queue responses; + + public MockProductServiceImpl() { + 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 createProduct( + CreateProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 CreateProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getProduct(GetProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 GetProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProducts( + ListProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProductsResponse) { + requests.add(request); + responseObserver.onNext(((ListProductsResponse) 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 ListProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProductsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateProduct( + UpdateProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Product) { + requests.add(request); + responseObserver.onNext(((Product) 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 UpdateProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Product.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProduct(DeleteProductRequest 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 DeleteProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importProducts( + ImportProductsRequest 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 ImportProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setInventory( + SetInventoryRequest 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 SetInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addFulfillmentPlaces( + AddFulfillmentPlacesRequest 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 AddFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeFulfillmentPlaces( + RemoveFulfillmentPlacesRequest 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 RemoveFulfillmentPlaces, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addLocalInventories( + AddLocalInventoriesRequest 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 AddLocalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeLocalInventories( + RemoveLocalInventoriesRequest 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 RemoveLocalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchService.java new file mode 100644 index 00000000..76b6c3d5 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchService.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 MockSearchService implements MockGrpcService { + private final MockSearchServiceImpl serviceImpl; + + public MockSearchService() { + serviceImpl = new MockSearchServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchServiceImpl.java new file mode 100644 index 00000000..8f50d552 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockSearchServiceImpl.java @@ -0,0 +1,80 @@ +/* + * 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.SearchServiceGrpc.SearchServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSearchServiceImpl extends SearchServiceImplBase { + private List requests; + private Queue responses; + + public MockSearchServiceImpl() { + 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 search(SearchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchResponse) { + requests.add(request); + responseObserver.onNext(((SearchResponse) 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 Search, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigService.java new file mode 100644 index 00000000..00b4ba2b --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigService.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 MockServingConfigService implements MockGrpcService { + private final MockServingConfigServiceImpl serviceImpl; + + public MockServingConfigService() { + serviceImpl = new MockServingConfigServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigServiceImpl.java new file mode 100644 index 00000000..c57c2e53 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockServingConfigServiceImpl.java @@ -0,0 +1,209 @@ +/* + * 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.ServingConfigServiceGrpc.ServingConfigServiceImplBase; +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 MockServingConfigServiceImpl extends ServingConfigServiceImplBase { + private List requests; + private Queue responses; + + public MockServingConfigServiceImpl() { + 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 createServingConfig( + CreateServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 CreateServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteServingConfig( + DeleteServingConfigRequest 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 DeleteServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateServingConfig( + UpdateServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 UpdateServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getServingConfig( + GetServingConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 GetServingConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServingConfigs( + ListServingConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListServingConfigsResponse) { + requests.add(request); + responseObserver.onNext(((ListServingConfigsResponse) 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 ListServingConfigs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListServingConfigsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void addControl( + AddControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 AddControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void removeControl( + RemoveControlRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServingConfig) { + requests.add(request); + responseObserver.onNext(((ServingConfig) 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 RemoveControl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServingConfig.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventService.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventService.java new file mode 100644 index 00000000..0cdaa205 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventService.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 MockUserEventService implements MockGrpcService { + private final MockUserEventServiceImpl serviceImpl; + + public MockUserEventService() { + serviceImpl = new MockUserEventServiceImpl(); + } + + @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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventServiceImpl.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventServiceImpl.java new file mode 100644 index 00000000..b6ef2c34 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockUserEventServiceImpl.java @@ -0,0 +1,167 @@ +/* + * 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.HttpBody; +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2beta.UserEventServiceGrpc.UserEventServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockUserEventServiceImpl extends UserEventServiceImplBase { + private List requests; + private Queue responses; + + public MockUserEventServiceImpl() { + 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 writeUserEvent( + WriteUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof UserEvent) { + requests.add(request); + responseObserver.onNext(((UserEvent) 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 WriteUserEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + UserEvent.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void collectUserEvent( + CollectUserEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof HttpBody) { + requests.add(request); + responseObserver.onNext(((HttpBody) 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 CollectUserEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + HttpBody.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void purgeUserEvents( + PurgeUserEventsRequest 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 PurgeUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importUserEvents( + ImportUserEventsRequest 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 ImportUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rejoinUserEvents( + RejoinUserEventsRequest 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 RejoinUserEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/PredictionServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/PredictionServiceClientTest.java new file mode 100644 index 00000000..9198a161 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/PredictionServiceClientTest.java @@ -0,0 +1,148 @@ +/* + * 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.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.protobuf.AbstractMessage; +import com.google.protobuf.Value; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +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 PredictionServiceClientTest { + private static MockPredictionService mockPredictionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private PredictionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockPredictionService = new MockPredictionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockPredictionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void predictTest() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllMissingIds(new ArrayList()) + .setValidateOnly(true) + .build(); + mockPredictionService.addResponse(expectedResponse); + + PredictRequest request = + PredictRequest.newBuilder() + .setPlacement("placement1792938725") + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllLabels(new HashMap()) + .build(); + + PredictResponse actualResponse = client.predict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = ((PredictRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPlacement(), actualRequest.getPlacement()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap()); + Assert.assertEquals(request.getLabelsMap(), actualRequest.getLabelsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void predictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + PredictRequest request = + PredictRequest.newBuilder() + .setPlacement("placement1792938725") + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllLabels(new HashMap()) + .build(); + client.predict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java new file mode 100644 index 00000000..0ad296bd --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java @@ -0,0 +1,1091 @@ +/* + * 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.ProductServiceClient.ListProductsPagedResponse; + +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.Int32Value; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 ProductServiceClientTest { + private static MockProductService mockProductService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ProductServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockProductService = new MockProductService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockProductService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ProductServiceSettings settings = + ProductServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProductServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + + Product actualResponse = client.createProduct(parent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = ((CreateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(productId, actualRequest.getProductId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + client.createProduct(parent, product, productId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createProductTest2() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + + Product actualResponse = client.createProduct(parent, product, productId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProductRequest actualRequest = ((CreateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(productId, actualRequest.getProductId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String parent = "parent-995424086"; + Product product = Product.newBuilder().build(); + String productId = "productId-1051830678"; + client.createProduct(parent, product, productId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + Product actualResponse = client.getProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = ((GetProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.getProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProductTest2() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + String name = "name3373707"; + + Product actualResponse = client.getProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProductRequest actualRequest = ((GetProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String name = "name3373707"; + client.getProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProductsTest2() throws Exception { + Product responsesElement = Product.newBuilder().build(); + ListProductsResponse expectedResponse = + ListProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockProductService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProductsPagedResponse pagedListResponse = client.listProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProductsRequest actualRequest = ((ListProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProductsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateProductTest() throws Exception { + Product expectedResponse = + Product.newBuilder() + .setName( + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + .toString()) + .setId("id3355") + .setPrimaryProductId("primaryProductId-857339256") + .addAllCollectionMemberIds(new ArrayList()) + .setGtin("gtin3183314") + .addAllCategories(new ArrayList()) + .setTitle("title110371416") + .addAllBrands(new ArrayList()) + .setDescription("description-1724546052") + .setLanguageCode("languageCode-2092349083") + .putAllAttributes(new HashMap()) + .addAllTags(new ArrayList()) + .setPriceInfo(PriceInfo.newBuilder().build()) + .setRating(Rating.newBuilder().build()) + .setAvailableTime(Timestamp.newBuilder().build()) + .setAvailableQuantity(Int32Value.newBuilder().build()) + .addAllFulfillmentInfo(new ArrayList()) + .setUri("uri116076") + .addAllImages(new ArrayList()) + .setAudience(Audience.newBuilder().build()) + .setColorInfo(ColorInfo.newBuilder().build()) + .addAllSizes(new ArrayList()) + .addAllMaterials(new ArrayList()) + .addAllPatterns(new ArrayList()) + .addAllConditions(new ArrayList()) + .addAllPromotions(new ArrayList()) + .setPublishTime(Timestamp.newBuilder().build()) + .setRetrievableFields(FieldMask.newBuilder().build()) + .addAllVariants(new ArrayList()) + .build(); + mockProductService.addResponse(expectedResponse); + + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Product actualResponse = client.updateProduct(product, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateProductRequest actualRequest = ((UpdateProductRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + Product product = Product.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateProduct(product, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProductTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductService.addResponse(expectedResponse); + + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + client.deleteProduct(name); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = ((DeleteProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName name = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.deleteProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteProductTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockProductService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteProduct(name); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProductRequest actualRequest = ((DeleteProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String name = "name3373707"; + client.deleteProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importProductsTest() throws Exception { + ImportProductsResponse expectedResponse = + ImportProductsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importProductsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ImportProductsRequest request = + ImportProductsRequest.newBuilder() + .setParent(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") + .setInputConfig(ProductInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + + ImportProductsResponse actualResponse = client.importProductsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportProductsRequest actualRequest = ((ImportProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals(request.getErrorsConfig(), actualRequest.getErrorsConfig()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertEquals(request.getReconciliationMode(), actualRequest.getReconciliationMode()); + Assert.assertEquals( + request.getNotificationPubsubTopic(), actualRequest.getNotificationPubsubTopic()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ImportProductsRequest request = + ImportProductsRequest.newBuilder() + .setParent( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setRequestId("requestId693933066") + .setInputConfig(ProductInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") + .build(); + client.importProductsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void setInventoryTest() throws Exception { + SetInventoryResponse expectedResponse = SetInventoryResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setInventoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + + SetInventoryResponse actualResponse = client.setInventoryAsync(inventory, setMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetInventoryRequest actualRequest = ((SetInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(inventory, actualRequest.getInventory()); + Assert.assertEquals(setMask, actualRequest.getSetMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + Product inventory = Product.newBuilder().build(); + FieldMask setMask = FieldMask.newBuilder().build(); + client.setInventoryAsync(inventory, setMask).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 addFulfillmentPlacesTest() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.addFulfillmentPlacesAsync(product).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 addFulfillmentPlacesTest2() throws Exception { + AddFulfillmentPlacesResponse expectedResponse = + AddFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + AddFulfillmentPlacesResponse actualResponse = client.addFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddFulfillmentPlacesRequest actualRequest = + ((AddFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.addFulfillmentPlacesAsync(product).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 removeFulfillmentPlacesTest() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.removeFulfillmentPlacesAsync(product).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 removeFulfillmentPlacesTest2() throws Exception { + RemoveFulfillmentPlacesResponse expectedResponse = + RemoveFulfillmentPlacesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeFulfillmentPlacesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + RemoveFulfillmentPlacesResponse actualResponse = + client.removeFulfillmentPlacesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveFulfillmentPlacesRequest actualRequest = + ((RemoveFulfillmentPlacesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeFulfillmentPlacesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.removeFulfillmentPlacesAsync(product).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 addLocalInventoriesTest() throws Exception { + AddLocalInventoriesResponse expectedResponse = AddLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + AddLocalInventoriesResponse actualResponse = client.addLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddLocalInventoriesRequest actualRequest = ((AddLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addLocalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.addLocalInventoriesAsync(product).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 addLocalInventoriesTest2() throws Exception { + AddLocalInventoriesResponse expectedResponse = AddLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("addLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + AddLocalInventoriesResponse actualResponse = client.addLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddLocalInventoriesRequest actualRequest = ((AddLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addLocalInventoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.addLocalInventoriesAsync(product).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 removeLocalInventoriesTest() throws Exception { + RemoveLocalInventoriesResponse expectedResponse = + RemoveLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + + RemoveLocalInventoriesResponse actualResponse = + client.removeLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveLocalInventoriesRequest actualRequest = + ((RemoveLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product.toString(), actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeLocalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + ProductName product = + ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + client.removeLocalInventoriesAsync(product).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 removeLocalInventoriesTest2() throws Exception { + RemoveLocalInventoriesResponse expectedResponse = + RemoveLocalInventoriesResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("removeLocalInventoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProductService.addResponse(resultOperation); + + String product = "product-309474065"; + + RemoveLocalInventoriesResponse actualResponse = + client.removeLocalInventoriesAsync(product).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProductService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveLocalInventoriesRequest actualRequest = + ((RemoveLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(product, actualRequest.getProduct()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeLocalInventoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProductService.addException(exception); + + try { + String product = "product-309474065"; + client.removeLocalInventoriesAsync(product).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/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/SearchServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/SearchServiceClientTest.java new file mode 100644 index 00000000..6459a01e --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/SearchServiceClientTest.java @@ -0,0 +1,186 @@ +/* + * 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.SearchServiceClient.SearchPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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 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 SearchServiceClientTest { + private static MockSearchService mockSearchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSearchService = new MockSearchService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSearchService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SearchServiceSettings settings = + SearchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SearchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void searchTest() throws Exception { + SearchResponse.SearchResult responsesElement = SearchResponse.SearchResult.newBuilder().build(); + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockSearchService.addResponse(expectedResponse); + + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch(BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) + .build(); + + SearchPagedResponse pagedListResponse = client.search(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchRequest actualRequest = ((SearchRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPlacement(), actualRequest.getPlacement()); + Assert.assertEquals(request.getBranch(), actualRequest.getBranch()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getVisitorId(), actualRequest.getVisitorId()); + Assert.assertEquals(request.getUserInfo(), actualRequest.getUserInfo()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getOffset(), actualRequest.getOffset()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getCanonicalFilter(), actualRequest.getCanonicalFilter()); + Assert.assertEquals(request.getOrderBy(), actualRequest.getOrderBy()); + Assert.assertEquals(request.getFacetSpecsList(), actualRequest.getFacetSpecsList()); + Assert.assertEquals(request.getDynamicFacetSpec(), actualRequest.getDynamicFacetSpec()); + Assert.assertEquals(request.getBoostSpec(), actualRequest.getBoostSpec()); + Assert.assertEquals(request.getQueryExpansionSpec(), actualRequest.getQueryExpansionSpec()); + Assert.assertEquals( + request.getVariantRollupKeysList(), actualRequest.getVariantRollupKeysList()); + Assert.assertEquals(request.getPageCategoriesList(), actualRequest.getPageCategoriesList()); + Assert.assertEquals(request.getSearchMode(), actualRequest.getSearchMode()); + Assert.assertEquals(request.getPersonalizationSpec(), actualRequest.getPersonalizationSpec()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSearchService.addException(exception); + + try { + SearchRequest request = + SearchRequest.newBuilder() + .setPlacement("placement1792938725") + .setBranch( + BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + .setQuery("query107944136") + .setVisitorId("visitorId1880545833") + .setUserInfo(UserInfo.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setCanonicalFilter("canonicalFilter-722283124") + .setOrderBy("orderBy-1207110587") + .addAllFacetSpecs(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .addAllVariantRollupKeys(new ArrayList()) + .addAllPageCategories(new ArrayList()) + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) + .build(); + client.search(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java new file mode 100644 index 00000000..0a943586 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java @@ -0,0 +1,768 @@ +/* + * 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.ServingConfigServiceClient.ListServingConfigsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 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 ServingConfigServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockServingConfigService mockServingConfigService; + private LocalChannelProvider channelProvider; + private ServingConfigServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockServingConfigService = new MockServingConfigService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockServingConfigService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ServingConfigServiceSettings settings = + ServingConfigServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServingConfigServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + + ServingConfig actualResponse = + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServingConfigRequest actualRequest = ((CreateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(servingConfigId, actualRequest.getServingConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createServingConfigTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + + ServingConfig actualResponse = + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServingConfigRequest actualRequest = ((CreateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(servingConfigId, actualRequest.getServingConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String parent = "parent-995424086"; + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + String servingConfigId = "servingConfigId-831052759"; + client.createServingConfig(parent, servingConfig, servingConfigId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteServingConfigTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + client.deleteServingConfig(name); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServingConfigRequest actualRequest = ((DeleteServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.deleteServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteServingConfigTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockServingConfigService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteServingConfig(name); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServingConfigRequest actualRequest = ((DeleteServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String name = "name3373707"; + client.deleteServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ServingConfig actualResponse = client.updateServingConfig(servingConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServingConfigRequest actualRequest = ((UpdateServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfig servingConfig = ServingConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateServingConfig(servingConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServingConfigTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.getServingConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServingConfigRequest actualRequest = ((GetServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServingConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName name = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.getServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServingConfigTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String name = "name3373707"; + + ServingConfig actualResponse = client.getServingConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServingConfigRequest actualRequest = ((GetServingConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServingConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String name = "name3373707"; + client.getServingConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServingConfigsTest() throws Exception { + ServingConfig responsesElement = ServingConfig.newBuilder().build(); + ListServingConfigsResponse expectedResponse = + ListServingConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllServingConfigs(Arrays.asList(responsesElement)) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListServingConfigsPagedResponse pagedListResponse = client.listServingConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServingConfigsList().get(0), resources.get(0)); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServingConfigsRequest actualRequest = ((ListServingConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServingConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listServingConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServingConfigsTest2() throws Exception { + ServingConfig responsesElement = ServingConfig.newBuilder().build(); + ListServingConfigsResponse expectedResponse = + ListServingConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllServingConfigs(Arrays.asList(responsesElement)) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListServingConfigsPagedResponse pagedListResponse = client.listServingConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServingConfigsList().get(0), resources.get(0)); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServingConfigsRequest actualRequest = ((ListServingConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServingConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listServingConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addControlTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.addControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddControlRequest actualRequest = ((AddControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig.toString(), actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.addControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addControlTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String servingConfig = "servingConfig1237122670"; + + ServingConfig actualResponse = client.addControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddControlRequest actualRequest = ((AddControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String servingConfig = "servingConfig1237122670"; + client.addControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeControlTest() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + + ServingConfig actualResponse = client.removeControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveControlRequest actualRequest = ((RemoveControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig.toString(), actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeControlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + ServingConfigName servingConfig = + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"); + client.removeControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void removeControlTest2() throws Exception { + ServingConfig expectedResponse = + ServingConfig.newBuilder() + .setName( + ServingConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setModelId("modelId1226956324") + .setPriceRerankingLevel("priceRerankingLevel-1925548982") + .addAllFacetControlIds(new ArrayList()) + .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build()) + .addAllBoostControlIds(new ArrayList()) + .addAllFilterControlIds(new ArrayList()) + .addAllRedirectControlIds(new ArrayList()) + .addAllTwowaySynonymsControlIds(new ArrayList()) + .addAllOnewaySynonymsControlIds(new ArrayList()) + .addAllDoNotAssociateControlIds(new ArrayList()) + .addAllReplacementControlIds(new ArrayList()) + .addAllIgnoreControlIds(new ArrayList()) + .setDiversityLevel("diversityLevel578206123") + .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .addAllSolutionTypes(new ArrayList()) + .build(); + mockServingConfigService.addResponse(expectedResponse); + + String servingConfig = "servingConfig1237122670"; + + ServingConfig actualResponse = client.removeControl(servingConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServingConfigService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RemoveControlRequest actualRequest = ((RemoveControlRequest) actualRequests.get(0)); + + Assert.assertEquals(servingConfig, actualRequest.getServingConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void removeControlExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServingConfigService.addException(exception); + + try { + String servingConfig = "servingConfig1237122670"; + client.removeControl(servingConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/UserEventServiceClientTest.java b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/UserEventServiceClientTest.java new file mode 100644 index 00000000..c9813309 --- /dev/null +++ b/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/UserEventServiceClientTest.java @@ -0,0 +1,371 @@ +/* + * 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.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 UserEventServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockUserEventService mockUserEventService; + private LocalChannelProvider channelProvider; + private UserEventServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockUserEventService = new MockUserEventService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockUserEventService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + UserEventServiceSettings settings = + UserEventServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = UserEventServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void writeUserEventTest() throws Exception { + UserEvent expectedResponse = + UserEvent.newBuilder() + .setEventType("eventType31430900") + .setVisitorId("visitorId1880545833") + .setSessionId("sessionId607796817") + .setEventTime(Timestamp.newBuilder().build()) + .addAllExperimentIds(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllProductDetails(new ArrayList()) + .setCompletionDetail(CompletionDetail.newBuilder().build()) + .putAllAttributes(new HashMap()) + .setCartId("cartId-1367589797") + .setPurchaseTransaction(PurchaseTransaction.newBuilder().build()) + .setSearchQuery("searchQuery-552137728") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setOffset(-1019779949) + .addAllPageCategories(new ArrayList()) + .setUserInfo(UserInfo.newBuilder().build()) + .setUri("uri116076") + .setReferrerUri("referrerUri348088525") + .setPageViewId("pageViewId1362499087") + .build(); + mockUserEventService.addResponse(expectedResponse); + + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + + UserEvent actualResponse = client.writeUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteUserEventRequest actualRequest = ((WriteUserEventRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + client.writeUserEvent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void collectUserEventTest() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockUserEventService.addResponse(expectedResponse); + + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + + HttpBody actualResponse = client.collectUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CollectUserEventRequest actualRequest = ((CollectUserEventRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertEquals(request.getUri(), actualRequest.getUri()); + Assert.assertEquals(request.getEts(), actualRequest.getEts()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void collectUserEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent("parent-995424086") + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + client.collectUserEvent(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void purgeUserEventsTest() throws Exception { + PurgeUserEventsResponse expectedResponse = + PurgeUserEventsResponse.newBuilder().setPurgedEventsCount(-310774833).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent("parent-995424086") + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeUserEventsResponse actualResponse = client.purgeUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PurgeUserEventsRequest actualRequest = ((PurgeUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getForce(), actualRequest.getForce()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void purgeUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent("parent-995424086") + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void importUserEventsTest() throws Exception { + ImportUserEventsResponse expectedResponse = + ImportUserEventsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .setImportSummary(UserEventImportSummary.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(UserEventInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + + ImportUserEventsResponse actualResponse = client.importUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportUserEventsRequest actualRequest = ((ImportUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getInputConfig(), actualRequest.getInputConfig()); + Assert.assertEquals(request.getErrorsConfig(), actualRequest.getErrorsConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .setInputConfig(UserEventInputConfig.newBuilder().build()) + .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + .build(); + client.importUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void rejoinUserEventsTest() throws Exception { + RejoinUserEventsResponse expectedResponse = + RejoinUserEventsResponse.newBuilder().setRejoinedUserEventsCount(-1152281574).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("rejoinUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + RejoinUserEventsRequest request = + RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + + RejoinUserEventsResponse actualResponse = client.rejoinUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockUserEventService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RejoinUserEventsRequest actualRequest = ((RejoinUserEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getUserEventRejoinScope(), actualRequest.getUserEventRejoinScope()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rejoinUserEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockUserEventService.addException(exception); + + try { + RejoinUserEventsRequest request = + RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + client.rejoinUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/grpc-google-cloud-retail-v2alpha/pom.xml b/grpc-google-cloud-retail-v2alpha/pom.xml new file mode 100644 index 00000000..adf6b1e8 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + grpc-google-cloud-retail-v2alpha + GRPC library for google-cloud-retail + + com.google.cloud + google-cloud-retail-parent + 2.1.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-retail-v2alpha + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceGrpc.java new file mode 100644 index 00000000..3184aec3 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceGrpc.java @@ -0,0 +1,1791 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing catalog configuration.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/catalog_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CatalogServiceGrpc { + + private CatalogServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.CatalogService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListCatalogsRequest, + com.google.cloud.retail.v2alpha.ListCatalogsResponse> + getListCatalogsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCatalogs", + requestType = com.google.cloud.retail.v2alpha.ListCatalogsRequest.class, + responseType = com.google.cloud.retail.v2alpha.ListCatalogsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListCatalogsRequest, + com.google.cloud.retail.v2alpha.ListCatalogsResponse> + getListCatalogsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListCatalogsRequest, + com.google.cloud.retail.v2alpha.ListCatalogsResponse> + getListCatalogsMethod; + if ((getListCatalogsMethod = CatalogServiceGrpc.getListCatalogsMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getListCatalogsMethod = CatalogServiceGrpc.getListCatalogsMethod) == null) { + CatalogServiceGrpc.getListCatalogsMethod = + getListCatalogsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCatalogs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListCatalogsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListCatalogsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ListCatalogs")) + .build(); + } + } + } + return getListCatalogsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCatalogRequest, + com.google.cloud.retail.v2alpha.Catalog> + getUpdateCatalogMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCatalog", + requestType = com.google.cloud.retail.v2alpha.UpdateCatalogRequest.class, + responseType = com.google.cloud.retail.v2alpha.Catalog.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCatalogRequest, + com.google.cloud.retail.v2alpha.Catalog> + getUpdateCatalogMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCatalogRequest, + com.google.cloud.retail.v2alpha.Catalog> + getUpdateCatalogMethod; + if ((getUpdateCatalogMethod = CatalogServiceGrpc.getUpdateCatalogMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateCatalogMethod = CatalogServiceGrpc.getUpdateCatalogMethod) == null) { + CatalogServiceGrpc.getUpdateCatalogMethod = + getUpdateCatalogMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCatalog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateCatalog")) + .build(); + } + } + } + return getUpdateCatalogMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultBranch", + requestType = com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getSetDefaultBranchMethod = + getSetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("SetDefaultBranch")) + .build(); + } + } + } + return getSetDefaultBranchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDefaultBranch", + requestType = com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.class, + responseType = com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse> + getGetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getGetDefaultBranchMethod = + getGetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetDefaultBranch")) + .build(); + } + } + } + return getGetDefaultBranchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getGetCompletionConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCompletionConfig", + requestType = com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.CompletionConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getGetCompletionConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getGetCompletionConfigMethod; + if ((getGetCompletionConfigMethod = CatalogServiceGrpc.getGetCompletionConfigMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetCompletionConfigMethod = CatalogServiceGrpc.getGetCompletionConfigMethod) + == null) { + CatalogServiceGrpc.getGetCompletionConfigMethod = + getGetCompletionConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetCompletionConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CompletionConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetCompletionConfig")) + .build(); + } + } + } + return getGetCompletionConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getUpdateCompletionConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCompletionConfig", + requestType = com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.CompletionConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getUpdateCompletionConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig> + getUpdateCompletionConfigMethod; + if ((getUpdateCompletionConfigMethod = CatalogServiceGrpc.getUpdateCompletionConfigMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateCompletionConfigMethod = CatalogServiceGrpc.getUpdateCompletionConfigMethod) + == null) { + CatalogServiceGrpc.getUpdateCompletionConfigMethod = + getUpdateCompletionConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateCompletionConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CompletionConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateCompletionConfig")) + .build(); + } + } + } + return getUpdateCompletionConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getGetAttributesConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAttributesConfig", + requestType = com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getGetAttributesConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getGetAttributesConfigMethod; + if ((getGetAttributesConfigMethod = CatalogServiceGrpc.getGetAttributesConfigMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetAttributesConfigMethod = CatalogServiceGrpc.getGetAttributesConfigMethod) + == null) { + CatalogServiceGrpc.getGetAttributesConfigMethod = + getGetAttributesConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetAttributesConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AttributesConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetAttributesConfig")) + .build(); + } + } + } + return getGetAttributesConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getUpdateAttributesConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAttributesConfig", + requestType = com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getUpdateAttributesConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getUpdateAttributesConfigMethod; + if ((getUpdateAttributesConfigMethod = CatalogServiceGrpc.getUpdateAttributesConfigMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateAttributesConfigMethod = CatalogServiceGrpc.getUpdateAttributesConfigMethod) + == null) { + CatalogServiceGrpc.getUpdateAttributesConfigMethod = + getUpdateAttributesConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAttributesConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AttributesConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateAttributesConfig")) + .build(); + } + } + } + return getUpdateAttributesConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getAddCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddCatalogAttribute", + requestType = com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2alpha.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getAddCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getAddCatalogAttributeMethod; + if ((getAddCatalogAttributeMethod = CatalogServiceGrpc.getAddCatalogAttributeMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getAddCatalogAttributeMethod = CatalogServiceGrpc.getAddCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getAddCatalogAttributeMethod = + getAddCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AttributesConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("AddCatalogAttribute")) + .build(); + } + } + } + return getAddCatalogAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getRemoveCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveCatalogAttribute", + requestType = com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2alpha.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getRemoveCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getRemoveCatalogAttributeMethod; + if ((getRemoveCatalogAttributeMethod = CatalogServiceGrpc.getRemoveCatalogAttributeMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getRemoveCatalogAttributeMethod = CatalogServiceGrpc.getRemoveCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getRemoveCatalogAttributeMethod = + getRemoveCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AttributesConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("RemoveCatalogAttribute")) + .build(); + } + } + } + return getRemoveCatalogAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getReplaceCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReplaceCatalogAttribute", + requestType = com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2alpha.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getReplaceCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig> + getReplaceCatalogAttributeMethod; + if ((getReplaceCatalogAttributeMethod = CatalogServiceGrpc.getReplaceCatalogAttributeMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getReplaceCatalogAttributeMethod = CatalogServiceGrpc.getReplaceCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getReplaceCatalogAttributeMethod = + getReplaceCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ReplaceCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AttributesConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ReplaceCatalogAttribute")) + .build(); + } + } + } + return getReplaceCatalogAttributeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CatalogServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + }; + return CatalogServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CatalogServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + }; + return CatalogServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CatalogServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + }; + return CatalogServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public abstract static class CatalogServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated
+     * with the project.
+     * 
+ */ + public void listCatalogs( + com.google.cloud.retail.v2alpha.ListCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCatalogsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ */ + public void updateCatalog( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCatalogMethod(), responseObserver); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultBranchMethod(), responseObserver); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDefaultBranchMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig].
+     * 
+ */ + public void getCompletionConfig( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCompletionConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s.
+     * 
+ */ + public void updateCompletionConfig( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCompletionConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * 
+ */ + public void getAttributesConfig( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAttributesConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public void updateAttributesConfig( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAttributesConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void addCatalogAttribute( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddCatalogAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void removeCatalogAttribute( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveCatalogAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
+     * updating the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void replaceCatalogAttribute( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReplaceCatalogAttributeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListCatalogsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ListCatalogsRequest, + com.google.cloud.retail.v2alpha.ListCatalogsResponse>( + this, METHODID_LIST_CATALOGS))) + .addMethod( + getUpdateCatalogMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateCatalogRequest, + com.google.cloud.retail.v2alpha.Catalog>(this, METHODID_UPDATE_CATALOG))) + .addMethod( + getSetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest, + com.google.protobuf.Empty>(this, METHODID_SET_DEFAULT_BRANCH))) + .addMethod( + getGetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse>( + this, METHODID_GET_DEFAULT_BRANCH))) + .addMethod( + getGetCompletionConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig>( + this, METHODID_GET_COMPLETION_CONFIG))) + .addMethod( + getUpdateCompletionConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2alpha.CompletionConfig>( + this, METHODID_UPDATE_COMPLETION_CONFIG))) + .addMethod( + getGetAttributesConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig>( + this, METHODID_GET_ATTRIBUTES_CONFIG))) + .addMethod( + getUpdateAttributesConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2alpha.AttributesConfig>( + this, METHODID_UPDATE_ATTRIBUTES_CONFIG))) + .addMethod( + getAddCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig>( + this, METHODID_ADD_CATALOG_ATTRIBUTE))) + .addMethod( + getRemoveCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig>( + this, METHODID_REMOVE_CATALOG_ATTRIBUTE))) + .addMethod( + getReplaceCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2alpha.AttributesConfig>( + this, METHODID_REPLACE_CATALOG_ATTRIBUTE))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CatalogServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated
+     * with the project.
+     * 
+ */ + public void listCatalogs( + com.google.cloud.retail.v2alpha.ListCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCatalogsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ */ + public void updateCatalog( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCatalogMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig].
+     * 
+ */ + public void getCompletionConfig( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCompletionConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s.
+     * 
+ */ + public void updateCompletionConfig( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCompletionConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * 
+ */ + public void getAttributesConfig( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAttributesConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public void updateAttributesConfig( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAttributesConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void addCatalogAttribute( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void removeCatalogAttribute( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
+     * updating the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void replaceCatalogAttribute( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReplaceCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CatalogServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated
+     * with the project.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ListCatalogsResponse listCatalogs( + com.google.cloud.retail.v2alpha.ListCatalogsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCatalogsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Catalog updateCatalog( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCatalogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public com.google.protobuf.Empty setDefaultBranch( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultBranchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.GetDefaultBranchResponse getDefaultBranch( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDefaultBranchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig].
+     * 
+ */ + public com.google.cloud.retail.v2alpha.CompletionConfig getCompletionConfig( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCompletionConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.CompletionConfig updateCompletionConfig( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCompletionConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * 
+ */ + public com.google.cloud.retail.v2alpha.AttributesConfig getAttributesConfig( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAttributesConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.AttributesConfig updateAttributesConfig( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAttributesConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.AttributesConfig addCatalogAttribute( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddCatalogAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.AttributesConfig removeCatalogAttribute( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveCatalogAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
+     * updating the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.AttributesConfig replaceCatalogAttribute( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReplaceCatalogAttributeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CatalogServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated
+     * with the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ListCatalogsResponse> + listCatalogs(com.google.cloud.retail.v2alpha.ListCatalogsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCatalogsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Catalog> + updateCatalog(com.google.cloud.retail.v2alpha.UpdateCatalogRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCatalogMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultBranch(com.google.cloud.retail.v2alpha.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse> + getDefaultBranch(com.google.cloud.retail.v2alpha.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.CompletionConfig> + getCompletionConfig(com.google.cloud.retail.v2alpha.GetCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCompletionConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.CompletionConfig> + updateCompletionConfig( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCompletionConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.AttributesConfig> + getAttributesConfig(com.google.cloud.retail.v2alpha.GetAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAttributesConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.AttributesConfig> + updateAttributesConfig( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAttributesConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.AttributesConfig> + addCatalogAttribute(com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddCatalogAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.AttributesConfig> + removeCatalogAttribute( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveCatalogAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
+     * updating the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.AttributesConfig> + replaceCatalogAttribute( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReplaceCatalogAttributeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CATALOGS = 0; + private static final int METHODID_UPDATE_CATALOG = 1; + private static final int METHODID_SET_DEFAULT_BRANCH = 2; + private static final int METHODID_GET_DEFAULT_BRANCH = 3; + private static final int METHODID_GET_COMPLETION_CONFIG = 4; + private static final int METHODID_UPDATE_COMPLETION_CONFIG = 5; + private static final int METHODID_GET_ATTRIBUTES_CONFIG = 6; + 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 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 CatalogServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CatalogServiceImplBase 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_LIST_CATALOGS: + serviceImpl.listCatalogs( + (com.google.cloud.retail.v2alpha.ListCatalogsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CATALOG: + serviceImpl.updateCatalog( + (com.google.cloud.retail.v2alpha.UpdateCatalogRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SET_DEFAULT_BRANCH: + serviceImpl.setDefaultBranch( + (com.google.cloud.retail.v2alpha.SetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DEFAULT_BRANCH: + serviceImpl.getDefaultBranch( + (com.google.cloud.retail.v2alpha.GetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse>) + responseObserver); + break; + case METHODID_GET_COMPLETION_CONFIG: + serviceImpl.getCompletionConfig( + (com.google.cloud.retail.v2alpha.GetCompletionConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_COMPLETION_CONFIG: + serviceImpl.updateCompletionConfig( + (com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ATTRIBUTES_CONFIG: + serviceImpl.getAttributesConfig( + (com.google.cloud.retail.v2alpha.GetAttributesConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ATTRIBUTES_CONFIG: + serviceImpl.updateAttributesConfig( + (com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ADD_CATALOG_ATTRIBUTE: + serviceImpl.addCatalogAttribute( + (com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REMOVE_CATALOG_ATTRIBUTE: + serviceImpl.removeCatalogAttribute( + (com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPLACE_CATALOG_ATTRIBUTE: + serviceImpl.replaceCatalogAttribute( + (com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) 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 CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CatalogServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CatalogService"); + } + } + + private static final class CatalogServiceFileDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier { + CatalogServiceFileDescriptorSupplier() {} + } + + private static final class CatalogServiceMethodDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CatalogServiceMethodDescriptorSupplier(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 (CatalogServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CatalogServiceFileDescriptorSupplier()) + .addMethod(getListCatalogsMethod()) + .addMethod(getUpdateCatalogMethod()) + .addMethod(getSetDefaultBranchMethod()) + .addMethod(getGetDefaultBranchMethod()) + .addMethod(getGetCompletionConfigMethod()) + .addMethod(getUpdateCompletionConfigMethod()) + .addMethod(getGetAttributesConfigMethod()) + .addMethod(getUpdateAttributesConfigMethod()) + .addMethod(getAddCatalogAttributeMethod()) + .addMethod(getRemoveCatalogAttributeMethod()) + .addMethod(getReplaceCatalogAttributeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceGrpc.java new file mode 100644 index 00000000..43c0c438 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceGrpc.java @@ -0,0 +1,521 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * 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.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/completion_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CompletionServiceGrpc { + + private CompletionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.CompletionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CompleteQueryRequest, + com.google.cloud.retail.v2alpha.CompleteQueryResponse> + getCompleteQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CompleteQuery", + requestType = com.google.cloud.retail.v2alpha.CompleteQueryRequest.class, + responseType = com.google.cloud.retail.v2alpha.CompleteQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CompleteQueryRequest, + com.google.cloud.retail.v2alpha.CompleteQueryResponse> + getCompleteQueryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CompleteQueryRequest, + com.google.cloud.retail.v2alpha.CompleteQueryResponse> + getCompleteQueryMethod; + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + CompletionServiceGrpc.getCompleteQueryMethod = + getCompleteQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompleteQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CompleteQueryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CompleteQueryResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("CompleteQuery")) + .build(); + } + } + } + return getCompleteQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportCompletionData", + requestType = com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod; + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + CompletionServiceGrpc.getImportCompletionDataMethod = + getImportCompletionDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ImportCompletionData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("ImportCompletionData")) + .build(); + } + } + } + return getImportCompletionDataMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CompletionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + }; + return CompletionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CompletionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + }; + return CompletionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CompletionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + }; + return CompletionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public abstract static class CompletionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2alpha.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCompleteQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportCompletionDataMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCompleteQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.CompleteQueryRequest, + com.google.cloud.retail.v2alpha.CompleteQueryResponse>( + this, METHODID_COMPLETE_QUERY))) + .addMethod( + getImportCompletionDataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_COMPLETION_DATA))) + .build(); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CompletionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2alpha.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CompletionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse completeQuery( + com.google.cloud.retail.v2alpha.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCompleteQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public com.google.longrunning.Operation importCompletionData( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportCompletionDataMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CompletionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.CompleteQueryResponse> + completeQuery(com.google.cloud.retail.v2alpha.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importCompletionData(com.google.cloud.retail.v2alpha.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_COMPLETE_QUERY = 0; + private static final int METHODID_IMPORT_COMPLETION_DATA = 1; + + 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 CompletionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CompletionServiceImplBase 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_COMPLETE_QUERY: + serviceImpl.completeQuery( + (com.google.cloud.retail.v2alpha.CompleteQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_IMPORT_COMPLETION_DATA: + serviceImpl.importCompletionData( + (com.google.cloud.retail.v2alpha.ImportCompletionDataRequest) 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 CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CompletionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CompletionService"); + } + } + + private static final class CompletionServiceFileDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier { + CompletionServiceFileDescriptorSupplier() {} + } + + private static final class CompletionServiceMethodDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CompletionServiceMethodDescriptorSupplier(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 (CompletionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CompletionServiceFileDescriptorSupplier()) + .addMethod(getCompleteQueryMethod()) + .addMethod(getImportCompletionDataMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceGrpc.java new file mode 100644 index 00000000..7c782f8a --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceGrpc.java @@ -0,0 +1,854 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for modifying Control.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/control_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ControlServiceGrpc { + + private ControlServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.ControlService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getCreateControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateControl", + requestType = com.google.cloud.retail.v2alpha.CreateControlRequest.class, + responseType = com.google.cloud.retail.v2alpha.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getCreateControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getCreateControlMethod; + if ((getCreateControlMethod = ControlServiceGrpc.getCreateControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getCreateControlMethod = ControlServiceGrpc.getCreateControlMethod) == null) { + ControlServiceGrpc.getCreateControlMethod = + getCreateControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CreateControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Control.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("CreateControl")) + .build(); + } + } + } + return getCreateControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteControl", + requestType = com.google.cloud.retail.v2alpha.DeleteControlRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod; + if ((getDeleteControlMethod = ControlServiceGrpc.getDeleteControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getDeleteControlMethod = ControlServiceGrpc.getDeleteControlMethod) == null) { + ControlServiceGrpc.getDeleteControlMethod = + getDeleteControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.DeleteControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("DeleteControl")) + .build(); + } + } + } + return getDeleteControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getUpdateControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateControl", + requestType = com.google.cloud.retail.v2alpha.UpdateControlRequest.class, + responseType = com.google.cloud.retail.v2alpha.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getUpdateControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateControlRequest, + com.google.cloud.retail.v2alpha.Control> + getUpdateControlMethod; + if ((getUpdateControlMethod = ControlServiceGrpc.getUpdateControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getUpdateControlMethod = ControlServiceGrpc.getUpdateControlMethod) == null) { + ControlServiceGrpc.getUpdateControlMethod = + getUpdateControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Control.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("UpdateControl")) + .build(); + } + } + } + return getUpdateControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetControlRequest, + com.google.cloud.retail.v2alpha.Control> + getGetControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetControl", + requestType = com.google.cloud.retail.v2alpha.GetControlRequest.class, + responseType = com.google.cloud.retail.v2alpha.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetControlRequest, + com.google.cloud.retail.v2alpha.Control> + getGetControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetControlRequest, + com.google.cloud.retail.v2alpha.Control> + getGetControlMethod; + if ((getGetControlMethod = ControlServiceGrpc.getGetControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getGetControlMethod = ControlServiceGrpc.getGetControlMethod) == null) { + ControlServiceGrpc.getGetControlMethod = + getGetControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Control.getDefaultInstance())) + .setSchemaDescriptor(new ControlServiceMethodDescriptorSupplier("GetControl")) + .build(); + } + } + } + return getGetControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListControlsRequest, + com.google.cloud.retail.v2alpha.ListControlsResponse> + getListControlsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListControls", + requestType = com.google.cloud.retail.v2alpha.ListControlsRequest.class, + responseType = com.google.cloud.retail.v2alpha.ListControlsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListControlsRequest, + com.google.cloud.retail.v2alpha.ListControlsResponse> + getListControlsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListControlsRequest, + com.google.cloud.retail.v2alpha.ListControlsResponse> + getListControlsMethod; + if ((getListControlsMethod = ControlServiceGrpc.getListControlsMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getListControlsMethod = ControlServiceGrpc.getListControlsMethod) == null) { + ControlServiceGrpc.getListControlsMethod = + getListControlsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListControls")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListControlsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListControlsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("ListControls")) + .build(); + } + } + } + return getListControlsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ControlServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceStub(channel, callOptions); + } + }; + return ControlServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ControlServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceBlockingStub(channel, callOptions); + } + }; + return ControlServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ControlServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceFutureStub(channel, callOptions); + } + }; + return ControlServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public abstract static class ControlServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createControl( + com.google.cloud.retail.v2alpha.CreateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteControl( + com.google.cloud.retail.v2alpha.DeleteControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a Control.
+     * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different
+     * oneof field, if so an INVALID_ARGUMENT is returned. If the
+     * [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a
+     * NOT_FOUND error is returned.
+     * 
+ */ + public void updateControl( + com.google.cloud.retail.v2alpha.UpdateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public void getControl( + com.google.cloud.retail.v2alpha.GetControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public void listControls( + com.google.cloud.retail.v2alpha.ListControlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListControlsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.CreateControlRequest, + com.google.cloud.retail.v2alpha.Control>(this, METHODID_CREATE_CONTROL))) + .addMethod( + getDeleteControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.DeleteControlRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CONTROL))) + .addMethod( + getUpdateControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateControlRequest, + com.google.cloud.retail.v2alpha.Control>(this, METHODID_UPDATE_CONTROL))) + .addMethod( + getGetControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetControlRequest, + com.google.cloud.retail.v2alpha.Control>(this, METHODID_GET_CONTROL))) + .addMethod( + getListControlsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ListControlsRequest, + com.google.cloud.retail.v2alpha.ListControlsResponse>( + this, METHODID_LIST_CONTROLS))) + .build(); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ControlServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createControl( + com.google.cloud.retail.v2alpha.CreateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteControl( + com.google.cloud.retail.v2alpha.DeleteControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a Control.
+     * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different
+     * oneof field, if so an INVALID_ARGUMENT is returned. If the
+     * [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a
+     * NOT_FOUND error is returned.
+     * 
+ */ + public void updateControl( + com.google.cloud.retail.v2alpha.UpdateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public void getControl( + com.google.cloud.retail.v2alpha.GetControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetControlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public void listControls( + com.google.cloud.retail.v2alpha.ListControlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListControlsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ControlServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Control createControl( + com.google.cloud.retail.v2alpha.CreateControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.protobuf.Empty deleteControl( + com.google.cloud.retail.v2alpha.DeleteControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a Control.
+     * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different
+     * oneof field, if so an INVALID_ARGUMENT is returned. If the
+     * [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a
+     * NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Control updateControl( + com.google.cloud.retail.v2alpha.UpdateControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Control getControl( + com.google.cloud.retail.v2alpha.GetControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ListControlsResponse listControls( + com.google.cloud.retail.v2alpha.ListControlsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListControlsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ControlServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Control> + createControl(com.google.cloud.retail.v2alpha.CreateControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2alpha.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteControl(com.google.cloud.retail.v2alpha.DeleteControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a Control.
+     * [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different
+     * oneof field, if so an INVALID_ARGUMENT is returned. If the
+     * [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a
+     * NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Control> + updateControl(com.google.cloud.retail.v2alpha.UpdateControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Control> + getControl(com.google.cloud.retail.v2alpha.GetControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ListControlsResponse> + listControls(com.google.cloud.retail.v2alpha.ListControlsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListControlsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CONTROL = 0; + private static final int METHODID_DELETE_CONTROL = 1; + private static final int METHODID_UPDATE_CONTROL = 2; + private static final int METHODID_GET_CONTROL = 3; + private static final int METHODID_LIST_CONTROLS = 4; + + 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 ControlServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ControlServiceImplBase 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_CONTROL: + serviceImpl.createControl( + (com.google.cloud.retail.v2alpha.CreateControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CONTROL: + serviceImpl.deleteControl( + (com.google.cloud.retail.v2alpha.DeleteControlRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CONTROL: + serviceImpl.updateControl( + (com.google.cloud.retail.v2alpha.UpdateControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CONTROL: + serviceImpl.getControl( + (com.google.cloud.retail.v2alpha.GetControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CONTROLS: + serviceImpl.listControls( + (com.google.cloud.retail.v2alpha.ListControlsRequest) 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 ControlServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ControlServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ControlService"); + } + } + + private static final class ControlServiceFileDescriptorSupplier + extends ControlServiceBaseDescriptorSupplier { + ControlServiceFileDescriptorSupplier() {} + } + + private static final class ControlServiceMethodDescriptorSupplier + extends ControlServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ControlServiceMethodDescriptorSupplier(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 (ControlServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ControlServiceFileDescriptorSupplier()) + .addMethod(getCreateControlMethod()) + .addMethod(getDeleteControlMethod()) + .addMethod(getUpdateControlMethod()) + .addMethod(getGetControlMethod()) + .addMethod(getListControlsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceGrpc.java new file mode 100644 index 00000000..e92dc7fa --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceGrpc.java @@ -0,0 +1,358 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for making recommendation prediction.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/prediction_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.PredictionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PredictRequest, + com.google.cloud.retail.v2alpha.PredictResponse> + getPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Predict", + requestType = com.google.cloud.retail.v2alpha.PredictRequest.class, + responseType = com.google.cloud.retail.v2alpha.PredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PredictRequest, + com.google.cloud.retail.v2alpha.PredictResponse> + getPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PredictRequest, + com.google.cloud.retail.v2alpha.PredictResponse> + getPredictMethod; + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + PredictionServiceGrpc.getPredictMethod = + getPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.PredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.PredictResponse.getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict")) + .build(); + } + } + } + return getPredictMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PredictionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + }; + return PredictionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + }; + return PredictionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + }; + return PredictionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public abstract static class PredictionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public void predict( + com.google.cloud.retail.v2alpha.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPredictMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.PredictRequest, + com.google.cloud.retail.v2alpha.PredictResponse>(this, METHODID_PREDICT))) + .build(); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private PredictionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public void predict( + com.google.cloud.retail.v2alpha.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PredictionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.PredictResponse predict( + com.google.cloud.retail.v2alpha.PredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPredictMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PredictionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.PredictResponse> + predict(com.google.cloud.retail.v2alpha.PredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PREDICT = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final PredictionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PredictionServiceImplBase 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_PREDICT: + serviceImpl.predict( + (com.google.cloud.retail.v2alpha.PredictRequest) 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 PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionService"); + } + } + + private static final class PredictionServiceFileDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier { + PredictionServiceFileDescriptorSupplier() {} + } + + private static final class PredictionServiceMethodDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PredictionServiceMethodDescriptorSupplier(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 (PredictionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) + .addMethod(getPredictMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceGrpc.java new file mode 100644 index 00000000..dc55b473 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceGrpc.java @@ -0,0 +1,2060 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for ingesting [Product][google.cloud.retail.v2alpha.Product]
+ * information of the customer's website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/product_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ProductServiceGrpc { + + private ProductServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.ProductService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getCreateProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProduct", + requestType = com.google.cloud.retail.v2alpha.CreateProductRequest.class, + responseType = com.google.cloud.retail.v2alpha.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getCreateProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getCreateProductMethod; + if ((getCreateProductMethod = ProductServiceGrpc.getCreateProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getCreateProductMethod = ProductServiceGrpc.getCreateProductMethod) == null) { + ProductServiceGrpc.getCreateProductMethod = + getCreateProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CreateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Product.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("CreateProduct")) + .build(); + } + } + } + return getCreateProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetProductRequest, + com.google.cloud.retail.v2alpha.Product> + getGetProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProduct", + requestType = com.google.cloud.retail.v2alpha.GetProductRequest.class, + responseType = com.google.cloud.retail.v2alpha.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetProductRequest, + com.google.cloud.retail.v2alpha.Product> + getGetProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetProductRequest, + com.google.cloud.retail.v2alpha.Product> + getGetProductMethod; + if ((getGetProductMethod = ProductServiceGrpc.getGetProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getGetProductMethod = ProductServiceGrpc.getGetProductMethod) == null) { + ProductServiceGrpc.getGetProductMethod = + getGetProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductServiceMethodDescriptorSupplier("GetProduct")) + .build(); + } + } + } + return getGetProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListProductsRequest, + com.google.cloud.retail.v2alpha.ListProductsResponse> + getListProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProducts", + requestType = com.google.cloud.retail.v2alpha.ListProductsRequest.class, + responseType = com.google.cloud.retail.v2alpha.ListProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListProductsRequest, + com.google.cloud.retail.v2alpha.ListProductsResponse> + getListProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListProductsRequest, + com.google.cloud.retail.v2alpha.ListProductsResponse> + getListProductsMethod; + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + ProductServiceGrpc.getListProductsMethod = + getListProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListProductsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("ListProducts")) + .build(); + } + } + } + return getListProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getUpdateProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateProduct", + requestType = com.google.cloud.retail.v2alpha.UpdateProductRequest.class, + responseType = com.google.cloud.retail.v2alpha.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getUpdateProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateProductRequest, + com.google.cloud.retail.v2alpha.Product> + getUpdateProductMethod; + if ((getUpdateProductMethod = ProductServiceGrpc.getUpdateProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getUpdateProductMethod = ProductServiceGrpc.getUpdateProductMethod) == null) { + ProductServiceGrpc.getUpdateProductMethod = + getUpdateProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.Product.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("UpdateProduct")) + .build(); + } + } + } + return getUpdateProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProduct", + requestType = com.google.cloud.retail.v2alpha.DeleteProductRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod; + if ((getDeleteProductMethod = ProductServiceGrpc.getDeleteProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getDeleteProductMethod = ProductServiceGrpc.getDeleteProductMethod) == null) { + ProductServiceGrpc.getDeleteProductMethod = + getDeleteProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.DeleteProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("DeleteProduct")) + .build(); + } + } + } + return getDeleteProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeProductsRequest, com.google.longrunning.Operation> + getPurgeProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeProducts", + requestType = com.google.cloud.retail.v2alpha.PurgeProductsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeProductsRequest, com.google.longrunning.Operation> + getPurgeProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeProductsRequest, com.google.longrunning.Operation> + getPurgeProductsMethod; + if ((getPurgeProductsMethod = ProductServiceGrpc.getPurgeProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getPurgeProductsMethod = ProductServiceGrpc.getPurgeProductsMethod) == null) { + ProductServiceGrpc.getPurgeProductsMethod = + getPurgeProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.PurgeProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("PurgeProducts")) + .build(); + } + } + } + return getPurgeProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportProducts", + requestType = com.google.cloud.retail.v2alpha.ImportProductsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod; + if ((getImportProductsMethod = ProductServiceGrpc.getImportProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getImportProductsMethod = ProductServiceGrpc.getImportProductsMethod) == null) { + ProductServiceGrpc.getImportProductsMethod = + getImportProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ImportProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("ImportProducts")) + .build(); + } + } + } + return getImportProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetInventory", + requestType = com.google.cloud.retail.v2alpha.SetInventoryRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + ProductServiceGrpc.getSetInventoryMethod = + getSetInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.SetInventoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("SetInventory")) + .build(); + } + } + } + return getSetInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddFulfillmentPlaces", + requestType = com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getAddFulfillmentPlacesMethod = + getAddFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("AddFulfillmentPlaces")) + .build(); + } + } + } + return getAddFulfillmentPlacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveFulfillmentPlaces", + requestType = com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getRemoveFulfillmentPlacesMethod = + getRemoveFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("RemoveFulfillmentPlaces")) + .build(); + } + } + } + return getRemoveFulfillmentPlacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddLocalInventories", + requestType = com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod; + if ((getAddLocalInventoriesMethod = ProductServiceGrpc.getAddLocalInventoriesMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getAddLocalInventoriesMethod = ProductServiceGrpc.getAddLocalInventoriesMethod) + == null) { + ProductServiceGrpc.getAddLocalInventoriesMethod = + getAddLocalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddLocalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("AddLocalInventories")) + .build(); + } + } + } + return getAddLocalInventoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveLocalInventories", + requestType = com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod; + if ((getRemoveLocalInventoriesMethod = ProductServiceGrpc.getRemoveLocalInventoriesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getRemoveLocalInventoriesMethod = ProductServiceGrpc.getRemoveLocalInventoriesMethod) + == null) { + ProductServiceGrpc.getRemoveLocalInventoriesMethod = + getRemoveLocalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveLocalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("RemoveLocalInventories")) + .build(); + } + } + } + return getRemoveLocalInventoriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ProductServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceStub(channel, callOptions); + } + }; + return ProductServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ProductServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceBlockingStub(channel, callOptions); + } + }; + return ProductServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ProductServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceFutureStub(channel, callOptions); + } + }; + return ProductServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2alpha.Product]
+   * information of the customer's website.
+   * 
+ */ + public abstract static class ProductServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void createProduct( + com.google.cloud.retail.v2alpha.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void getProduct( + com.google.cloud.retail.v2alpha.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2alpha.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void updateProduct( + com.google.cloud.retail.v2alpha.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void deleteProduct( + com.google.cloud.retail.v2alpha.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Product][google.cloud.retail.v2alpha.Product]s under a branch.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed offline. Depending on the number of
+     * [Product][google.cloud.retail.v2alpha.Product]s, this operation could take
+     * hours to complete. Before the operation completes, some
+     * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+     * this operation could take hours to complete. To get a sample of
+     * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+     * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force]
+     * to false.
+     * 
+ */ + public void purgeProducts( + com.google.cloud.retail.v2alpha.PurgeProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPurgeProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
+     * 
+ */ + public void importProducts( + com.google.cloud.retail.v2alpha.ImportProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * or
+     * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct]
+     * request.
+     * If no inventory fields are set in
+     * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product],
+     * then any pre-existing inventory information for this product will be used.
+     * If no inventory fields are set in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask],
+     * then any existing inventory information will be preserved.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces],
+     * and
+     * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2alpha.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddFulfillmentPlacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveFulfillmentPlacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void addLocalInventories( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddLocalInventoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void removeLocalInventories( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveLocalInventoriesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.CreateProductRequest, + com.google.cloud.retail.v2alpha.Product>(this, METHODID_CREATE_PRODUCT))) + .addMethod( + getGetProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetProductRequest, + com.google.cloud.retail.v2alpha.Product>(this, METHODID_GET_PRODUCT))) + .addMethod( + getListProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ListProductsRequest, + com.google.cloud.retail.v2alpha.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) + .addMethod( + getUpdateProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateProductRequest, + com.google.cloud.retail.v2alpha.Product>(this, METHODID_UPDATE_PRODUCT))) + .addMethod( + getDeleteProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.DeleteProductRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PRODUCT))) + .addMethod( + getPurgeProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.PurgeProductsRequest, + com.google.longrunning.Operation>(this, METHODID_PURGE_PRODUCTS))) + .addMethod( + getImportProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ImportProductsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_PRODUCTS))) + .addMethod( + getSetInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.SetInventoryRequest, + com.google.longrunning.Operation>(this, METHODID_SET_INVENTORY))) + .addMethod( + getAddFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_FULFILLMENT_PLACES))) + .addMethod( + getRemoveFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_FULFILLMENT_PLACES))) + .addMethod( + getAddLocalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_LOCAL_INVENTORIES))) + .addMethod( + getRemoveLocalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_LOCAL_INVENTORIES))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2alpha.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ProductServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void createProduct( + com.google.cloud.retail.v2alpha.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void getProduct( + com.google.cloud.retail.v2alpha.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProductMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2alpha.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void updateProduct( + com.google.cloud.retail.v2alpha.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public void deleteProduct( + com.google.cloud.retail.v2alpha.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Product][google.cloud.retail.v2alpha.Product]s under a branch.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed offline. Depending on the number of
+     * [Product][google.cloud.retail.v2alpha.Product]s, this operation could take
+     * hours to complete. Before the operation completes, some
+     * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+     * this operation could take hours to complete. To get a sample of
+     * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+     * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force]
+     * to false.
+     * 
+ */ + public void purgeProducts( + com.google.cloud.retail.v2alpha.PurgeProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPurgeProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
+     * 
+ */ + public void importProducts( + com.google.cloud.retail.v2alpha.ImportProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * or
+     * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct]
+     * request.
+     * If no inventory fields are set in
+     * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product],
+     * then any pre-existing inventory information for this product will be used.
+     * If no inventory fields are set in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask],
+     * then any existing inventory information will be preserved.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces],
+     * and
+     * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2alpha.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void addLocalInventories( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddLocalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public void removeLocalInventories( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveLocalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2alpha.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ProductServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Product createProduct( + com.google.cloud.retail.v2alpha.CreateProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Product getProduct( + com.google.cloud.retail.v2alpha.GetProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ListProductsResponse listProducts( + com.google.cloud.retail.v2alpha.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.cloud.retail.v2alpha.Product updateProduct( + com.google.cloud.retail.v2alpha.UpdateProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.protobuf.Empty deleteProduct( + com.google.cloud.retail.v2alpha.DeleteProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Product][google.cloud.retail.v2alpha.Product]s under a branch.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed offline. Depending on the number of
+     * [Product][google.cloud.retail.v2alpha.Product]s, this operation could take
+     * hours to complete. Before the operation completes, some
+     * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+     * this operation could take hours to complete. To get a sample of
+     * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+     * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force]
+     * to false.
+     * 
+ */ + public com.google.longrunning.Operation purgeProducts( + com.google.cloud.retail.v2alpha.PurgeProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPurgeProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
+     * 
+ */ + public com.google.longrunning.Operation importProducts( + com.google.cloud.retail.v2alpha.ImportProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * or
+     * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct]
+     * request.
+     * If no inventory fields are set in
+     * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product],
+     * then any pre-existing inventory information for this product will be used.
+     * If no inventory fields are set in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask],
+     * then any existing inventory information will be preserved.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces],
+     * and
+     * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.longrunning.Operation setInventory( + com.google.cloud.retail.v2alpha.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.longrunning.Operation addFulfillmentPlaces( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddFulfillmentPlacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.longrunning.Operation removeFulfillmentPlaces( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveFulfillmentPlacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.longrunning.Operation addLocalInventories( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddLocalInventoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.longrunning.Operation removeLocalInventories( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveLocalInventoriesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2alpha.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ProductServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Product> + createProduct(com.google.cloud.retail.v2alpha.CreateProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Product> + getProduct(com.google.cloud.retail.v2alpha.GetProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ListProductsResponse> + listProducts(com.google.cloud.retail.v2alpha.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.Product> + updateProduct(com.google.cloud.retail.v2alpha.UpdateProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProduct(com.google.cloud.retail.v2alpha.DeleteProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Product][google.cloud.retail.v2alpha.Product]s under a branch.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed offline. Depending on the number of
+     * [Product][google.cloud.retail.v2alpha.Product]s, this operation could take
+     * hours to complete. Before the operation completes, some
+     * [Product][google.cloud.retail.v2alpha.Product]s may still be returned by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s,
+     * this operation could take hours to complete. To get a sample of
+     * [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set
+     * [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force]
+     * to false.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + purgeProducts(com.google.cloud.retail.v2alpha.PurgeProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPurgeProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importProducts(com.google.cloud.retail.v2alpha.ImportProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * or
+     * [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct]
+     * request.
+     * If no inventory fields are set in
+     * [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product],
+     * then any pre-existing inventory information for this product will be used.
+     * If no inventory fields are set in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask],
+     * then any existing inventory information will be preserved.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces],
+     * and
+     * [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setInventory(com.google.cloud.retail.v2alpha.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addFulfillmentPlaces(com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removeFulfillmentPlaces( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2alpha.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addLocalInventories(com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddLocalInventoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2alpha.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2alpha.Product] queried by
+     * [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct]
+     * and
+     * [UpdateProduct][google.cloud.retail.v2alpha.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removeLocalInventories( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveLocalInventoriesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PRODUCT = 0; + private static final int METHODID_GET_PRODUCT = 1; + private static final int METHODID_LIST_PRODUCTS = 2; + private static final int METHODID_UPDATE_PRODUCT = 3; + private static final int METHODID_DELETE_PRODUCT = 4; + private static final int METHODID_PURGE_PRODUCTS = 5; + private static final int METHODID_IMPORT_PRODUCTS = 6; + private static final int METHODID_SET_INVENTORY = 7; + private static final int METHODID_ADD_FULFILLMENT_PLACES = 8; + private static final int METHODID_REMOVE_FULFILLMENT_PLACES = 9; + private static final int METHODID_ADD_LOCAL_INVENTORIES = 10; + private static final int METHODID_REMOVE_LOCAL_INVENTORIES = 11; + + 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 ProductServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ProductServiceImplBase 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_PRODUCT: + serviceImpl.createProduct( + (com.google.cloud.retail.v2alpha.CreateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PRODUCT: + serviceImpl.getProduct( + (com.google.cloud.retail.v2alpha.GetProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts( + (com.google.cloud.retail.v2alpha.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRODUCT: + serviceImpl.updateProduct( + (com.google.cloud.retail.v2alpha.UpdateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PRODUCT: + serviceImpl.deleteProduct( + (com.google.cloud.retail.v2alpha.DeleteProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PURGE_PRODUCTS: + serviceImpl.purgeProducts( + (com.google.cloud.retail.v2alpha.PurgeProductsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_PRODUCTS: + serviceImpl.importProducts( + (com.google.cloud.retail.v2alpha.ImportProductsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_INVENTORY: + serviceImpl.setInventory( + (com.google.cloud.retail.v2alpha.SetInventoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_FULFILLMENT_PLACES: + serviceImpl.addFulfillmentPlaces( + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_FULFILLMENT_PLACES: + serviceImpl.removeFulfillmentPlaces( + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_LOCAL_INVENTORIES: + serviceImpl.addLocalInventories( + (com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_LOCAL_INVENTORIES: + serviceImpl.removeLocalInventories( + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) 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 ProductServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProductServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ProductService"); + } + } + + private static final class ProductServiceFileDescriptorSupplier + extends ProductServiceBaseDescriptorSupplier { + ProductServiceFileDescriptorSupplier() {} + } + + private static final class ProductServiceMethodDescriptorSupplier + extends ProductServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ProductServiceMethodDescriptorSupplier(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 (ProductServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ProductServiceFileDescriptorSupplier()) + .addMethod(getCreateProductMethod()) + .addMethod(getGetProductMethod()) + .addMethod(getListProductsMethod()) + .addMethod(getUpdateProductMethod()) + .addMethod(getDeleteProductMethod()) + .addMethod(getPurgeProductsMethod()) + .addMethod(getImportProductsMethod()) + .addMethod(getSetInventoryMethod()) + .addMethod(getAddFulfillmentPlacesMethod()) + .addMethod(getRemoveFulfillmentPlacesMethod()) + .addMethod(getAddLocalInventoriesMethod()) + .addMethod(getRemoveLocalInventoriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceGrpc.java new file mode 100644 index 00000000..a0cad11b --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceGrpc.java @@ -0,0 +1,374 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * 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.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/search_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SearchServiceGrpc { + + private SearchServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.SearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SearchRequest, + com.google.cloud.retail.v2alpha.SearchResponse> + getSearchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Search", + requestType = com.google.cloud.retail.v2alpha.SearchRequest.class, + responseType = com.google.cloud.retail.v2alpha.SearchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SearchRequest, + com.google.cloud.retail.v2alpha.SearchResponse> + getSearchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.SearchRequest, + com.google.cloud.retail.v2alpha.SearchResponse> + getSearchMethod; + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + synchronized (SearchServiceGrpc.class) { + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + SearchServiceGrpc.getSearchMethod = + getSearchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Search")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.SearchRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.SearchResponse.getDefaultInstance())) + .setSchemaDescriptor(new SearchServiceMethodDescriptorSupplier("Search")) + .build(); + } + } + } + return getSearchMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SearchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + }; + return SearchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SearchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + }; + return SearchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SearchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + }; + return SearchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public abstract static class SearchServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2alpha.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSearchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.SearchRequest, + com.google.cloud.retail.v2alpha.SearchResponse>(this, METHODID_SEARCH))) + .build(); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SearchServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2alpha.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SearchServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.SearchResponse search( + com.google.cloud.retail.v2alpha.SearchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SearchServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.SearchResponse> + search(com.google.cloud.retail.v2alpha.SearchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SEARCH = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SearchServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SearchServiceImplBase 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_SEARCH: + serviceImpl.search( + (com.google.cloud.retail.v2alpha.SearchRequest) 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 SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SearchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SearchService"); + } + } + + private static final class SearchServiceFileDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier { + SearchServiceFileDescriptorSupplier() {} + } + + private static final class SearchServiceMethodDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SearchServiceMethodDescriptorSupplier(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 (SearchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SearchServiceFileDescriptorSupplier()) + .addMethod(getSearchMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceGrpc.java new file mode 100644 index 00000000..c3a50e59 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceGrpc.java @@ -0,0 +1,1147 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for modifying ServingConfig.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/serving_config_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ServingConfigServiceGrpc { + + private ServingConfigServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.ServingConfigService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getCreateServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateServingConfig", + requestType = com.google.cloud.retail.v2alpha.CreateServingConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getCreateServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CreateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getCreateServingConfigMethod; + if ((getCreateServingConfigMethod = ServingConfigServiceGrpc.getCreateServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getCreateServingConfigMethod = ServingConfigServiceGrpc.getCreateServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getCreateServingConfigMethod = + getCreateServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("CreateServingConfig")) + .build(); + } + } + } + return getCreateServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteServingConfig", + requestType = com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod; + if ((getDeleteServingConfigMethod = ServingConfigServiceGrpc.getDeleteServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getDeleteServingConfigMethod = ServingConfigServiceGrpc.getDeleteServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getDeleteServingConfigMethod = + getDeleteServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("DeleteServingConfig")) + .build(); + } + } + } + return getDeleteServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getUpdateServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateServingConfig", + requestType = com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getUpdateServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getUpdateServingConfigMethod; + if ((getUpdateServingConfigMethod = ServingConfigServiceGrpc.getUpdateServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getUpdateServingConfigMethod = ServingConfigServiceGrpc.getUpdateServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getUpdateServingConfigMethod = + getUpdateServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("UpdateServingConfig")) + .build(); + } + } + } + return getUpdateServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getGetServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetServingConfig", + requestType = com.google.cloud.retail.v2alpha.GetServingConfigRequest.class, + responseType = com.google.cloud.retail.v2alpha.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getGetServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.GetServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getGetServingConfigMethod; + if ((getGetServingConfigMethod = ServingConfigServiceGrpc.getGetServingConfigMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getGetServingConfigMethod = ServingConfigServiceGrpc.getGetServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getGetServingConfigMethod = + getGetServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.GetServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("GetServingConfig")) + .build(); + } + } + } + return getGetServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListServingConfigsRequest, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse> + getListServingConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServingConfigs", + requestType = com.google.cloud.retail.v2alpha.ListServingConfigsRequest.class, + responseType = com.google.cloud.retail.v2alpha.ListServingConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListServingConfigsRequest, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse> + getListServingConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ListServingConfigsRequest, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse> + getListServingConfigsMethod; + if ((getListServingConfigsMethod = ServingConfigServiceGrpc.getListServingConfigsMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getListServingConfigsMethod = ServingConfigServiceGrpc.getListServingConfigsMethod) + == null) { + ServingConfigServiceGrpc.getListServingConfigsMethod = + getListServingConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServingConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ListServingConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("ListServingConfigs")) + .build(); + } + } + } + return getListServingConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getAddControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddControl", + requestType = com.google.cloud.retail.v2alpha.AddControlRequest.class, + responseType = com.google.cloud.retail.v2alpha.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getAddControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.AddControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getAddControlMethod; + if ((getAddControlMethod = ServingConfigServiceGrpc.getAddControlMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getAddControlMethod = ServingConfigServiceGrpc.getAddControlMethod) == null) { + ServingConfigServiceGrpc.getAddControlMethod = + getAddControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.AddControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("AddControl")) + .build(); + } + } + } + return getAddControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getRemoveControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveControl", + requestType = com.google.cloud.retail.v2alpha.RemoveControlRequest.class, + responseType = com.google.cloud.retail.v2alpha.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getRemoveControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RemoveControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig> + getRemoveControlMethod; + if ((getRemoveControlMethod = ServingConfigServiceGrpc.getRemoveControlMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getRemoveControlMethod = ServingConfigServiceGrpc.getRemoveControlMethod) == null) { + ServingConfigServiceGrpc.getRemoveControlMethod = + getRemoveControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.RemoveControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("RemoveControl")) + .build(); + } + } + } + return getRemoveControlMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ServingConfigServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceStub(channel, callOptions); + } + }; + return ServingConfigServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServingConfigServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceBlockingStub(channel, callOptions); + } + }; + return ServingConfigServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ServingConfigServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceFutureStub(channel, callOptions); + } + }; + return ServingConfigServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public abstract static class ServingConfigServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+     * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a
+     * FAILED_PRECONDITION error is returned.
+     * 
+ */ + public void createServingConfig( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void deleteServingConfig( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public void updateServingConfig( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void getServingConfig( + com.google.cloud.retail.v2alpha.GetServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public void listServingConfigs( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServingConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public void addControl( + com.google.cloud.retail.v2alpha.AddControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAddControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public void removeControl( + com.google.cloud.retail.v2alpha.RemoveControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveControlMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.CreateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig>( + this, METHODID_CREATE_SERVING_CONFIG))) + .addMethod( + getDeleteServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SERVING_CONFIG))) + .addMethod( + getUpdateServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig>( + this, METHODID_UPDATE_SERVING_CONFIG))) + .addMethod( + getGetServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.GetServingConfigRequest, + com.google.cloud.retail.v2alpha.ServingConfig>( + this, METHODID_GET_SERVING_CONFIG))) + .addMethod( + getListServingConfigsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ListServingConfigsRequest, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse>( + this, METHODID_LIST_SERVING_CONFIGS))) + .addMethod( + getAddControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.AddControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig>(this, METHODID_ADD_CONTROL))) + .addMethod( + getRemoveControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.RemoveControlRequest, + com.google.cloud.retail.v2alpha.ServingConfig>( + this, METHODID_REMOVE_CONTROL))) + .build(); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ServingConfigServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+     * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a
+     * FAILED_PRECONDITION error is returned.
+     * 
+ */ + public void createServingConfig( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void deleteServingConfig( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public void updateServingConfig( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void getServingConfig( + com.google.cloud.retail.v2alpha.GetServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public void listServingConfigs( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServingConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public void addControl( + com.google.cloud.retail.v2alpha.AddControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddControlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public void removeControl( + com.google.cloud.retail.v2alpha.RemoveControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveControlMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ServingConfigServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+     * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a
+     * FAILED_PRECONDITION error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ServingConfig createServingConfig( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteServingConfig( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ServingConfig updateServingConfig( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfig( + com.google.cloud.retail.v2alpha.GetServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ListServingConfigsResponse listServingConfigs( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServingConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ServingConfig addControl( + com.google.cloud.retail.v2alpha.AddControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.ServingConfig removeControl( + com.google.cloud.retail.v2alpha.RemoveControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveControlMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ServingConfigServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in
+     * a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a
+     * FAILED_PRECONDITION error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ServingConfig> + createServingConfig(com.google.cloud.retail.v2alpha.CreateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteServingConfig(com.google.cloud.retail.v2alpha.DeleteServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ServingConfig> + updateServingConfig(com.google.cloud.retail.v2alpha.UpdateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ServingConfig> + getServingConfig(com.google.cloud.retail.v2alpha.GetServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ListServingConfigsResponse> + listServingConfigs(com.google.cloud.retail.v2alpha.ListServingConfigsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServingConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ServingConfig> + addControl(com.google.cloud.retail.v2alpha.AddControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.ServingConfig> + removeControl(com.google.cloud.retail.v2alpha.RemoveControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveControlMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SERVING_CONFIG = 0; + private static final int METHODID_DELETE_SERVING_CONFIG = 1; + private static final int METHODID_UPDATE_SERVING_CONFIG = 2; + private static final int METHODID_GET_SERVING_CONFIG = 3; + private static final int METHODID_LIST_SERVING_CONFIGS = 4; + private static final int METHODID_ADD_CONTROL = 5; + private static final int METHODID_REMOVE_CONTROL = 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 ServingConfigServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServingConfigServiceImplBase 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_SERVING_CONFIG: + serviceImpl.createServingConfig( + (com.google.cloud.retail.v2alpha.CreateServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SERVING_CONFIG: + serviceImpl.deleteServingConfig( + (com.google.cloud.retail.v2alpha.DeleteServingConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SERVING_CONFIG: + serviceImpl.updateServingConfig( + (com.google.cloud.retail.v2alpha.UpdateServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SERVING_CONFIG: + serviceImpl.getServingConfig( + (com.google.cloud.retail.v2alpha.GetServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVING_CONFIGS: + serviceImpl.listServingConfigs( + (com.google.cloud.retail.v2alpha.ListServingConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2alpha.ListServingConfigsResponse>) + responseObserver); + break; + case METHODID_ADD_CONTROL: + serviceImpl.addControl( + (com.google.cloud.retail.v2alpha.AddControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REMOVE_CONTROL: + serviceImpl.removeControl( + (com.google.cloud.retail.v2alpha.RemoveControlRequest) 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 ServingConfigServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServingConfigServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServingConfigService"); + } + } + + private static final class ServingConfigServiceFileDescriptorSupplier + extends ServingConfigServiceBaseDescriptorSupplier { + ServingConfigServiceFileDescriptorSupplier() {} + } + + private static final class ServingConfigServiceMethodDescriptorSupplier + extends ServingConfigServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServingConfigServiceMethodDescriptorSupplier(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 (ServingConfigServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServingConfigServiceFileDescriptorSupplier()) + .addMethod(getCreateServingConfigMethod()) + .addMethod(getDeleteServingConfigMethod()) + .addMethod(getUpdateServingConfigMethod()) + .addMethod(getGetServingConfigMethod()) + .addMethod(getListServingConfigsMethod()) + .addMethod(getAddControlMethod()) + .addMethod(getRemoveControlMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceGrpc.java b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceGrpc.java new file mode 100644 index 00000000..cfb3c135 --- /dev/null +++ b/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceGrpc.java @@ -0,0 +1,882 @@ +/* + * 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.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for ingesting end user actions on the customer website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/user_event_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class UserEventServiceGrpc { + + private UserEventServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2alpha.UserEventService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.WriteUserEventRequest, + com.google.cloud.retail.v2alpha.UserEvent> + getWriteUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteUserEvent", + requestType = com.google.cloud.retail.v2alpha.WriteUserEventRequest.class, + responseType = com.google.cloud.retail.v2alpha.UserEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.WriteUserEventRequest, + com.google.cloud.retail.v2alpha.UserEvent> + getWriteUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.WriteUserEventRequest, + com.google.cloud.retail.v2alpha.UserEvent> + getWriteUserEventMethod; + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + UserEventServiceGrpc.getWriteUserEventMethod = + getWriteUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.WriteUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("WriteUserEvent")) + .build(); + } + } + } + return getWriteUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CollectUserEvent", + requestType = com.google.cloud.retail.v2alpha.CollectUserEventRequest.class, + responseType = com.google.api.HttpBody.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod; + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + UserEventServiceGrpc.getCollectUserEventMethod = + getCollectUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CollectUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.CollectUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.HttpBody.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("CollectUserEvent")) + .build(); + } + } + } + return getCollectUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest, com.google.longrunning.Operation> + getPurgeUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeUserEvents", + requestType = com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest, com.google.longrunning.Operation> + getPurgeUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod; + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + UserEventServiceGrpc.getPurgeUserEventsMethod = + getPurgeUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("PurgeUserEvents")) + .build(); + } + } + } + return getPurgeUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportUserEventsRequest, com.google.longrunning.Operation> + getImportUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportUserEvents", + requestType = com.google.cloud.retail.v2alpha.ImportUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportUserEventsRequest, com.google.longrunning.Operation> + getImportUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod; + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + UserEventServiceGrpc.getImportUserEventsMethod = + getImportUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("ImportUserEvents")) + .build(); + } + } + } + return getImportUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest, com.google.longrunning.Operation> + getRejoinUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RejoinUserEvents", + requestType = com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest, com.google.longrunning.Operation> + getRejoinUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest, + com.google.longrunning.Operation> + getRejoinUserEventsMethod; + if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { + UserEventServiceGrpc.getRejoinUserEventsMethod = + getRejoinUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RejoinUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("RejoinUserEvents")) + .build(); + } + } + } + return getRejoinUserEventsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static UserEventServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + }; + return UserEventServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static UserEventServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + }; + return UserEventServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static UserEventServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + }; + return UserEventServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public abstract static class UserEventServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.retail.v2alpha.WriteUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getWriteUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.retail.v2alpha.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCollectUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPurgeUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void rejoinUserEvents( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRejoinUserEventsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getWriteUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.WriteUserEventRequest, + com.google.cloud.retail.v2alpha.UserEvent>(this, METHODID_WRITE_USER_EVENT))) + .addMethod( + getCollectUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.CollectUserEventRequest, + com.google.api.HttpBody>(this, METHODID_COLLECT_USER_EVENT))) + .addMethod( + getPurgeUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_PURGE_USER_EVENTS))) + .addMethod( + getImportUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ImportUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_USER_EVENTS))) + .addMethod( + getRejoinUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_REJOIN_USER_EVENTS))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private UserEventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.retail.v2alpha.WriteUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.retail.v2alpha.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void rejoinUserEvents( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private UserEventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.cloud.retail.v2alpha.UserEvent writeUserEvent( + com.google.cloud.retail.v2alpha.WriteUserEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWriteUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public com.google.api.HttpBody collectUserEvent( + com.google.cloud.retail.v2alpha.CollectUserEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCollectUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.longrunning.Operation purgeUserEvents( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPurgeUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation importUserEvents( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation rejoinUserEvents( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRejoinUserEventsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private UserEventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2alpha.UserEvent> + writeUserEvent(com.google.cloud.retail.v2alpha.WriteUserEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + collectUserEvent(com.google.cloud.retail.v2alpha.CollectUserEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + purgeUserEvents(com.google.cloud.retail.v2alpha.PurgeUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importUserEvents(com.google.cloud.retail.v2alpha.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rejoinUserEvents(com.google.cloud.retail.v2alpha.RejoinUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_WRITE_USER_EVENT = 0; + private static final int METHODID_COLLECT_USER_EVENT = 1; + private static final int METHODID_PURGE_USER_EVENTS = 2; + private static final int METHODID_IMPORT_USER_EVENTS = 3; + private static final int METHODID_REJOIN_USER_EVENTS = 4; + + 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 UserEventServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(UserEventServiceImplBase 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_WRITE_USER_EVENT: + serviceImpl.writeUserEvent( + (com.google.cloud.retail.v2alpha.WriteUserEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COLLECT_USER_EVENT: + serviceImpl.collectUserEvent( + (com.google.cloud.retail.v2alpha.CollectUserEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PURGE_USER_EVENTS: + serviceImpl.purgeUserEvents( + (com.google.cloud.retail.v2alpha.PurgeUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_USER_EVENTS: + serviceImpl.importUserEvents( + (com.google.cloud.retail.v2alpha.ImportUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REJOIN_USER_EVENTS: + serviceImpl.rejoinUserEvents( + (com.google.cloud.retail.v2alpha.RejoinUserEventsRequest) 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 UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + UserEventServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("UserEventService"); + } + } + + private static final class UserEventServiceFileDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier { + UserEventServiceFileDescriptorSupplier() {} + } + + private static final class UserEventServiceMethodDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + UserEventServiceMethodDescriptorSupplier(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 (UserEventServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new UserEventServiceFileDescriptorSupplier()) + .addMethod(getWriteUserEventMethod()) + .addMethod(getCollectUserEventMethod()) + .addMethod(getPurgeUserEventsMethod()) + .addMethod(getImportUserEventsMethod()) + .addMethod(getRejoinUserEventsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/pom.xml b/grpc-google-cloud-retail-v2beta/pom.xml new file mode 100644 index 00000000..5ebcb3bb --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + grpc-google-cloud-retail-v2beta + GRPC library for google-cloud-retail + + com.google.cloud + google-cloud-retail-parent + 2.1.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-retail-v2beta + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java new file mode 100644 index 00000000..6765f04f --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java @@ -0,0 +1,1783 @@ +/* + * 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 managing catalog configuration.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/catalog_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CatalogServiceGrpc { + + private CatalogServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.CatalogService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListCatalogsRequest, + com.google.cloud.retail.v2beta.ListCatalogsResponse> + getListCatalogsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCatalogs", + requestType = com.google.cloud.retail.v2beta.ListCatalogsRequest.class, + responseType = com.google.cloud.retail.v2beta.ListCatalogsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListCatalogsRequest, + com.google.cloud.retail.v2beta.ListCatalogsResponse> + getListCatalogsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListCatalogsRequest, + com.google.cloud.retail.v2beta.ListCatalogsResponse> + getListCatalogsMethod; + if ((getListCatalogsMethod = CatalogServiceGrpc.getListCatalogsMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getListCatalogsMethod = CatalogServiceGrpc.getListCatalogsMethod) == null) { + CatalogServiceGrpc.getListCatalogsMethod = + getListCatalogsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCatalogs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListCatalogsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListCatalogsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ListCatalogs")) + .build(); + } + } + } + return getListCatalogsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCatalogRequest, + com.google.cloud.retail.v2beta.Catalog> + getUpdateCatalogMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCatalog", + requestType = com.google.cloud.retail.v2beta.UpdateCatalogRequest.class, + responseType = com.google.cloud.retail.v2beta.Catalog.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCatalogRequest, + com.google.cloud.retail.v2beta.Catalog> + getUpdateCatalogMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCatalogRequest, + com.google.cloud.retail.v2beta.Catalog> + getUpdateCatalogMethod; + if ((getUpdateCatalogMethod = CatalogServiceGrpc.getUpdateCatalogMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateCatalogMethod = CatalogServiceGrpc.getUpdateCatalogMethod) == null) { + CatalogServiceGrpc.getUpdateCatalogMethod = + getUpdateCatalogMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCatalog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateCatalogRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Catalog.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateCatalog")) + .build(); + } + } + } + return getUpdateCatalogMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetDefaultBranch", + requestType = com.google.cloud.retail.v2beta.SetDefaultBranchRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetDefaultBranchRequest, com.google.protobuf.Empty> + getSetDefaultBranchMethod; + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getSetDefaultBranchMethod = CatalogServiceGrpc.getSetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getSetDefaultBranchMethod = + getSetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("SetDefaultBranch")) + .build(); + } + } + } + return getSetDefaultBranchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetDefaultBranchRequest, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDefaultBranch", + requestType = com.google.cloud.retail.v2beta.GetDefaultBranchRequest.class, + responseType = com.google.cloud.retail.v2beta.GetDefaultBranchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetDefaultBranchRequest, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse> + getGetDefaultBranchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetDefaultBranchRequest, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse> + getGetDefaultBranchMethod; + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetDefaultBranchMethod = CatalogServiceGrpc.getGetDefaultBranchMethod) == null) { + CatalogServiceGrpc.getGetDefaultBranchMethod = + getGetDefaultBranchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDefaultBranch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetDefaultBranchResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetDefaultBranch")) + .build(); + } + } + } + return getGetDefaultBranchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getGetCompletionConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCompletionConfig", + requestType = com.google.cloud.retail.v2beta.GetCompletionConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.CompletionConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getGetCompletionConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getGetCompletionConfigMethod; + if ((getGetCompletionConfigMethod = CatalogServiceGrpc.getGetCompletionConfigMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetCompletionConfigMethod = CatalogServiceGrpc.getGetCompletionConfigMethod) + == null) { + CatalogServiceGrpc.getGetCompletionConfigMethod = + getGetCompletionConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetCompletionConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetCompletionConfig")) + .build(); + } + } + } + return getGetCompletionConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getUpdateCompletionConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCompletionConfig", + requestType = com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.CompletionConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getUpdateCompletionConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig> + getUpdateCompletionConfigMethod; + if ((getUpdateCompletionConfigMethod = CatalogServiceGrpc.getUpdateCompletionConfigMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateCompletionConfigMethod = CatalogServiceGrpc.getUpdateCompletionConfigMethod) + == null) { + CatalogServiceGrpc.getUpdateCompletionConfigMethod = + getUpdateCompletionConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateCompletionConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateCompletionConfig")) + .build(); + } + } + } + return getUpdateCompletionConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getGetAttributesConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAttributesConfig", + requestType = com.google.cloud.retail.v2beta.GetAttributesConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getGetAttributesConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getGetAttributesConfigMethod; + if ((getGetAttributesConfigMethod = CatalogServiceGrpc.getGetAttributesConfigMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getGetAttributesConfigMethod = CatalogServiceGrpc.getGetAttributesConfigMethod) + == null) { + CatalogServiceGrpc.getGetAttributesConfigMethod = + getGetAttributesConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetAttributesConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("GetAttributesConfig")) + .build(); + } + } + } + return getGetAttributesConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getUpdateAttributesConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAttributesConfig", + requestType = com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getUpdateAttributesConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getUpdateAttributesConfigMethod; + if ((getUpdateAttributesConfigMethod = CatalogServiceGrpc.getUpdateAttributesConfigMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getUpdateAttributesConfigMethod = CatalogServiceGrpc.getUpdateAttributesConfigMethod) + == null) { + CatalogServiceGrpc.getUpdateAttributesConfigMethod = + getUpdateAttributesConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAttributesConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("UpdateAttributesConfig")) + .build(); + } + } + } + return getUpdateAttributesConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getAddCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddCatalogAttribute", + requestType = com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2beta.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getAddCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getAddCatalogAttributeMethod; + if ((getAddCatalogAttributeMethod = CatalogServiceGrpc.getAddCatalogAttributeMethod) == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getAddCatalogAttributeMethod = CatalogServiceGrpc.getAddCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getAddCatalogAttributeMethod = + getAddCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("AddCatalogAttribute")) + .build(); + } + } + } + return getAddCatalogAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getRemoveCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveCatalogAttribute", + requestType = com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2beta.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getRemoveCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getRemoveCatalogAttributeMethod; + if ((getRemoveCatalogAttributeMethod = CatalogServiceGrpc.getRemoveCatalogAttributeMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getRemoveCatalogAttributeMethod = CatalogServiceGrpc.getRemoveCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getRemoveCatalogAttributeMethod = + getRemoveCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("RemoveCatalogAttribute")) + .build(); + } + } + } + return getRemoveCatalogAttributeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getReplaceCatalogAttributeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReplaceCatalogAttribute", + requestType = com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.class, + responseType = com.google.cloud.retail.v2beta.AttributesConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getReplaceCatalogAttributeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig> + getReplaceCatalogAttributeMethod; + if ((getReplaceCatalogAttributeMethod = CatalogServiceGrpc.getReplaceCatalogAttributeMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getReplaceCatalogAttributeMethod = CatalogServiceGrpc.getReplaceCatalogAttributeMethod) + == null) { + CatalogServiceGrpc.getReplaceCatalogAttributeMethod = + getReplaceCatalogAttributeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ReplaceCatalogAttribute")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier("ReplaceCatalogAttribute")) + .build(); + } + } + } + return getReplaceCatalogAttributeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CatalogServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + }; + return CatalogServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CatalogServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + }; + return CatalogServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CatalogServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CatalogServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + }; + return CatalogServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public abstract static class CatalogServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated
+     * with the project.
+     * 
+ */ + public void listCatalogs( + com.google.cloud.retail.v2beta.ListCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCatalogsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ */ + public void updateCatalog( + com.google.cloud.retail.v2beta.UpdateCatalogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCatalogMethod(), responseObserver); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetDefaultBranchMethod(), responseObserver); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDefaultBranchMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].
+     * 
+ */ + public void getCompletionConfig( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCompletionConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.
+     * 
+ */ + public void updateCompletionConfig( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCompletionConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public void getAttributesConfig( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAttributesConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public void updateAttributesConfig( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAttributesConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void addCatalogAttribute( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddCatalogAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void removeCatalogAttribute( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveCatalogAttributeMethod(), responseObserver); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
+     * the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void replaceCatalogAttribute( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReplaceCatalogAttributeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListCatalogsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ListCatalogsRequest, + com.google.cloud.retail.v2beta.ListCatalogsResponse>( + this, METHODID_LIST_CATALOGS))) + .addMethod( + getUpdateCatalogMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateCatalogRequest, + com.google.cloud.retail.v2beta.Catalog>(this, METHODID_UPDATE_CATALOG))) + .addMethod( + getSetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.SetDefaultBranchRequest, + com.google.protobuf.Empty>(this, METHODID_SET_DEFAULT_BRANCH))) + .addMethod( + getGetDefaultBranchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetDefaultBranchRequest, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse>( + this, METHODID_GET_DEFAULT_BRANCH))) + .addMethod( + getGetCompletionConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig>( + this, METHODID_GET_COMPLETION_CONFIG))) + .addMethod( + getUpdateCompletionConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest, + com.google.cloud.retail.v2beta.CompletionConfig>( + this, METHODID_UPDATE_COMPLETION_CONFIG))) + .addMethod( + getGetAttributesConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig>( + this, METHODID_GET_ATTRIBUTES_CONFIG))) + .addMethod( + getUpdateAttributesConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest, + com.google.cloud.retail.v2beta.AttributesConfig>( + this, METHODID_UPDATE_ATTRIBUTES_CONFIG))) + .addMethod( + getAddCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig>( + this, METHODID_ADD_CATALOG_ATTRIBUTE))) + .addMethod( + getRemoveCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig>( + this, METHODID_REMOVE_CATALOG_ATTRIBUTE))) + .addMethod( + getReplaceCatalogAttributeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, + com.google.cloud.retail.v2beta.AttributesConfig>( + this, METHODID_REPLACE_CATALOG_ATTRIBUTE))) + .build(); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CatalogServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated
+     * with the project.
+     * 
+ */ + public void listCatalogs( + com.google.cloud.retail.v2beta.ListCatalogsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCatalogsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ */ + public void updateCatalog( + com.google.cloud.retail.v2beta.UpdateCatalogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCatalogMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public void setDefaultBranch( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public void getDefaultBranch( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].
+     * 
+ */ + public void getCompletionConfig( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCompletionConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.
+     * 
+ */ + public void updateCompletionConfig( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCompletionConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public void getAttributesConfig( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAttributesConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public void updateAttributesConfig( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAttributesConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void addCatalogAttribute( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void removeCatalogAttribute( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
+     * the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void replaceCatalogAttribute( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReplaceCatalogAttributeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CatalogServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated
+     * with the project.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ListCatalogsResponse listCatalogs( + com.google.cloud.retail.v2beta.ListCatalogsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCatalogsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Catalog updateCatalog( + com.google.cloud.retail.v2beta.UpdateCatalogRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCatalogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public com.google.protobuf.Empty setDefaultBranch( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetDefaultBranchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public com.google.cloud.retail.v2beta.GetDefaultBranchResponse getDefaultBranch( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDefaultBranchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].
+     * 
+ */ + public com.google.cloud.retail.v2beta.CompletionConfig getCompletionConfig( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCompletionConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.
+     * 
+ */ + public com.google.cloud.retail.v2beta.CompletionConfig updateCompletionConfig( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCompletionConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public com.google.cloud.retail.v2beta.AttributesConfig getAttributesConfig( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAttributesConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public com.google.cloud.retail.v2beta.AttributesConfig updateAttributesConfig( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAttributesConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.AttributesConfig addCatalogAttribute( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddCatalogAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.AttributesConfig removeCatalogAttribute( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveCatalogAttributeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
+     * the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.AttributesConfig replaceCatalogAttribute( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReplaceCatalogAttributeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for managing catalog configuration.
+   * 
+ */ + public static final class CatalogServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CatalogServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CatalogServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CatalogServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated
+     * with the project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ListCatalogsResponse> + listCatalogs(com.google.cloud.retail.v2beta.ListCatalogsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCatalogsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Catalog> + updateCatalog(com.google.cloud.retail.v2beta.UpdateCatalogRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCatalogMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Set a specified branch id as default branch. API methods such as
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search],
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct],
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * will treat requests using "default_branch" to the actual branch id set as
+     * default.
+     * For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as
+     * default, setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent
+     * to setting
+     * [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to
+     * `projects/*/locations/*/catalogs/*/branches/1`.
+     * Using multiple branches can be useful when developers would like
+     * to have a staging branch to test and verify for future usage. When it
+     * becomes ready, developers switch on the staging branch using this API while
+     * keeping using `projects/*/locations/*/catalogs/*/branches/default_branch`
+     * as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch]
+     * to route the traffic to this staging branch.
+     * CAUTION: If you have live predict/search traffic, switching the default
+     * branch could potentially cause outages if the ID space of the new branch is
+     * very different from the old one.
+     * More specifically:
+     * * PredictionService will only return product IDs from branch {newBranch}.
+     * * SearchService will only return product IDs from branch {newBranch}
+     *   (if branch is not explicitly set).
+     * * UserEventService will only join events with products from branch
+     *   {newBranch}.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setDefaultBranch(com.google.cloud.retail.v2beta.SetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetDefaultBranchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get which branch is currently default branch set by
+     * [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch]
+     * method under a specified parent catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.GetDefaultBranchResponse> + getDefaultBranch(com.google.cloud.retail.v2beta.GetDefaultBranchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDefaultBranchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.CompletionConfig> + getCompletionConfig(com.google.cloud.retail.v2beta.GetCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCompletionConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.CompletionConfig> + updateCompletionConfig( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCompletionConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.AttributesConfig> + getAttributesConfig(com.google.cloud.retail.v2beta.GetAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAttributesConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * The catalog attributes in the request will be updated in the catalog, or
+     * inserted if they do not exist. Existing catalog attributes not included in
+     * the request will remain unchanged. Attributes that are assigned to
+     * products, but do not exist at the catalog level, are always included in the
+     * response. The product attribute is assigned default values for missing
+     * catalog attribute fields, e.g., searchable and dynamic facetable options.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.AttributesConfig> + updateAttributesConfig( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAttributesConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Adds the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * add already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.AttributesConfig> + addCatalogAttribute(com.google.cloud.retail.v2beta.AddCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddCatalogAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Removes the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * remove does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.AttributesConfig> + removeCatalogAttribute( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveCatalogAttributeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Replaces the specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
+     * the catalog attribute with the same
+     * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key].
+     * If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to
+     * replace does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.AttributesConfig> + replaceCatalogAttribute( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReplaceCatalogAttributeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CATALOGS = 0; + private static final int METHODID_UPDATE_CATALOG = 1; + private static final int METHODID_SET_DEFAULT_BRANCH = 2; + private static final int METHODID_GET_DEFAULT_BRANCH = 3; + private static final int METHODID_GET_COMPLETION_CONFIG = 4; + private static final int METHODID_UPDATE_COMPLETION_CONFIG = 5; + private static final int METHODID_GET_ATTRIBUTES_CONFIG = 6; + 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 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 CatalogServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CatalogServiceImplBase 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_LIST_CATALOGS: + serviceImpl.listCatalogs( + (com.google.cloud.retail.v2beta.ListCatalogsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CATALOG: + serviceImpl.updateCatalog( + (com.google.cloud.retail.v2beta.UpdateCatalogRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SET_DEFAULT_BRANCH: + serviceImpl.setDefaultBranch( + (com.google.cloud.retail.v2beta.SetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DEFAULT_BRANCH: + serviceImpl.getDefaultBranch( + (com.google.cloud.retail.v2beta.GetDefaultBranchRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_COMPLETION_CONFIG: + serviceImpl.getCompletionConfig( + (com.google.cloud.retail.v2beta.GetCompletionConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_COMPLETION_CONFIG: + serviceImpl.updateCompletionConfig( + (com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ATTRIBUTES_CONFIG: + serviceImpl.getAttributesConfig( + (com.google.cloud.retail.v2beta.GetAttributesConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ATTRIBUTES_CONFIG: + serviceImpl.updateAttributesConfig( + (com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ADD_CATALOG_ATTRIBUTE: + serviceImpl.addCatalogAttribute( + (com.google.cloud.retail.v2beta.AddCatalogAttributeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REMOVE_CATALOG_ATTRIBUTE: + serviceImpl.removeCatalogAttribute( + (com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPLACE_CATALOG_ATTRIBUTE: + serviceImpl.replaceCatalogAttribute( + (com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) 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 CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CatalogServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CatalogService"); + } + } + + private static final class CatalogServiceFileDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier { + CatalogServiceFileDescriptorSupplier() {} + } + + private static final class CatalogServiceMethodDescriptorSupplier + extends CatalogServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CatalogServiceMethodDescriptorSupplier(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 (CatalogServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CatalogServiceFileDescriptorSupplier()) + .addMethod(getListCatalogsMethod()) + .addMethod(getUpdateCatalogMethod()) + .addMethod(getSetDefaultBranchMethod()) + .addMethod(getGetDefaultBranchMethod()) + .addMethod(getGetCompletionConfigMethod()) + .addMethod(getUpdateCompletionConfigMethod()) + .addMethod(getGetAttributesConfigMethod()) + .addMethod(getUpdateAttributesConfigMethod()) + .addMethod(getAddCatalogAttributeMethod()) + .addMethod(getRemoveCatalogAttributeMethod()) + .addMethod(getReplaceCatalogAttributeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java new file mode 100644 index 00000000..4141ea3c --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java @@ -0,0 +1,521 @@ +/* + * 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; + +/** + * + * + *
+ * 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.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/completion_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CompletionServiceGrpc { + + private CompletionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.CompletionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CompleteQueryRequest, + com.google.cloud.retail.v2beta.CompleteQueryResponse> + getCompleteQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CompleteQuery", + requestType = com.google.cloud.retail.v2beta.CompleteQueryRequest.class, + responseType = com.google.cloud.retail.v2beta.CompleteQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CompleteQueryRequest, + com.google.cloud.retail.v2beta.CompleteQueryResponse> + getCompleteQueryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CompleteQueryRequest, + com.google.cloud.retail.v2beta.CompleteQueryResponse> + getCompleteQueryMethod; + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getCompleteQueryMethod = CompletionServiceGrpc.getCompleteQueryMethod) == null) { + CompletionServiceGrpc.getCompleteQueryMethod = + getCompleteQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompleteQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CompleteQueryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CompleteQueryResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("CompleteQuery")) + .build(); + } + } + } + return getCompleteQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportCompletionData", + requestType = com.google.cloud.retail.v2beta.ImportCompletionDataRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportCompletionDataRequest, + com.google.longrunning.Operation> + getImportCompletionDataMethod; + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + synchronized (CompletionServiceGrpc.class) { + if ((getImportCompletionDataMethod = CompletionServiceGrpc.getImportCompletionDataMethod) + == null) { + CompletionServiceGrpc.getImportCompletionDataMethod = + getImportCompletionDataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ImportCompletionData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("ImportCompletionData")) + .build(); + } + } + } + return getImportCompletionDataMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CompletionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + }; + return CompletionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CompletionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + }; + return CompletionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CompletionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CompletionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + }; + return CompletionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public abstract static class CompletionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2beta.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCompleteQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportCompletionDataMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCompleteQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CompleteQueryRequest, + com.google.cloud.retail.v2beta.CompleteQueryResponse>( + this, METHODID_COMPLETE_QUERY))) + .addMethod( + getImportCompletionDataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ImportCompletionDataRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_COMPLETION_DATA))) + .build(); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CompletionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void completeQuery( + com.google.cloud.retail.v2beta.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public void importCompletionData( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CompletionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse completeQuery( + com.google.cloud.retail.v2beta.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCompleteQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public com.google.longrunning.Operation importCompletionData( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportCompletionDataMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class CompletionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CompletionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CompletionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CompletionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.CompleteQueryResponse> + completeQuery(com.google.cloud.retail.v2beta.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of processed completion dataset.
+     * Request processing is asynchronous. Partial updating is not supported.
+     * The operation is successfully finished only after the imported suggestions
+     * are indexed successfully and ready for serving. The process takes hours.
+     * This feature is only available for users who have Retail Search enabled.
+     * Please enable Retail Search on Cloud Console before using this feature.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importCompletionData(com.google.cloud.retail.v2beta.ImportCompletionDataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportCompletionDataMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_COMPLETE_QUERY = 0; + private static final int METHODID_IMPORT_COMPLETION_DATA = 1; + + 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 CompletionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CompletionServiceImplBase 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_COMPLETE_QUERY: + serviceImpl.completeQuery( + (com.google.cloud.retail.v2beta.CompleteQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_IMPORT_COMPLETION_DATA: + serviceImpl.importCompletionData( + (com.google.cloud.retail.v2beta.ImportCompletionDataRequest) 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 CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CompletionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CompletionService"); + } + } + + private static final class CompletionServiceFileDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier { + CompletionServiceFileDescriptorSupplier() {} + } + + private static final class CompletionServiceMethodDescriptorSupplier + extends CompletionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CompletionServiceMethodDescriptorSupplier(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 (CompletionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CompletionServiceFileDescriptorSupplier()) + .addMethod(getCompleteQueryMethod()) + .addMethod(getImportCompletionDataMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java new file mode 100644 index 00000000..940e6394 --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java @@ -0,0 +1,852 @@ +/* + * 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 modifying Control.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/control_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ControlServiceGrpc { + + private ControlServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.ControlService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateControlRequest, + com.google.cloud.retail.v2beta.Control> + getCreateControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateControl", + requestType = com.google.cloud.retail.v2beta.CreateControlRequest.class, + responseType = com.google.cloud.retail.v2beta.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateControlRequest, + com.google.cloud.retail.v2beta.Control> + getCreateControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateControlRequest, + com.google.cloud.retail.v2beta.Control> + getCreateControlMethod; + if ((getCreateControlMethod = ControlServiceGrpc.getCreateControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getCreateControlMethod = ControlServiceGrpc.getCreateControlMethod) == null) { + ControlServiceGrpc.getCreateControlMethod = + getCreateControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CreateControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Control.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("CreateControl")) + .build(); + } + } + } + return getCreateControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteControl", + requestType = com.google.cloud.retail.v2beta.DeleteControlRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteControlRequest, com.google.protobuf.Empty> + getDeleteControlMethod; + if ((getDeleteControlMethod = ControlServiceGrpc.getDeleteControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getDeleteControlMethod = ControlServiceGrpc.getDeleteControlMethod) == null) { + ControlServiceGrpc.getDeleteControlMethod = + getDeleteControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.DeleteControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("DeleteControl")) + .build(); + } + } + } + return getDeleteControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateControlRequest, + com.google.cloud.retail.v2beta.Control> + getUpdateControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateControl", + requestType = com.google.cloud.retail.v2beta.UpdateControlRequest.class, + responseType = com.google.cloud.retail.v2beta.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateControlRequest, + com.google.cloud.retail.v2beta.Control> + getUpdateControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateControlRequest, + com.google.cloud.retail.v2beta.Control> + getUpdateControlMethod; + if ((getUpdateControlMethod = ControlServiceGrpc.getUpdateControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getUpdateControlMethod = ControlServiceGrpc.getUpdateControlMethod) == null) { + ControlServiceGrpc.getUpdateControlMethod = + getUpdateControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Control.getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("UpdateControl")) + .build(); + } + } + } + return getUpdateControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetControlRequest, com.google.cloud.retail.v2beta.Control> + getGetControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetControl", + requestType = com.google.cloud.retail.v2beta.GetControlRequest.class, + responseType = com.google.cloud.retail.v2beta.Control.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetControlRequest, com.google.cloud.retail.v2beta.Control> + getGetControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetControlRequest, + com.google.cloud.retail.v2beta.Control> + getGetControlMethod; + if ((getGetControlMethod = ControlServiceGrpc.getGetControlMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getGetControlMethod = ControlServiceGrpc.getGetControlMethod) == null) { + ControlServiceGrpc.getGetControlMethod = + getGetControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Control.getDefaultInstance())) + .setSchemaDescriptor(new ControlServiceMethodDescriptorSupplier("GetControl")) + .build(); + } + } + } + return getGetControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListControlsRequest, + com.google.cloud.retail.v2beta.ListControlsResponse> + getListControlsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListControls", + requestType = com.google.cloud.retail.v2beta.ListControlsRequest.class, + responseType = com.google.cloud.retail.v2beta.ListControlsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListControlsRequest, + com.google.cloud.retail.v2beta.ListControlsResponse> + getListControlsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListControlsRequest, + com.google.cloud.retail.v2beta.ListControlsResponse> + getListControlsMethod; + if ((getListControlsMethod = ControlServiceGrpc.getListControlsMethod) == null) { + synchronized (ControlServiceGrpc.class) { + if ((getListControlsMethod = ControlServiceGrpc.getListControlsMethod) == null) { + ControlServiceGrpc.getListControlsMethod = + getListControlsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListControls")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListControlsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListControlsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ControlServiceMethodDescriptorSupplier("ListControls")) + .build(); + } + } + } + return getListControlsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ControlServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceStub(channel, callOptions); + } + }; + return ControlServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ControlServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceBlockingStub(channel, callOptions); + } + }; + return ControlServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ControlServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ControlServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceFutureStub(channel, callOptions); + } + }; + return ControlServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public abstract static class ControlServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createControl( + com.google.cloud.retail.v2beta.CreateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteControl( + com.google.cloud.retail.v2beta.DeleteControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteControlMethod(), responseObserver); + } + + /** + * + * + *
+     * 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
+     * NOT_FOUND error is returned.
+     * 
+ */ + public void updateControl( + com.google.cloud.retail.v2beta.UpdateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public void getControl( + com.google.cloud.retail.v2beta.GetControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public void listControls( + com.google.cloud.retail.v2beta.ListControlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListControlsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CreateControlRequest, + com.google.cloud.retail.v2beta.Control>(this, METHODID_CREATE_CONTROL))) + .addMethod( + getDeleteControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.DeleteControlRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CONTROL))) + .addMethod( + getUpdateControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateControlRequest, + com.google.cloud.retail.v2beta.Control>(this, METHODID_UPDATE_CONTROL))) + .addMethod( + getGetControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetControlRequest, + com.google.cloud.retail.v2beta.Control>(this, METHODID_GET_CONTROL))) + .addMethod( + getListControlsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ListControlsRequest, + com.google.cloud.retail.v2beta.ListControlsResponse>( + this, METHODID_LIST_CONTROLS))) + .build(); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ControlServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createControl( + com.google.cloud.retail.v2beta.CreateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteControl( + com.google.cloud.retail.v2beta.DeleteControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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
+     * NOT_FOUND error is returned.
+     * 
+ */ + public void updateControl( + com.google.cloud.retail.v2beta.UpdateControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateControlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public void getControl( + com.google.cloud.retail.v2beta.GetControlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetControlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public void listControls( + com.google.cloud.retail.v2beta.ListControlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListControlsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ControlServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Control createControl( + com.google.cloud.retail.v2beta.CreateControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.protobuf.Empty deleteControl( + com.google.cloud.retail.v2beta.DeleteControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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
+     * NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Control updateControl( + com.google.cloud.retail.v2beta.UpdateControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Control getControl( + com.google.cloud.retail.v2beta.GetControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ListControlsResponse listControls( + com.google.cloud.retail.v2beta.ListControlsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListControlsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for modifying Control.
+   * 
+ */ + public static final class ControlServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ControlServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ControlServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ControlServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to create already
+     * exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Control> + createControl(com.google.cloud.retail.v2beta.CreateControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Control.
+     * If the [Control][google.cloud.retail.v2beta.Control] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteControl(com.google.cloud.retail.v2beta.DeleteControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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
+     * NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Control> + updateControl(com.google.cloud.retail.v2beta.UpdateControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a Control.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Control> + getControl(com.google.cloud.retail.v2beta.GetControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all Controls linked to this catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ListControlsResponse> + listControls(com.google.cloud.retail.v2beta.ListControlsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListControlsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CONTROL = 0; + private static final int METHODID_DELETE_CONTROL = 1; + private static final int METHODID_UPDATE_CONTROL = 2; + private static final int METHODID_GET_CONTROL = 3; + private static final int METHODID_LIST_CONTROLS = 4; + + 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 ControlServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ControlServiceImplBase 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_CONTROL: + serviceImpl.createControl( + (com.google.cloud.retail.v2beta.CreateControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CONTROL: + serviceImpl.deleteControl( + (com.google.cloud.retail.v2beta.DeleteControlRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CONTROL: + serviceImpl.updateControl( + (com.google.cloud.retail.v2beta.UpdateControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CONTROL: + serviceImpl.getControl( + (com.google.cloud.retail.v2beta.GetControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CONTROLS: + serviceImpl.listControls( + (com.google.cloud.retail.v2beta.ListControlsRequest) 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 ControlServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ControlServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ControlService"); + } + } + + private static final class ControlServiceFileDescriptorSupplier + extends ControlServiceBaseDescriptorSupplier { + ControlServiceFileDescriptorSupplier() {} + } + + private static final class ControlServiceMethodDescriptorSupplier + extends ControlServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ControlServiceMethodDescriptorSupplier(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 (ControlServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ControlServiceFileDescriptorSupplier()) + .addMethod(getCreateControlMethod()) + .addMethod(getDeleteControlMethod()) + .addMethod(getUpdateControlMethod()) + .addMethod(getGetControlMethod()) + .addMethod(getListControlsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceGrpc.java new file mode 100644 index 00000000..ebc1e9ff --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceGrpc.java @@ -0,0 +1,358 @@ +/* + * 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 making recommendation prediction.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/prediction_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.PredictionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PredictRequest, + com.google.cloud.retail.v2beta.PredictResponse> + getPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Predict", + requestType = com.google.cloud.retail.v2beta.PredictRequest.class, + responseType = com.google.cloud.retail.v2beta.PredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PredictRequest, + com.google.cloud.retail.v2beta.PredictResponse> + getPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PredictRequest, + com.google.cloud.retail.v2beta.PredictResponse> + getPredictMethod; + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + PredictionServiceGrpc.getPredictMethod = + getPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.PredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.PredictResponse.getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict")) + .build(); + } + } + } + return getPredictMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PredictionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + }; + return PredictionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + }; + return PredictionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + }; + return PredictionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public abstract static class PredictionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public void predict( + com.google.cloud.retail.v2beta.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPredictMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.PredictRequest, + com.google.cloud.retail.v2beta.PredictResponse>(this, METHODID_PREDICT))) + .build(); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private PredictionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public void predict( + com.google.cloud.retail.v2beta.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PredictionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public com.google.cloud.retail.v2beta.PredictResponse predict( + com.google.cloud.retail.v2beta.PredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPredictMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for making recommendation prediction.
+   * 
+ */ + public static final class PredictionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PredictionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation prediction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.PredictResponse> + predict(com.google.cloud.retail.v2beta.PredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PREDICT = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final PredictionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PredictionServiceImplBase 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_PREDICT: + serviceImpl.predict( + (com.google.cloud.retail.v2beta.PredictRequest) 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 PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.PredictionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionService"); + } + } + + private static final class PredictionServiceFileDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier { + PredictionServiceFileDescriptorSupplier() {} + } + + private static final class PredictionServiceMethodDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PredictionServiceMethodDescriptorSupplier(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 (PredictionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) + .addMethod(getPredictMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java new file mode 100644 index 00000000..416d9a72 --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java @@ -0,0 +1,1890 @@ +/* + * 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 ingesting [Product][google.cloud.retail.v2beta.Product]
+ * information of the customer's website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/product_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ProductServiceGrpc { + + private ProductServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.ProductService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateProductRequest, + com.google.cloud.retail.v2beta.Product> + getCreateProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProduct", + requestType = com.google.cloud.retail.v2beta.CreateProductRequest.class, + responseType = com.google.cloud.retail.v2beta.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateProductRequest, + com.google.cloud.retail.v2beta.Product> + getCreateProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateProductRequest, + com.google.cloud.retail.v2beta.Product> + getCreateProductMethod; + if ((getCreateProductMethod = ProductServiceGrpc.getCreateProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getCreateProductMethod = ProductServiceGrpc.getCreateProductMethod) == null) { + ProductServiceGrpc.getCreateProductMethod = + getCreateProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CreateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Product.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("CreateProduct")) + .build(); + } + } + } + return getCreateProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetProductRequest, com.google.cloud.retail.v2beta.Product> + getGetProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProduct", + requestType = com.google.cloud.retail.v2beta.GetProductRequest.class, + responseType = com.google.cloud.retail.v2beta.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetProductRequest, com.google.cloud.retail.v2beta.Product> + getGetProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetProductRequest, + com.google.cloud.retail.v2beta.Product> + getGetProductMethod; + if ((getGetProductMethod = ProductServiceGrpc.getGetProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getGetProductMethod = ProductServiceGrpc.getGetProductMethod) == null) { + ProductServiceGrpc.getGetProductMethod = + getGetProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Product.getDefaultInstance())) + .setSchemaDescriptor(new ProductServiceMethodDescriptorSupplier("GetProduct")) + .build(); + } + } + } + return getGetProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListProductsRequest, + com.google.cloud.retail.v2beta.ListProductsResponse> + getListProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProducts", + requestType = com.google.cloud.retail.v2beta.ListProductsRequest.class, + responseType = com.google.cloud.retail.v2beta.ListProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListProductsRequest, + com.google.cloud.retail.v2beta.ListProductsResponse> + getListProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListProductsRequest, + com.google.cloud.retail.v2beta.ListProductsResponse> + getListProductsMethod; + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getListProductsMethod = ProductServiceGrpc.getListProductsMethod) == null) { + ProductServiceGrpc.getListProductsMethod = + getListProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListProductsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("ListProducts")) + .build(); + } + } + } + return getListProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateProductRequest, + com.google.cloud.retail.v2beta.Product> + getUpdateProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateProduct", + requestType = com.google.cloud.retail.v2beta.UpdateProductRequest.class, + responseType = com.google.cloud.retail.v2beta.Product.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateProductRequest, + com.google.cloud.retail.v2beta.Product> + getUpdateProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateProductRequest, + com.google.cloud.retail.v2beta.Product> + getUpdateProductMethod; + if ((getUpdateProductMethod = ProductServiceGrpc.getUpdateProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getUpdateProductMethod = ProductServiceGrpc.getUpdateProductMethod) == null) { + ProductServiceGrpc.getUpdateProductMethod = + getUpdateProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Product.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("UpdateProduct")) + .build(); + } + } + } + return getUpdateProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProduct", + requestType = com.google.cloud.retail.v2beta.DeleteProductRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteProductRequest, com.google.protobuf.Empty> + getDeleteProductMethod; + if ((getDeleteProductMethod = ProductServiceGrpc.getDeleteProductMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getDeleteProductMethod = ProductServiceGrpc.getDeleteProductMethod) == null) { + ProductServiceGrpc.getDeleteProductMethod = + getDeleteProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.DeleteProductRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("DeleteProduct")) + .build(); + } + } + } + return getDeleteProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportProducts", + requestType = com.google.cloud.retail.v2beta.ImportProductsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportProductsRequest, com.google.longrunning.Operation> + getImportProductsMethod; + if ((getImportProductsMethod = ProductServiceGrpc.getImportProductsMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getImportProductsMethod = ProductServiceGrpc.getImportProductsMethod) == null) { + ProductServiceGrpc.getImportProductsMethod = + getImportProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ImportProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("ImportProducts")) + .build(); + } + } + } + return getImportProductsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetInventory", + requestType = com.google.cloud.retail.v2beta.SetInventoryRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SetInventoryRequest, com.google.longrunning.Operation> + getSetInventoryMethod; + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getSetInventoryMethod = ProductServiceGrpc.getSetInventoryMethod) == null) { + ProductServiceGrpc.getSetInventoryMethod = + getSetInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.SetInventoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("SetInventory")) + .build(); + } + } + } + return getSetInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddFulfillmentPlaces", + requestType = com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getAddFulfillmentPlacesMethod; + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getAddFulfillmentPlacesMethod = ProductServiceGrpc.getAddFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getAddFulfillmentPlacesMethod = + getAddFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("AddFulfillmentPlaces")) + .build(); + } + } + } + return getAddFulfillmentPlacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveFulfillmentPlaces", + requestType = com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation> + getRemoveFulfillmentPlacesMethod; + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getRemoveFulfillmentPlacesMethod = ProductServiceGrpc.getRemoveFulfillmentPlacesMethod) + == null) { + ProductServiceGrpc.getRemoveFulfillmentPlacesMethod = + getRemoveFulfillmentPlacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveFulfillmentPlaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("RemoveFulfillmentPlaces")) + .build(); + } + } + } + return getRemoveFulfillmentPlacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddLocalInventories", + requestType = com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest, + com.google.longrunning.Operation> + getAddLocalInventoriesMethod; + if ((getAddLocalInventoriesMethod = ProductServiceGrpc.getAddLocalInventoriesMethod) == null) { + synchronized (ProductServiceGrpc.class) { + if ((getAddLocalInventoriesMethod = ProductServiceGrpc.getAddLocalInventoriesMethod) + == null) { + ProductServiceGrpc.getAddLocalInventoriesMethod = + getAddLocalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AddLocalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("AddLocalInventories")) + .build(); + } + } + } + return getAddLocalInventoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveLocalInventories", + requestType = com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation> + getRemoveLocalInventoriesMethod; + if ((getRemoveLocalInventoriesMethod = ProductServiceGrpc.getRemoveLocalInventoriesMethod) + == null) { + synchronized (ProductServiceGrpc.class) { + if ((getRemoveLocalInventoriesMethod = ProductServiceGrpc.getRemoveLocalInventoriesMethod) + == null) { + ProductServiceGrpc.getRemoveLocalInventoriesMethod = + getRemoveLocalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RemoveLocalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ProductServiceMethodDescriptorSupplier("RemoveLocalInventories")) + .build(); + } + } + } + return getRemoveLocalInventoriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ProductServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceStub(channel, callOptions); + } + }; + return ProductServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ProductServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceBlockingStub(channel, callOptions); + } + }; + return ProductServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ProductServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProductServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceFutureStub(channel, callOptions); + } + }; + return ProductServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2beta.Product]
+   * information of the customer's website.
+   * 
+ */ + public abstract static class ProductServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void createProduct( + com.google.cloud.retail.v2beta.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void getProduct( + com.google.cloud.retail.v2beta.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2beta.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void updateProduct( + com.google.cloud.retail.v2beta.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void deleteProduct( + com.google.cloud.retail.v2beta.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2beta.Product]s to be successfully updated.
+     * 
+ */ + public void importProducts( + com.google.cloud.retail.v2beta.ImportProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportProductsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or
+     * [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.
+     * 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.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces],
+     * and
+     * [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.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2beta.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddFulfillmentPlacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveFulfillmentPlacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public void addLocalInventories( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddLocalInventoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public void removeLocalInventories( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveLocalInventoriesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CreateProductRequest, + com.google.cloud.retail.v2beta.Product>(this, METHODID_CREATE_PRODUCT))) + .addMethod( + getGetProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetProductRequest, + com.google.cloud.retail.v2beta.Product>(this, METHODID_GET_PRODUCT))) + .addMethod( + getListProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ListProductsRequest, + com.google.cloud.retail.v2beta.ListProductsResponse>( + this, METHODID_LIST_PRODUCTS))) + .addMethod( + getUpdateProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateProductRequest, + com.google.cloud.retail.v2beta.Product>(this, METHODID_UPDATE_PRODUCT))) + .addMethod( + getDeleteProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.DeleteProductRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PRODUCT))) + .addMethod( + getImportProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ImportProductsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_PRODUCTS))) + .addMethod( + getSetInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.SetInventoryRequest, + com.google.longrunning.Operation>(this, METHODID_SET_INVENTORY))) + .addMethod( + getAddFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_FULFILLMENT_PLACES))) + .addMethod( + getRemoveFulfillmentPlacesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_FULFILLMENT_PLACES))) + .addMethod( + getAddLocalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest, + com.google.longrunning.Operation>(this, METHODID_ADD_LOCAL_INVENTORIES))) + .addMethod( + getRemoveLocalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest, + com.google.longrunning.Operation>(this, METHODID_REMOVE_LOCAL_INVENTORIES))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2beta.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ProductServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void createProduct( + com.google.cloud.retail.v2beta.CreateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void getProduct( + com.google.cloud.retail.v2beta.GetProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProductMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ */ + public void listProducts( + com.google.cloud.retail.v2beta.ListProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void updateProduct( + com.google.cloud.retail.v2beta.UpdateProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public void deleteProduct( + com.google.cloud.retail.v2beta.DeleteProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2beta.Product]s to be successfully updated.
+     * 
+ */ + public void importProducts( + com.google.cloud.retail.v2beta.ImportProductsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportProductsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or
+     * [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.
+     * 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.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces],
+     * and
+     * [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.
+     * 
+ */ + public void setInventory( + com.google.cloud.retail.v2beta.SetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public void addFulfillmentPlaces( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public void removeFulfillmentPlaces( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public void addLocalInventories( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddLocalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public void removeLocalInventories( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveLocalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2beta.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ProductServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.cloud.retail.v2beta.Product createProduct( + com.google.cloud.retail.v2beta.CreateProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.cloud.retail.v2beta.Product getProduct( + com.google.cloud.retail.v2beta.GetProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ListProductsResponse listProducts( + com.google.cloud.retail.v2beta.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.cloud.retail.v2beta.Product updateProduct( + com.google.cloud.retail.v2beta.UpdateProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.protobuf.Empty deleteProduct( + com.google.cloud.retail.v2beta.DeleteProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2beta.Product]s to be successfully updated.
+     * 
+ */ + public com.google.longrunning.Operation importProducts( + com.google.cloud.retail.v2beta.ImportProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportProductsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or
+     * [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.
+     * 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.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces],
+     * and
+     * [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.
+     * 
+ */ + public com.google.longrunning.Operation setInventory( + com.google.cloud.retail.v2beta.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public com.google.longrunning.Operation addFulfillmentPlaces( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddFulfillmentPlacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public com.google.longrunning.Operation removeFulfillmentPlaces( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveFulfillmentPlacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public com.google.longrunning.Operation addLocalInventories( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddLocalInventoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public com.google.longrunning.Operation removeLocalInventories( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveLocalInventoriesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting [Product][google.cloud.retail.v2beta.Product]
+   * information of the customer's website.
+   * 
+ */ + public static final class ProductServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ProductServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProductServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProductServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Product> + createProduct(com.google.cloud.retail.v2beta.CreateProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Product> + getProduct(com.google.cloud.retail.v2beta.GetProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ListProductsResponse> + listProducts(com.google.cloud.retail.v2beta.ListProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.Product> + updateProduct(com.google.cloud.retail.v2beta.UpdateProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a [Product][google.cloud.retail.v2beta.Product].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProduct(com.google.cloud.retail.v2beta.DeleteProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s.
+     * Request processing may be synchronous. No partial updating is supported.
+     * Non-existing items are created.
+     * Note that it is possible for a subset of the
+     * [Product][google.cloud.retail.v2beta.Product]s to be successfully updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importProducts(com.google.cloud.retail.v2beta.ImportProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportProductsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] while respecting the last
+     * update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * When inventory is updated with
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or
+     * [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.
+     * 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.
+     * Pre-existing inventory information can only be updated with
+     * [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory],
+     * [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces],
+     * and
+     * [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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setInventory(com.google.cloud.retail.v2beta.SetInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Incrementally adds place IDs to
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the added place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addFulfillmentPlaces(com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddFulfillmentPlacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Incrementally removes place IDs from a
+     * [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids].
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * fulfillment information. If the request is valid, the update will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, the removed place IDs are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removeFulfillmentPlaces( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveFulfillmentPlacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places, while
+     * respecting the last update timestamps of each inventory field.
+     * This process is asynchronous and does not require the
+     * [Product][google.cloud.retail.v2beta.Product] to exist before updating
+     * inventory information. If the request is valid, the update will be enqueued
+     * and processed downstream. As a consequence, when a response is returned,
+     * updates are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be modified using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + addLocalInventories(com.google.cloud.retail.v2beta.AddLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddLocalInventoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Remove local inventory information for a
+     * [Product][google.cloud.retail.v2beta.Product] at a list of places at a
+     * removal timestamp.
+     * This process is asynchronous. If the request is valid, the removal will be
+     * enqueued and processed downstream. As a consequence, when a response is
+     * returned, removals are not immediately manifested in the
+     * [Product][google.cloud.retail.v2beta.Product] queried by
+     * [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or
+     * [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * Local inventory information can only be removed using this method.
+     * [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
+     * and
+     * [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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + removeLocalInventories( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveLocalInventoriesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PRODUCT = 0; + private static final int METHODID_GET_PRODUCT = 1; + private static final int METHODID_LIST_PRODUCTS = 2; + private static final int METHODID_UPDATE_PRODUCT = 3; + private static final int METHODID_DELETE_PRODUCT = 4; + private static final int METHODID_IMPORT_PRODUCTS = 5; + private static final int METHODID_SET_INVENTORY = 6; + private static final int METHODID_ADD_FULFILLMENT_PLACES = 7; + private static final int METHODID_REMOVE_FULFILLMENT_PLACES = 8; + private static final int METHODID_ADD_LOCAL_INVENTORIES = 9; + private static final int METHODID_REMOVE_LOCAL_INVENTORIES = 10; + + 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 ProductServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ProductServiceImplBase 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_PRODUCT: + serviceImpl.createProduct( + (com.google.cloud.retail.v2beta.CreateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PRODUCT: + serviceImpl.getProduct( + (com.google.cloud.retail.v2beta.GetProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PRODUCTS: + serviceImpl.listProducts( + (com.google.cloud.retail.v2beta.ListProductsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRODUCT: + serviceImpl.updateProduct( + (com.google.cloud.retail.v2beta.UpdateProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PRODUCT: + serviceImpl.deleteProduct( + (com.google.cloud.retail.v2beta.DeleteProductRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_PRODUCTS: + serviceImpl.importProducts( + (com.google.cloud.retail.v2beta.ImportProductsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_INVENTORY: + serviceImpl.setInventory( + (com.google.cloud.retail.v2beta.SetInventoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_FULFILLMENT_PLACES: + serviceImpl.addFulfillmentPlaces( + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_FULFILLMENT_PLACES: + serviceImpl.removeFulfillmentPlaces( + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ADD_LOCAL_INVENTORIES: + serviceImpl.addLocalInventories( + (com.google.cloud.retail.v2beta.AddLocalInventoriesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_LOCAL_INVENTORIES: + serviceImpl.removeLocalInventories( + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) 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 ProductServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProductServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ProductService"); + } + } + + private static final class ProductServiceFileDescriptorSupplier + extends ProductServiceBaseDescriptorSupplier { + ProductServiceFileDescriptorSupplier() {} + } + + private static final class ProductServiceMethodDescriptorSupplier + extends ProductServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ProductServiceMethodDescriptorSupplier(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 (ProductServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ProductServiceFileDescriptorSupplier()) + .addMethod(getCreateProductMethod()) + .addMethod(getGetProductMethod()) + .addMethod(getListProductsMethod()) + .addMethod(getUpdateProductMethod()) + .addMethod(getDeleteProductMethod()) + .addMethod(getImportProductsMethod()) + .addMethod(getSetInventoryMethod()) + .addMethod(getAddFulfillmentPlacesMethod()) + .addMethod(getRemoveFulfillmentPlacesMethod()) + .addMethod(getAddLocalInventoriesMethod()) + .addMethod(getRemoveLocalInventoriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java new file mode 100644 index 00000000..e6b9f41d --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java @@ -0,0 +1,374 @@ +/* + * 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 search.
+ * This feature is only available for users who have Retail Search enabled.
+ * Please enable Retail Search on Cloud Console before using this feature.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/search_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SearchServiceGrpc { + + private SearchServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.SearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SearchRequest, + com.google.cloud.retail.v2beta.SearchResponse> + getSearchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Search", + requestType = com.google.cloud.retail.v2beta.SearchRequest.class, + responseType = com.google.cloud.retail.v2beta.SearchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SearchRequest, + com.google.cloud.retail.v2beta.SearchResponse> + getSearchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.SearchRequest, + com.google.cloud.retail.v2beta.SearchResponse> + getSearchMethod; + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + synchronized (SearchServiceGrpc.class) { + if ((getSearchMethod = SearchServiceGrpc.getSearchMethod) == null) { + SearchServiceGrpc.getSearchMethod = + getSearchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Search")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.SearchRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.SearchResponse.getDefaultInstance())) + .setSchemaDescriptor(new SearchServiceMethodDescriptorSupplier("Search")) + .build(); + } + } + } + return getSearchMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SearchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + }; + return SearchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SearchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + }; + return SearchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SearchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SearchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + }; + return SearchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public abstract static class SearchServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2beta.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSearchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.SearchRequest, + com.google.cloud.retail.v2beta.SearchResponse>(this, METHODID_SEARCH))) + .build(); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SearchServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void search( + com.google.cloud.retail.v2beta.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SearchServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.retail.v2beta.SearchResponse search( + com.google.cloud.retail.v2beta.SearchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public static final class SearchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SearchServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SearchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SearchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.SearchResponse> + search(com.google.cloud.retail.v2beta.SearchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SEARCH = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SearchServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SearchServiceImplBase 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_SEARCH: + serviceImpl.search( + (com.google.cloud.retail.v2beta.SearchRequest) 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 SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SearchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SearchService"); + } + } + + private static final class SearchServiceFileDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier { + SearchServiceFileDescriptorSupplier() {} + } + + private static final class SearchServiceMethodDescriptorSupplier + extends SearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SearchServiceMethodDescriptorSupplier(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 (SearchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SearchServiceFileDescriptorSupplier()) + .addMethod(getSearchMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceGrpc.java new file mode 100644 index 00000000..f7ca9576 --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceGrpc.java @@ -0,0 +1,1142 @@ +/* + * 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 modifying ServingConfig.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/serving_config_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ServingConfigServiceGrpc { + + private ServingConfigServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.ServingConfigService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getCreateServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateServingConfig", + requestType = com.google.cloud.retail.v2beta.CreateServingConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getCreateServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getCreateServingConfigMethod; + if ((getCreateServingConfigMethod = ServingConfigServiceGrpc.getCreateServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getCreateServingConfigMethod = ServingConfigServiceGrpc.getCreateServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getCreateServingConfigMethod = + getCreateServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CreateServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("CreateServingConfig")) + .build(); + } + } + } + return getCreateServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteServingConfig", + requestType = com.google.cloud.retail.v2beta.DeleteServingConfigRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteServingConfigRequest, com.google.protobuf.Empty> + getDeleteServingConfigMethod; + if ((getDeleteServingConfigMethod = ServingConfigServiceGrpc.getDeleteServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getDeleteServingConfigMethod = ServingConfigServiceGrpc.getDeleteServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getDeleteServingConfigMethod = + getDeleteServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("DeleteServingConfig")) + .build(); + } + } + } + return getDeleteServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getUpdateServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateServingConfig", + requestType = com.google.cloud.retail.v2beta.UpdateServingConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getUpdateServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getUpdateServingConfigMethod; + if ((getUpdateServingConfigMethod = ServingConfigServiceGrpc.getUpdateServingConfigMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getUpdateServingConfigMethod = ServingConfigServiceGrpc.getUpdateServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getUpdateServingConfigMethod = + getUpdateServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("UpdateServingConfig")) + .build(); + } + } + } + return getUpdateServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getGetServingConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetServingConfig", + requestType = com.google.cloud.retail.v2beta.GetServingConfigRequest.class, + responseType = com.google.cloud.retail.v2beta.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getGetServingConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.GetServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getGetServingConfigMethod; + if ((getGetServingConfigMethod = ServingConfigServiceGrpc.getGetServingConfigMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getGetServingConfigMethod = ServingConfigServiceGrpc.getGetServingConfigMethod) + == null) { + ServingConfigServiceGrpc.getGetServingConfigMethod = + getGetServingConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetServingConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.GetServingConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("GetServingConfig")) + .build(); + } + } + } + return getGetServingConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListServingConfigsRequest, + com.google.cloud.retail.v2beta.ListServingConfigsResponse> + getListServingConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServingConfigs", + requestType = com.google.cloud.retail.v2beta.ListServingConfigsRequest.class, + responseType = com.google.cloud.retail.v2beta.ListServingConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListServingConfigsRequest, + com.google.cloud.retail.v2beta.ListServingConfigsResponse> + getListServingConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListServingConfigsRequest, + com.google.cloud.retail.v2beta.ListServingConfigsResponse> + getListServingConfigsMethod; + if ((getListServingConfigsMethod = ServingConfigServiceGrpc.getListServingConfigsMethod) + == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getListServingConfigsMethod = ServingConfigServiceGrpc.getListServingConfigsMethod) + == null) { + ServingConfigServiceGrpc.getListServingConfigsMethod = + getListServingConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServingConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListServingConfigsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListServingConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("ListServingConfigs")) + .build(); + } + } + } + return getListServingConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getAddControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddControl", + requestType = com.google.cloud.retail.v2beta.AddControlRequest.class, + responseType = com.google.cloud.retail.v2beta.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getAddControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.AddControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getAddControlMethod; + if ((getAddControlMethod = ServingConfigServiceGrpc.getAddControlMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getAddControlMethod = ServingConfigServiceGrpc.getAddControlMethod) == null) { + ServingConfigServiceGrpc.getAddControlMethod = + getAddControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.AddControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("AddControl")) + .build(); + } + } + } + return getAddControlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getRemoveControlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveControl", + requestType = com.google.cloud.retail.v2beta.RemoveControlRequest.class, + responseType = com.google.cloud.retail.v2beta.ServingConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getRemoveControlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RemoveControlRequest, + com.google.cloud.retail.v2beta.ServingConfig> + getRemoveControlMethod; + if ((getRemoveControlMethod = ServingConfigServiceGrpc.getRemoveControlMethod) == null) { + synchronized (ServingConfigServiceGrpc.class) { + if ((getRemoveControlMethod = ServingConfigServiceGrpc.getRemoveControlMethod) == null) { + ServingConfigServiceGrpc.getRemoveControlMethod = + getRemoveControlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveControl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.RemoveControlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance())) + .setSchemaDescriptor( + new ServingConfigServiceMethodDescriptorSupplier("RemoveControl")) + .build(); + } + } + } + return getRemoveControlMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ServingConfigServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceStub(channel, callOptions); + } + }; + return ServingConfigServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServingConfigServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceBlockingStub(channel, callOptions); + } + }; + return ServingConfigServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ServingConfigServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServingConfigServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceFutureStub(channel, callOptions); + } + }; + return ServingConfigServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public abstract static class ServingConfigServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s
+     * are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ */ + public void createServingConfig( + com.google.cloud.retail.v2beta.CreateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void deleteServingConfig( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public void updateServingConfig( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void getServingConfig( + com.google.cloud.retail.v2beta.GetServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetServingConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public void listServingConfigs( + com.google.cloud.retail.v2beta.ListServingConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServingConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public void addControl( + com.google.cloud.retail.v2beta.AddControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAddControlMethod(), responseObserver); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public void removeControl( + com.google.cloud.retail.v2beta.RemoveControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRemoveControlMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CreateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig>( + this, METHODID_CREATE_SERVING_CONFIG))) + .addMethod( + getDeleteServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.DeleteServingConfigRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SERVING_CONFIG))) + .addMethod( + getUpdateServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig>( + this, METHODID_UPDATE_SERVING_CONFIG))) + .addMethod( + getGetServingConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.GetServingConfigRequest, + com.google.cloud.retail.v2beta.ServingConfig>( + this, METHODID_GET_SERVING_CONFIG))) + .addMethod( + getListServingConfigsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ListServingConfigsRequest, + com.google.cloud.retail.v2beta.ListServingConfigsResponse>( + this, METHODID_LIST_SERVING_CONFIGS))) + .addMethod( + getAddControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.AddControlRequest, + com.google.cloud.retail.v2beta.ServingConfig>(this, METHODID_ADD_CONTROL))) + .addMethod( + getRemoveControlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.RemoveControlRequest, + com.google.cloud.retail.v2beta.ServingConfig>(this, METHODID_REMOVE_CONTROL))) + .build(); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ServingConfigServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s
+     * are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ */ + public void createServingConfig( + com.google.cloud.retail.v2beta.CreateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void deleteServingConfig( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public void updateServingConfig( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public void getServingConfig( + com.google.cloud.retail.v2beta.GetServingConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetServingConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public void listServingConfigs( + com.google.cloud.retail.v2beta.ListServingConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServingConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public void addControl( + com.google.cloud.retail.v2beta.AddControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddControlMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public void removeControl( + com.google.cloud.retail.v2beta.RemoveControlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveControlMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ServingConfigServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s
+     * are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ServingConfig createServingConfig( + com.google.cloud.retail.v2beta.CreateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.protobuf.Empty deleteServingConfig( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ServingConfig updateServingConfig( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ServingConfig getServingConfig( + com.google.cloud.retail.v2beta.GetServingConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetServingConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ListServingConfigsResponse listServingConfigs( + com.google.cloud.retail.v2beta.ListServingConfigsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServingConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ServingConfig addControl( + com.google.cloud.retail.v2beta.AddControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddControlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ServingConfig removeControl( + com.google.cloud.retail.v2beta.RemoveControlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveControlMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for modifying ServingConfig.
+   * 
+ */ + public static final class ServingConfigServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ServingConfigServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServingConfigServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServingConfigServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a ServingConfig.
+     * A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s
+     * are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise
+     * a FAILED_PRECONDITION error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ServingConfig> + createServingConfig(com.google.cloud.retail.v2beta.CreateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteServingConfig(com.google.cloud.retail.v2beta.DeleteServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a ServingConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ServingConfig> + updateServingConfig(com.google.cloud.retail.v2beta.UpdateServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a ServingConfig.
+     * Returns a NotFound error if the ServingConfig does not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ServingConfig> + getServingConfig(com.google.cloud.retail.v2beta.GetServingConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetServingConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all ServingConfigs linked to this catalog.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ListServingConfigsResponse> + listServingConfigs(com.google.cloud.retail.v2beta.ListServingConfigsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServingConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Enables a Control on the specified ServingConfig.
+     * The control is added in the last position of the list of controls
+     * it belongs to (e.g. if it's a facet spec control it will be applied
+     * in the last position of servingConfig.facetSpecIds)
+     * Returns a ALREADY_EXISTS error if the control has already been applied.
+     * Returns a FAILED_PRECONDITION error if the addition could exceed maximum
+     * number of control allowed for that type of control.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ServingConfig> + addControl(com.google.cloud.retail.v2beta.AddControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddControlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Disables a Control on the specified ServingConfig.
+     * The control is removed from the ServingConfig.
+     * Returns a NOT_FOUND error if the Control is not enabled for the
+     * ServingConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ServingConfig> + removeControl(com.google.cloud.retail.v2beta.RemoveControlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveControlMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SERVING_CONFIG = 0; + private static final int METHODID_DELETE_SERVING_CONFIG = 1; + private static final int METHODID_UPDATE_SERVING_CONFIG = 2; + private static final int METHODID_GET_SERVING_CONFIG = 3; + private static final int METHODID_LIST_SERVING_CONFIGS = 4; + private static final int METHODID_ADD_CONTROL = 5; + private static final int METHODID_REMOVE_CONTROL = 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 ServingConfigServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServingConfigServiceImplBase 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_SERVING_CONFIG: + serviceImpl.createServingConfig( + (com.google.cloud.retail.v2beta.CreateServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SERVING_CONFIG: + serviceImpl.deleteServingConfig( + (com.google.cloud.retail.v2beta.DeleteServingConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SERVING_CONFIG: + serviceImpl.updateServingConfig( + (com.google.cloud.retail.v2beta.UpdateServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SERVING_CONFIG: + serviceImpl.getServingConfig( + (com.google.cloud.retail.v2beta.GetServingConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVING_CONFIGS: + serviceImpl.listServingConfigs( + (com.google.cloud.retail.v2beta.ListServingConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2beta.ListServingConfigsResponse>) + responseObserver); + break; + case METHODID_ADD_CONTROL: + serviceImpl.addControl( + (com.google.cloud.retail.v2beta.AddControlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REMOVE_CONTROL: + serviceImpl.removeControl( + (com.google.cloud.retail.v2beta.RemoveControlRequest) 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 ServingConfigServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServingConfigServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServingConfigService"); + } + } + + private static final class ServingConfigServiceFileDescriptorSupplier + extends ServingConfigServiceBaseDescriptorSupplier { + ServingConfigServiceFileDescriptorSupplier() {} + } + + private static final class ServingConfigServiceMethodDescriptorSupplier + extends ServingConfigServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServingConfigServiceMethodDescriptorSupplier(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 (ServingConfigServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServingConfigServiceFileDescriptorSupplier()) + .addMethod(getCreateServingConfigMethod()) + .addMethod(getDeleteServingConfigMethod()) + .addMethod(getUpdateServingConfigMethod()) + .addMethod(getGetServingConfigMethod()) + .addMethod(getListServingConfigsMethod()) + .addMethod(getAddControlMethod()) + .addMethod(getRemoveControlMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java new file mode 100644 index 00000000..167aaef8 --- /dev/null +++ b/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java @@ -0,0 +1,881 @@ +/* + * 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 ingesting end user actions on the customer website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/user_event_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class UserEventServiceGrpc { + + private UserEventServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.UserEventService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.WriteUserEventRequest, + com.google.cloud.retail.v2beta.UserEvent> + getWriteUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteUserEvent", + requestType = com.google.cloud.retail.v2beta.WriteUserEventRequest.class, + responseType = com.google.cloud.retail.v2beta.UserEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.WriteUserEventRequest, + com.google.cloud.retail.v2beta.UserEvent> + getWriteUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.WriteUserEventRequest, + com.google.cloud.retail.v2beta.UserEvent> + getWriteUserEventMethod; + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { + UserEventServiceGrpc.getWriteUserEventMethod = + getWriteUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.WriteUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("WriteUserEvent")) + .build(); + } + } + } + return getWriteUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CollectUserEvent", + requestType = com.google.cloud.retail.v2beta.CollectUserEventRequest.class, + responseType = com.google.api.HttpBody.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod; + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { + UserEventServiceGrpc.getCollectUserEventMethod = + getCollectUserEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CollectUserEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CollectUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.HttpBody.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("CollectUserEvent")) + .build(); + } + } + } + return getCollectUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PurgeUserEventsRequest, com.google.longrunning.Operation> + getPurgeUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeUserEvents", + requestType = com.google.cloud.retail.v2beta.PurgeUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PurgeUserEventsRequest, com.google.longrunning.Operation> + getPurgeUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PurgeUserEventsRequest, com.google.longrunning.Operation> + getPurgeUserEventsMethod; + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { + UserEventServiceGrpc.getPurgeUserEventsMethod = + getPurgeUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("PurgeUserEvents")) + .build(); + } + } + } + return getPurgeUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportUserEventsRequest, com.google.longrunning.Operation> + getImportUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportUserEvents", + requestType = com.google.cloud.retail.v2beta.ImportUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportUserEventsRequest, com.google.longrunning.Operation> + getImportUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod; + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { + UserEventServiceGrpc.getImportUserEventsMethod = + getImportUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ImportUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("ImportUserEvents")) + .build(); + } + } + } + return getImportUserEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RejoinUserEventsRequest, com.google.longrunning.Operation> + getRejoinUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RejoinUserEvents", + requestType = com.google.cloud.retail.v2beta.RejoinUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RejoinUserEventsRequest, com.google.longrunning.Operation> + getRejoinUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.RejoinUserEventsRequest, + com.google.longrunning.Operation> + getRejoinUserEventsMethod; + if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { + synchronized (UserEventServiceGrpc.class) { + if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { + UserEventServiceGrpc.getRejoinUserEventsMethod = + getRejoinUserEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RejoinUserEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("RejoinUserEvents")) + .build(); + } + } + } + return getRejoinUserEventsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static UserEventServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + }; + return UserEventServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static UserEventServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + }; + return UserEventServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static UserEventServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public UserEventServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + }; + return UserEventServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public abstract static class UserEventServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.retail.v2beta.WriteUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getWriteUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.retail.v2beta.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCollectUserEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPurgeUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.retail.v2beta.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportUserEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void rejoinUserEvents( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRejoinUserEventsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getWriteUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.WriteUserEventRequest, + com.google.cloud.retail.v2beta.UserEvent>(this, METHODID_WRITE_USER_EVENT))) + .addMethod( + getCollectUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CollectUserEventRequest, + com.google.api.HttpBody>(this, METHODID_COLLECT_USER_EVENT))) + .addMethod( + getPurgeUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.PurgeUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_PURGE_USER_EVENTS))) + .addMethod( + getImportUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ImportUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_USER_EVENTS))) + .addMethod( + getRejoinUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.RejoinUserEventsRequest, + com.google.longrunning.Operation>(this, METHODID_REJOIN_USER_EVENTS))) + .build(); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private UserEventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public void writeUserEvent( + com.google.cloud.retail.v2beta.WriteUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.retail.v2beta.CollectUserEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public void purgeUserEvents( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void importUserEvents( + com.google.cloud.retail.v2beta.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void rejoinUserEvents( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private UserEventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.cloud.retail.v2beta.UserEvent writeUserEvent( + com.google.cloud.retail.v2beta.WriteUserEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWriteUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public com.google.api.HttpBody collectUserEvent( + com.google.cloud.retail.v2beta.CollectUserEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCollectUserEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.longrunning.Operation purgeUserEvents( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPurgeUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation importUserEvents( + com.google.cloud.retail.v2beta.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportUserEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation rejoinUserEvents( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRejoinUserEventsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for ingesting end user actions on the customer website.
+   * 
+ */ + public static final class UserEventServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private UserEventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected UserEventServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new UserEventServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.UserEvent> + writeUserEvent(com.google.cloud.retail.v2beta.WriteUserEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Writes a single user event from the browser. This uses a GET request to
+     * due to browser restriction of POST-ing to a 3rd party domain.
+     * This method is used only by the Retail API JavaScript pixel and Google Tag
+     * Manager. Users should not call this method directly.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + collectUserEvent(com.google.cloud.retail.v2beta.CollectUserEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes permanently all user events specified by the filter provided.
+     * Depending on the number of events specified by the filter, this operation
+     * could take hours or days to complete. To test a filter, use the list
+     * command first.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + purgeUserEvents(com.google.cloud.retail.v2beta.PurgeUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importUserEvents(com.google.cloud.retail.v2beta.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + rejoinUserEvents(com.google.cloud.retail.v2beta.RejoinUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_WRITE_USER_EVENT = 0; + private static final int METHODID_COLLECT_USER_EVENT = 1; + private static final int METHODID_PURGE_USER_EVENTS = 2; + private static final int METHODID_IMPORT_USER_EVENTS = 3; + private static final int METHODID_REJOIN_USER_EVENTS = 4; + + 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 UserEventServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(UserEventServiceImplBase 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_WRITE_USER_EVENT: + serviceImpl.writeUserEvent( + (com.google.cloud.retail.v2beta.WriteUserEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COLLECT_USER_EVENT: + serviceImpl.collectUserEvent( + (com.google.cloud.retail.v2beta.CollectUserEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PURGE_USER_EVENTS: + serviceImpl.purgeUserEvents( + (com.google.cloud.retail.v2beta.PurgeUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_USER_EVENTS: + serviceImpl.importUserEvents( + (com.google.cloud.retail.v2beta.ImportUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REJOIN_USER_EVENTS: + serviceImpl.rejoinUserEvents( + (com.google.cloud.retail.v2beta.RejoinUserEventsRequest) 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 UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + UserEventServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("UserEventService"); + } + } + + private static final class UserEventServiceFileDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier { + UserEventServiceFileDescriptorSupplier() {} + } + + private static final class UserEventServiceMethodDescriptorSupplier + extends UserEventServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + UserEventServiceMethodDescriptorSupplier(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 (UserEventServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new UserEventServiceFileDescriptorSupplier()) + .addMethod(getWriteUserEventMethod()) + .addMethod(getCollectUserEventMethod()) + .addMethod(getPurgeUserEventsMethod()) + .addMethod(getImportUserEventsMethod()) + .addMethod(getRejoinUserEventsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 1392832a..109521b2 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,26 @@ google-cloud-retail 2.1.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-retail-v2 @@ -104,7 +124,11 @@ google-cloud-retail grpc-google-cloud-retail-v2 + grpc-google-cloud-retail-v2alpha + grpc-google-cloud-retail-v2beta proto-google-cloud-retail-v2 + proto-google-cloud-retail-v2alpha + proto-google-cloud-retail-v2beta google-cloud-retail-bom diff --git a/proto-google-cloud-retail-v2alpha/clirr-ignored-differences.xml b/proto-google-cloud-retail-v2alpha/clirr-ignored-differences.xml new file mode 100644 index 00000000..458f135d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/retail/v2alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/retail/v2alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/retail/v2alpha/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-retail-v2alpha/pom.xml b/proto-google-cloud-retail-v2alpha/pom.xml new file mode 100644 index 00000000..cba736b3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-retail-v2alpha + 2.1.1-SNAPSHOT + proto-google-cloud-retail-v2alpha + Proto library for google-cloud-retail + + com.google.cloud + google-cloud-retail-parent + 2.1.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequest.java new file mode 100644 index 00000000..e49b6049 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequest.java @@ -0,0 +1,979 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.AddCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.AddCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddCatalogAttributeRequest} + */ +public final class AddCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + AddCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddCatalogAttributeRequest.newBuilder() to construct. + private AddCatalogAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddCatalogAttributeRequest() { + attributesConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder subBuilder = null; + if (catalogAttribute_ != null) { + subBuilder = catalogAttribute_.toBuilder(); + } + catalogAttribute_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CatalogAttribute.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogAttribute_); + catalogAttribute_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 CATALOG_ATTRIBUTE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.CatalogAttribute catalogAttribute_; + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + @java.lang.Override + public boolean hasCatalogAttribute() { + return catalogAttribute_ != null; + } + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute() { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + return getCatalogAttribute(); + } + + 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_); + } + if (catalogAttribute_ != null) { + output.writeMessage(2, getCatalogAttribute()); + } + 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_); + } + if (catalogAttribute_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogAttribute()); + } + 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.v2alpha.AddCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest other = + (com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (hasCatalogAttribute() != other.hasCatalogAttribute()) return false; + if (hasCatalogAttribute()) { + if (!getCatalogAttribute().equals(other.getCatalogAttribute())) 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 (hasCatalogAttribute()) { + hash = (37 * hash) + CATALOG_ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getCatalogAttribute().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest 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.AddCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.AddCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.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_ = ""; + + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest build() { + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest result = + new com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + if (catalogAttributeBuilder_ == null) { + result.catalogAttribute_ = catalogAttribute_; + } else { + result.catalogAttribute_ = catalogAttributeBuilder_.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.v2alpha.AddCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest other) { + if (other == com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (other.hasCatalogAttribute()) { + mergeCatalogAttribute(other.getCatalogAttribute()); + } + 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.v2alpha.AddCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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.cloud.retail.v2alpha.CatalogAttribute catalogAttribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder> + catalogAttributeBuilder_; + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + public boolean hasCatalogAttribute() { + return catalogAttributeBuilder_ != null || catalogAttribute_ != null; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } else { + return catalogAttributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute(com.google.cloud.retail.v2alpha.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogAttribute_ = value; + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute( + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder builderForValue) { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = builderForValue.build(); + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogAttribute(com.google.cloud.retail.v2alpha.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (catalogAttribute_ != null) { + catalogAttribute_ = + com.google.cloud.retail.v2alpha.CatalogAttribute.newBuilder(catalogAttribute_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogAttribute_ = value; + } + onChanged(); + } else { + catalogAttributeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + onChanged(); + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CatalogAttribute.Builder getCatalogAttributeBuilder() { + + onChanged(); + return getCatalogAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder + getCatalogAttributeOrBuilder() { + if (catalogAttributeBuilder_ != null) { + return catalogAttributeBuilder_.getMessageOrBuilder(); + } else { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder> + getCatalogAttributeFieldBuilder() { + if (catalogAttributeBuilder_ == null) { + catalogAttributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder>( + getCatalogAttribute(), getParentForChildren(), isClean()); + catalogAttribute_ = null; + } + return catalogAttributeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + private static final com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2alpha.AddCatalogAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddCatalogAttributeRequest(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.v2alpha.AddCatalogAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..9499428e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + boolean hasCatalogAttribute(); + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute(); + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequest.java new file mode 100644 index 00000000..d3f2d9cd --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequest.java @@ -0,0 +1,845 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for AddControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddControlRequest} + */ +public final class AddControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddControlRequest) + AddControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddControlRequest.newBuilder() to construct. + private AddControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddControlRequest() { + servingConfig_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddControlRequest( + 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(); + + servingConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_AddControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddControlRequest.class, + com.google.cloud.retail.v2alpha.AddControlRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object servingConfig_; + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTROL_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, controlId_); + } + 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(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, controlId_); + } + 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.v2alpha.AddControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddControlRequest other = + (com.google.cloud.retail.v2alpha.AddControlRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getControlId().equals(other.getControlId())) 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) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.AddControlRequest 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 AddControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddControlRequest) + com.google.cloud.retail.v2alpha.AddControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_AddControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddControlRequest.class, + com.google.cloud.retail.v2alpha.AddControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddControlRequest.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(); + servingConfig_ = ""; + + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddControlRequest build() { + com.google.cloud.retail.v2alpha.AddControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.AddControlRequest result = + new com.google.cloud.retail.v2alpha.AddControlRequest(this); + result.servingConfig_ = servingConfig_; + result.controlId_ = controlId_; + 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.v2alpha.AddControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.AddControlRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + onChanged(); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.v2alpha.AddControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + + servingConfig_ = getDefaultInstance().getServingConfig(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfig_ = value; + onChanged(); + return this; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.v2alpha.AddControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddControlRequest) + private static final com.google.cloud.retail.v2alpha.AddControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.AddControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddControlRequest(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.v2alpha.AddControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequestOrBuilder.java new file mode 100644 index 00000000..4b49436e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddControlRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..f20e548e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadata.java @@ -0,0 +1,466 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the AddFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} + */ +public final class AddFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) + AddFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesMetadata.newBuilder() to construct. + private AddFulfillmentPlacesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesMetadata( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.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.v2alpha.AddFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) 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.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata 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 related to the progress of the AddFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(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.v2alpha.AddFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata other) { + if (other + == com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.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.v2alpha.AddFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) 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.v2alpha.AddFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesMetadata(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.v2alpha.AddFulfillmentPlacesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..76a0aec0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesMetadataOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequest.java new file mode 100644 index 00000000..95ce3391 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequest.java @@ -0,0 +1,1803 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} + */ +public final class AddFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + AddFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesRequest.newBuilder() to construct. + private AddFulfillmentPlacesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (addTime_ != null) { + subBuilder = addTime_.toBuilder(); + } + addTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addTime_); + addTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int ADD_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp addTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + @java.lang.Override + public boolean hasAddTime() { + return addTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAddTime() { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + return getAddTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (addTime_ != null) { + output.writeMessage(4, getAddTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (addTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAddTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.v2alpha.AddFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasAddTime() != other.hasAddTime()) return false; + if (hasAddTime()) { + if (!getAddTime().equals(other.getAddTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasAddTime()) { + hash = (37 * hash) + ADD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAddTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.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(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (addTimeBuilder_ == null) { + addTime_ = null; + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (addTimeBuilder_ == null) { + result.addTime_ = addTime_; + } else { + result.addTime_ = addTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.AddFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest other) { + if (other == com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasAddTime()) { + mergeAddTime(other.getAddTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.AddFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp addTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + addTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + public boolean hasAddTime() { + return addTimeBuilder_ != null || addTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + public com.google.protobuf.Timestamp getAddTime() { + if (addTimeBuilder_ == null) { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } else { + return addTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addTime_ = value; + onChanged(); + } else { + addTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (addTimeBuilder_ == null) { + addTime_ = builderForValue.build(); + onChanged(); + } else { + addTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder mergeAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (addTime_ != null) { + addTime_ = + com.google.protobuf.Timestamp.newBuilder(addTime_).mergeFrom(value).buildPartial(); + } else { + addTime_ = value; + } + onChanged(); + } else { + addTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder clearAddTime() { + if (addTimeBuilder_ == null) { + addTime_ = null; + onChanged(); + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getAddTimeBuilder() { + + onChanged(); + return getAddTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + if (addTimeBuilder_ != null) { + return addTimeBuilder_.getMessageOrBuilder(); + } else { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAddTimeFieldBuilder() { + if (addTimeBuilder_ == null) { + addTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAddTime(), getParentForChildren(), isClean()); + addTime_ = null; + } + return addTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.AddFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesRequest(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.v2alpha.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..f959aba0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,275 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + boolean hasAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + com.google.protobuf.Timestamp getAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponse.java new file mode 100644 index 00000000..0daca1fa --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponse.java @@ -0,0 +1,466 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the AddFulfillmentPlacesRequest.  Currently empty because
+ * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} + */ +public final class AddFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + AddFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesResponse.newBuilder() to construct. + private AddFulfillmentPlacesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesResponse( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.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.v2alpha.AddFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) 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.v2alpha.AddFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse 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 AddFulfillmentPlacesRequest.  Currently empty because
+   * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(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.v2alpha.AddFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse other) { + if (other + == com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.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.v2alpha.AddFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) 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.v2alpha.AddFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesResponse(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.v2alpha.AddFulfillmentPlacesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..a25eeafd --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddFulfillmentPlacesResponseOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadata.java new file mode 100644 index 00000000..2d319cbd --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadata.java @@ -0,0 +1,463 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the AddLocalInventories operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [AddLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} + */ +public final class AddLocalInventoriesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + AddLocalInventoriesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesMetadata.newBuilder() to construct. + private AddLocalInventoriesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesMetadata( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.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.v2alpha.AddLocalInventoriesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata other = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) 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.v2alpha.AddLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata 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 related to the progress of the AddLocalInventories operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [AddLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata build() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata buildPartial() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata result = + new com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(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.v2alpha.AddLocalInventoriesMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata other) { + if (other == com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.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.v2alpha.AddLocalInventoriesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) 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.v2alpha.AddLocalInventoriesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + private static final com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesMetadata(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.v2alpha.AddLocalInventoriesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadataOrBuilder.java new file mode 100644 index 00000000..85acb5a8 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesMetadataOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddLocalInventoriesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequest.java new file mode 100644 index 00000000..4a878c01 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequest.java @@ -0,0 +1,2076 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [AddLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesRequest} + */ +public final class AddLocalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + AddLocalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesRequest.newBuilder() to construct. + private AddLocalInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesRequest() { + product_ = ""; + localInventories_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + localInventories_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + localInventories_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.LocalInventory.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (addMask_ != null) { + subBuilder = addMask_.toBuilder(); + } + addMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addMask_); + addMask_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (addTime_ != null) { + subBuilder = addTime_.toBuilder(); + } + addTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addTime_); + addTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCAL_INVENTORIES_FIELD_NUMBER = 2; + private java.util.List localInventories_; + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getLocalInventoriesList() { + return localInventories_; + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getLocalInventoriesOrBuilderList() { + return localInventories_; + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getLocalInventoriesCount() { + return localInventories_.size(); + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.LocalInventory getLocalInventories(int index) { + return localInventories_.get(index); + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + return localInventories_.get(index); + } + + public static final int ADD_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask addMask_; + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + @java.lang.Override + public boolean hasAddMask() { + return addMask_ != null; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getAddMask() { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder() { + return getAddMask(); + } + + public static final int ADD_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp addTime_; + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + @java.lang.Override + public boolean hasAddTime() { + return addTime_ != null; + } + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAddTime() { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + return getAddTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 6; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the local inventory will still be processed and retained for at
+   * most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + for (int i = 0; i < localInventories_.size(); i++) { + output.writeMessage(2, localInventories_.get(i)); + } + if (addMask_ != null) { + output.writeMessage(4, getAddMask()); + } + if (addTime_ != null) { + output.writeMessage(5, getAddTime()); + } + if (allowMissing_ != false) { + output.writeBool(6, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + for (int i = 0; i < localInventories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, localInventories_.get(i)); + } + if (addMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAddMask()); + } + if (addTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAddTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowMissing_); + } + 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.v2alpha.AddLocalInventoriesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest other = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getLocalInventoriesList().equals(other.getLocalInventoriesList())) return false; + if (hasAddMask() != other.hasAddMask()) return false; + if (hasAddMask()) { + if (!getAddMask().equals(other.getAddMask())) return false; + } + if (hasAddTime() != other.hasAddTime()) return false; + if (hasAddTime()) { + if (!getAddTime().equals(other.getAddTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + if (getLocalInventoriesCount() > 0) { + hash = (37 * hash) + LOCAL_INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventoriesList().hashCode(); + } + if (hasAddMask()) { + hash = (37 * hash) + ADD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getAddMask().hashCode(); + } + if (hasAddTime()) { + hash = (37 * hash) + ADD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAddTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [AddLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLocalInventoriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + product_ = ""; + + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + localInventoriesBuilder_.clear(); + } + if (addMaskBuilder_ == null) { + addMask_ = null; + } else { + addMask_ = null; + addMaskBuilder_ = null; + } + if (addTimeBuilder_ == null) { + addTime_ = null; + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest build() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest buildPartial() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest result = + new com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + if (localInventoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.localInventories_ = localInventories_; + } else { + result.localInventories_ = localInventoriesBuilder_.build(); + } + if (addMaskBuilder_ == null) { + result.addMask_ = addMask_; + } else { + result.addMask_ = addMaskBuilder_.build(); + } + if (addTimeBuilder_ == null) { + result.addTime_ = addTime_; + } else { + result.addTime_ = addTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.AddLocalInventoriesRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest other) { + if (other == com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (localInventoriesBuilder_ == null) { + if (!other.localInventories_.isEmpty()) { + if (localInventories_.isEmpty()) { + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocalInventoriesIsMutable(); + localInventories_.addAll(other.localInventories_); + } + onChanged(); + } + } else { + if (!other.localInventories_.isEmpty()) { + if (localInventoriesBuilder_.isEmpty()) { + localInventoriesBuilder_.dispose(); + localInventoriesBuilder_ = null; + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + localInventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocalInventoriesFieldBuilder() + : null; + } else { + localInventoriesBuilder_.addAllMessages(other.localInventories_); + } + } + } + if (other.hasAddMask()) { + mergeAddMask(other.getAddMask()); + } + if (other.hasAddTime()) { + mergeAddTime(other.getAddTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.AddLocalInventoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.util.List localInventories_ = + java.util.Collections.emptyList(); + + private void ensureLocalInventoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + localInventories_ = + new java.util.ArrayList( + localInventories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.LocalInventory, + com.google.cloud.retail.v2alpha.LocalInventory.Builder, + com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder> + localInventoriesBuilder_; + + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getLocalInventoriesList() { + if (localInventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(localInventories_); + } else { + return localInventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getLocalInventoriesCount() { + if (localInventoriesBuilder_ == null) { + return localInventories_.size(); + } else { + return localInventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.LocalInventory getLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLocalInventories( + int index, com.google.cloud.retail.v2alpha.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, value); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLocalInventories( + int index, com.google.cloud.retail.v2alpha.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addLocalInventories(com.google.cloud.retail.v2alpha.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addLocalInventories( + int index, com.google.cloud.retail.v2alpha.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addLocalInventories( + com.google.cloud.retail.v2alpha.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addLocalInventories( + int index, com.google.cloud.retail.v2alpha.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLocalInventories() { + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + localInventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.remove(index); + onChanged(); + } else { + localInventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.LocalInventory.Builder getLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getLocalInventoriesOrBuilderList() { + if (localInventoriesBuilder_ != null) { + return localInventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localInventories_); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.LocalInventory.Builder addLocalInventoriesBuilder() { + return getLocalInventoriesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.LocalInventory.Builder addLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getLocalInventoriesBuilderList() { + return getLocalInventoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.LocalInventory, + com.google.cloud.retail.v2alpha.LocalInventory.Builder, + com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder> + getLocalInventoriesFieldBuilder() { + if (localInventoriesBuilder_ == null) { + localInventoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.LocalInventory, + com.google.cloud.retail.v2alpha.LocalInventory.Builder, + com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder>( + localInventories_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + localInventories_ = null; + } + return localInventoriesBuilder_; + } + + private com.google.protobuf.FieldMask addMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + addMaskBuilder_; + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + public boolean hasAddMask() { + return addMaskBuilder_ != null || addMask_ != null; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + public com.google.protobuf.FieldMask getAddMask() { + if (addMaskBuilder_ == null) { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } else { + return addMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder setAddMask(com.google.protobuf.FieldMask value) { + if (addMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addMask_ = value; + onChanged(); + } else { + addMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder setAddMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (addMaskBuilder_ == null) { + addMask_ = builderForValue.build(); + onChanged(); + } else { + addMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder mergeAddMask(com.google.protobuf.FieldMask value) { + if (addMaskBuilder_ == null) { + if (addMask_ != null) { + addMask_ = + com.google.protobuf.FieldMask.newBuilder(addMask_).mergeFrom(value).buildPartial(); + } else { + addMask_ = value; + } + onChanged(); + } else { + addMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder clearAddMask() { + if (addMaskBuilder_ == null) { + addMask_ = null; + onChanged(); + } else { + addMask_ = null; + addMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public com.google.protobuf.FieldMask.Builder getAddMaskBuilder() { + + onChanged(); + return getAddMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder() { + if (addMaskBuilder_ != null) { + return addMaskBuilder_.getMessageOrBuilder(); + } else { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getAddMaskFieldBuilder() { + if (addMaskBuilder_ == null) { + addMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getAddMask(), getParentForChildren(), isClean()); + addMask_ = null; + } + return addMaskBuilder_; + } + + private com.google.protobuf.Timestamp addTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + addTimeBuilder_; + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + public boolean hasAddTime() { + return addTimeBuilder_ != null || addTime_ != null; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + public com.google.protobuf.Timestamp getAddTime() { + if (addTimeBuilder_ == null) { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } else { + return addTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder setAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addTime_ = value; + onChanged(); + } else { + addTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder setAddTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (addTimeBuilder_ == null) { + addTime_ = builderForValue.build(); + onChanged(); + } else { + addTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder mergeAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (addTime_ != null) { + addTime_ = + com.google.protobuf.Timestamp.newBuilder(addTime_).mergeFrom(value).buildPartial(); + } else { + addTime_ = value; + } + onChanged(); + } else { + addTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder clearAddTime() { + if (addTimeBuilder_ == null) { + addTime_ = null; + onChanged(); + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getAddTimeBuilder() { + + onChanged(); + return getAddTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + if (addTimeBuilder_ != null) { + return addTimeBuilder_.getMessageOrBuilder(); + } else { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAddTimeFieldBuilder() { + if (addTimeBuilder_ == null) { + addTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAddTime(), getParentForChildren(), isClean()); + addTime_ = null; + } + return addTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.AddLocalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + private static final com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesRequest(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.v2alpha.AddLocalInventoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequestOrBuilder.java new file mode 100644 index 00000000..765a07f0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesRequestOrBuilder.java @@ -0,0 +1,260 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddLocalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getLocalInventoriesList(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.LocalInventory getLocalInventories(int index); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getLocalInventoriesCount(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getLocalInventoriesOrBuilderList(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder getLocalInventoriesOrBuilder(int index); + + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + boolean hasAddMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + com.google.protobuf.FieldMask getAddMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder(); + + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + boolean hasAddTime(); + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + com.google.protobuf.Timestamp getAddTime(); + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the local inventory will still be processed and retained for at
+   * most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponse.java new file mode 100644 index 00000000..87832a31 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponse.java @@ -0,0 +1,463 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the [AddLocalInventories][] API.  Currently empty because
+ * there is no meaningful response populated from the [AddLocalInventories][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesResponse} + */ +public final class AddLocalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + AddLocalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesResponse.newBuilder() to construct. + private AddLocalInventoriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesResponse( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.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.v2alpha.AddLocalInventoriesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse other = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) 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.v2alpha.AddLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse 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 [AddLocalInventories][] API.  Currently empty because
+   * there is no meaningful response populated from the [AddLocalInventories][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AddLocalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.class, + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse build() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse buildPartial() { + com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse result = + new com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(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.v2alpha.AddLocalInventoriesResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse other) { + if (other == com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse.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.v2alpha.AddLocalInventoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) 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.v2alpha.AddLocalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + private static final com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); + } + + public static com.google.cloud.retail.v2alpha.AddLocalInventoriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesResponse(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.v2alpha.AddLocalInventoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponseOrBuilder.java new file mode 100644 index 00000000..37318c76 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AddLocalInventoriesResponseOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface AddLocalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributeConfigLevel.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributeConfigLevel.java new file mode 100644 index 00000000..b9e85c8f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributeConfigLevel.java @@ -0,0 +1,185 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * At which level we offer configuration for attributes.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.AttributeConfigLevel} + */ +public enum AttributeConfigLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Value used when unset. Defaults to
+   * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2alpha.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
+   * 
+ * + * ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + */ + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + */ + PRODUCT_LEVEL_ATTRIBUTE_CONFIG(1), + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [CatalogConfig.attribute_configs][google.cloud.retail.v2alpha.CatalogConfig.attribute_configs].
+   * 
+ * + * CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + */ + CATALOG_LEVEL_ATTRIBUTE_CONFIG(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Value used when unset. Defaults to
+   * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2alpha.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
+   * 
+ * + * ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + */ + public static final int ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + */ + public static final int PRODUCT_LEVEL_ATTRIBUTE_CONFIG_VALUE = 1; + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [CatalogConfig.attribute_configs][google.cloud.retail.v2alpha.CatalogConfig.attribute_configs].
+   * 
+ * + * CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + */ + public static final int CATALOG_LEVEL_ATTRIBUTE_CONFIG_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 AttributeConfigLevel 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 AttributeConfigLevel forNumber(int value) { + switch (value) { + case 0: + return ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED; + case 1: + return PRODUCT_LEVEL_ATTRIBUTE_CONFIG; + case 2: + return CATALOG_LEVEL_ATTRIBUTE_CONFIG; + 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 AttributeConfigLevel findValueByNumber(int number) { + return AttributeConfigLevel.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.v2alpha.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final AttributeConfigLevel[] VALUES = values(); + + public static AttributeConfigLevel 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 AttributeConfigLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.AttributeConfigLevel) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfig.java new file mode 100644 index 00000000..ae2370a3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfig.java @@ -0,0 +1,1296 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Catalog level attribute config.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AttributesConfig} + */ +public final class AttributesConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.AttributesConfig) + AttributesConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttributesConfig.newBuilder() to construct. + private AttributesConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttributesConfig() { + name_ = ""; + attributeConfigLevel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttributesConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttributesConfig( + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + catalogAttributes_ = + com.google.protobuf.MapField.newMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + catalogAttributes__ = + input.readMessage( + CatalogAttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + catalogAttributes_ + .getMutableMap() + .put(catalogAttributes__.getKey(), catalogAttributes__.getValue()); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + attributeConfigLevel_ = rawValue; + 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.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AttributesConfig.class, + com.google.cloud.retail.v2alpha.AttributesConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 CATALOG_ATTRIBUTES_FIELD_NUMBER = 2; + + private static final class CatalogAttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + catalogAttributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + internalGetCatalogAttributes() { + if (catalogAttributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + return catalogAttributes_; + } + + public int getCatalogAttributesCount() { + return internalGetCatalogAttributes().getMap().size(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public boolean containsCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCatalogAttributes().getMap().containsKey(key); + } + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCatalogAttributes() { + return getCatalogAttributesMap(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public java.util.Map + getCatalogAttributesMap() { + return internalGetCatalogAttributes().getMap(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CatalogAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ATTRIBUTE_CONFIG_LEVEL_FIELD_NUMBER = 3; + private int attributeConfigLevel_; + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + @java.lang.Override + public int getAttributeConfigLevelValue() { + return attributeConfigLevel_; + } + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributeConfigLevel getAttributeConfigLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.AttributeConfigLevel result = + com.google.cloud.retail.v2alpha.AttributeConfigLevel.valueOf(attributeConfigLevel_); + return result == null + ? com.google.cloud.retail.v2alpha.AttributeConfigLevel.UNRECOGNIZED + : result; + } + + 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_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetCatalogAttributes(), + CatalogAttributesDefaultEntryHolder.defaultEntry, + 2); + if (attributeConfigLevel_ + != com.google.cloud.retail.v2alpha.AttributeConfigLevel.ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, attributeConfigLevel_); + } + 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_); + } + for (java.util.Map.Entry + entry : internalGetCatalogAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + catalogAttributes__ = + CatalogAttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, catalogAttributes__); + } + if (attributeConfigLevel_ + != com.google.cloud.retail.v2alpha.AttributeConfigLevel.ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, attributeConfigLevel_); + } + 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.v2alpha.AttributesConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.AttributesConfig other = + (com.google.cloud.retail.v2alpha.AttributesConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetCatalogAttributes().equals(other.internalGetCatalogAttributes())) return false; + if (attributeConfigLevel_ != other.attributeConfigLevel_) 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(); + if (!internalGetCatalogAttributes().getMap().isEmpty()) { + hash = (37 * hash) + CATALOG_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetCatalogAttributes().hashCode(); + } + hash = (37 * hash) + ATTRIBUTE_CONFIG_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + attributeConfigLevel_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.AttributesConfig 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; + } + /** + * + * + *
+   * Catalog level attribute config.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.AttributesConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.AttributesConfig) + com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.AttributesConfig.class, + com.google.cloud.retail.v2alpha.AttributesConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.AttributesConfig.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_ = ""; + + internalGetMutableCatalogAttributes().clear(); + attributeConfigLevel_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributesConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.AttributesConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributesConfig build() { + com.google.cloud.retail.v2alpha.AttributesConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributesConfig buildPartial() { + com.google.cloud.retail.v2alpha.AttributesConfig result = + new com.google.cloud.retail.v2alpha.AttributesConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.catalogAttributes_ = internalGetCatalogAttributes(); + result.catalogAttributes_.makeImmutable(); + result.attributeConfigLevel_ = attributeConfigLevel_; + 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.v2alpha.AttributesConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.AttributesConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.AttributesConfig other) { + if (other == com.google.cloud.retail.v2alpha.AttributesConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableCatalogAttributes().mergeFrom(other.internalGetCatalogAttributes()); + if (other.attributeConfigLevel_ != 0) { + setAttributeConfigLevelValue(other.getAttributeConfigLevelValue()); + } + 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.v2alpha.AttributesConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.AttributesConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + catalogAttributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + internalGetCatalogAttributes() { + if (catalogAttributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + return catalogAttributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CatalogAttribute> + internalGetMutableCatalogAttributes() { + onChanged(); + ; + if (catalogAttributes_ == null) { + catalogAttributes_ = + com.google.protobuf.MapField.newMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + if (!catalogAttributes_.isMutable()) { + catalogAttributes_ = catalogAttributes_.copy(); + } + return catalogAttributes_; + } + + public int getCatalogAttributesCount() { + return internalGetCatalogAttributes().getMap().size(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public boolean containsCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCatalogAttributes().getMap().containsKey(key); + } + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCatalogAttributes() { + return getCatalogAttributesMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public java.util.Map + getCatalogAttributesMap() { + return internalGetCatalogAttributes().getMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CatalogAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCatalogAttributes() { + internalGetMutableCatalogAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder removeCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableCatalogAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableCatalogAttributes() { + return internalGetMutableCatalogAttributes().getMutableMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder putCatalogAttributes( + java.lang.String key, com.google.cloud.retail.v2alpha.CatalogAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableCatalogAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder putAllCatalogAttributes( + java.util.Map values) { + internalGetMutableCatalogAttributes().getMutableMap().putAll(values); + return this; + } + + private int attributeConfigLevel_ = 0; + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + @java.lang.Override + public int getAttributeConfigLevelValue() { + return attributeConfigLevel_; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for attributeConfigLevel to set. + * @return This builder for chaining. + */ + public Builder setAttributeConfigLevelValue(int value) { + + attributeConfigLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributeConfigLevel getAttributeConfigLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.AttributeConfigLevel result = + com.google.cloud.retail.v2alpha.AttributeConfigLevel.valueOf(attributeConfigLevel_); + return result == null + ? com.google.cloud.retail.v2alpha.AttributeConfigLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The attributeConfigLevel to set. + * @return This builder for chaining. + */ + public Builder setAttributeConfigLevel( + com.google.cloud.retail.v2alpha.AttributeConfigLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + attributeConfigLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAttributeConfigLevel() { + + attributeConfigLevel_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.AttributesConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.AttributesConfig) + private static final com.google.cloud.retail.v2alpha.AttributesConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.AttributesConfig(); + } + + public static com.google.cloud.retail.v2alpha.AttributesConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttributesConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttributesConfig(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.v2alpha.AttributesConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigName.java new file mode 100644 index 00000000..2c217fed --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigName.java @@ -0,0 +1,223 @@ +/* + * 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.v2alpha; + +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 AttributesConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected AttributesConfigName() { + project = null; + location = null; + catalog = null; + } + + private AttributesConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AttributesConfigName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static AttributesConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "AttributesConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (AttributesConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AttributesConfigName that = ((AttributesConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(AttributesConfigName attributesConfigName) { + this.project = attributesConfigName.project; + this.location = attributesConfigName.location; + this.catalog = attributesConfigName.catalog; + } + + public AttributesConfigName build() { + return new AttributesConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigOrBuilder.java new file mode 100644 index 00000000..6e6c1cdf --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AttributesConfigOrBuilder.java @@ -0,0 +1,186 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface AttributesConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.AttributesConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + int getCatalogAttributesCount(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + boolean containsCatalogAttributes(java.lang.String key); + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getCatalogAttributes(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + java.util.Map + getCatalogAttributesMap(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + + /* nullable */ + com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2alpha.CatalogAttribute defaultValue); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CatalogAttribute> catalog_attributes = 2; + * + */ + com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttributesOrThrow( + java.lang.String key); + + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + int getAttributeConfigLevelValue(); + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + com.google.cloud.retail.v2alpha.AttributeConfigLevel getAttributeConfigLevel(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Audience.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Audience.java new file mode 100644 index 00000000..b13da185 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Audience.java @@ -0,0 +1,1261 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * An intended audience of the [Product][google.cloud.retail.v2alpha.Product]
+ * for whom it's sold.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Audience} + */ +public final class Audience extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Audience) + AudienceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Audience.newBuilder() to construct. + private Audience(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Audience() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Audience(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Audience( + 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)) { + genders_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + genders_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ageGroups_.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)) { + genders_ = genders_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Audience.class, + com.google.cloud.retail.v2alpha.Audience.Builder.class); + } + + public static final int GENDERS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList genders_; + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_; + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + + public static final int AGE_GROUPS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ageGroups_; + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_; + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.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 < genders_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, genders_.getRaw(i)); + } + for (int i = 0; i < ageGroups_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ageGroups_.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 < genders_.size(); i++) { + dataSize += computeStringSizeNoTag(genders_.getRaw(i)); + } + size += dataSize; + size += 1 * getGendersList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ageGroups_.size(); i++) { + dataSize += computeStringSizeNoTag(ageGroups_.getRaw(i)); + } + size += dataSize; + size += 1 * getAgeGroupsList().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.v2alpha.Audience)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Audience other = (com.google.cloud.retail.v2alpha.Audience) obj; + + if (!getGendersList().equals(other.getGendersList())) return false; + if (!getAgeGroupsList().equals(other.getAgeGroupsList())) 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 (getGendersCount() > 0) { + hash = (37 * hash) + GENDERS_FIELD_NUMBER; + hash = (53 * hash) + getGendersList().hashCode(); + } + if (getAgeGroupsCount() > 0) { + hash = (37 * hash) + AGE_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getAgeGroupsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Audience parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Audience parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Audience parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Audience 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; + } + /** + * + * + *
+   * An intended audience of the [Product][google.cloud.retail.v2alpha.Product]
+   * for whom it's sold.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Audience} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Audience) + com.google.cloud.retail.v2alpha.AudienceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Audience.class, + com.google.cloud.retail.v2alpha.Audience.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Audience.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(); + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + ageGroups_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Audience_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Audience getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Audience.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Audience build() { + com.google.cloud.retail.v2alpha.Audience result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Audience buildPartial() { + com.google.cloud.retail.v2alpha.Audience result = + new com.google.cloud.retail.v2alpha.Audience(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + genders_ = genders_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.genders_ = genders_; + if (((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ageGroups_ = ageGroups_; + 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.v2alpha.Audience) { + return mergeFrom((com.google.cloud.retail.v2alpha.Audience) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Audience other) { + if (other == com.google.cloud.retail.v2alpha.Audience.getDefaultInstance()) return this; + if (!other.genders_.isEmpty()) { + if (genders_.isEmpty()) { + genders_ = other.genders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGendersIsMutable(); + genders_.addAll(other.genders_); + } + onChanged(); + } + if (!other.ageGroups_.isEmpty()) { + if (ageGroups_.isEmpty()) { + ageGroups_ = other.ageGroups_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAgeGroupsIsMutable(); + ageGroups_.addAll(other.ageGroups_); + } + 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.v2alpha.Audience parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Audience) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList genders_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGendersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + genders_ = new com.google.protobuf.LazyStringArrayList(genders_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_.getUnmodifiableView(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index to set the value at. + * @param value The genders to set. + * @return This builder for chaining. + */ + public Builder setGenders(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The genders to add. + * @return This builder for chaining. + */ + public Builder addGenders(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param values The genders to add. + * @return This builder for chaining. + */ + public Builder addAllGenders(java.lang.Iterable values) { + ensureGendersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, genders_); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return This builder for chaining. + */ + public Builder clearGenders() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The bytes of the genders to add. + * @return This builder for chaining. + */ + public Builder addGendersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ageGroups_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAgeGroupsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(ageGroups_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_.getUnmodifiableView(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.getByteString(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index to set the value at. + * @param value The ageGroups to set. + * @return This builder for chaining. + */ + public Builder setAgeGroups(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroups(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param values The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAllAgeGroups(java.lang.Iterable values) { + ensureAgeGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ageGroups_); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return This builder for chaining. + */ + public Builder clearAgeGroups() { + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The bytes of the ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroupsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAgeGroupsIsMutable(); + ageGroups_.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.v2alpha.Audience) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Audience) + private static final com.google.cloud.retail.v2alpha.Audience DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Audience(); + } + + public static com.google.cloud.retail.v2alpha.Audience getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Audience parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Audience(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.v2alpha.Audience getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AudienceOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AudienceOrBuilder.java new file mode 100644 index 00000000..00f48e2d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AudienceOrBuilder.java @@ -0,0 +1,203 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface AudienceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Audience) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + java.util.List getGendersList(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + int getGendersCount(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + java.lang.String getGenders(int index); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + com.google.protobuf.ByteString getGendersBytes(int index); + + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + java.util.List getAgeGroupsList(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + int getAgeGroupsCount(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + java.lang.String getAgeGroups(int index); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + com.google.protobuf.ByteString getAgeGroupsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySource.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySource.java new file mode 100644 index 00000000..0f4d3c0e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySource.java @@ -0,0 +1,1937 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * BigQuery source import data from.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.BigQuerySource} + */ +public final class BigQuerySource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.BigQuerySource) + BigQuerySourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQuerySource.newBuilder() to construct. + private BigQuerySource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQuerySource() { + projectId_ = ""; + datasetId_ = ""; + tableId_ = ""; + gcsStagingDir_ = ""; + dataSchema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQuerySource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BigQuerySource( + 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(); + + datasetId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + tableId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + gcsStagingDir_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataSchema_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 50: + { + com.google.type.Date.Builder subBuilder = null; + if (partitionCase_ == 6) { + subBuilder = ((com.google.type.Date) partition_).toBuilder(); + } + partition_ = input.readMessage(com.google.type.Date.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.type.Date) partition_); + partition_ = subBuilder.buildPartial(); + } + partitionCase_ = 6; + 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.BigQuerySource.class, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder.class); + } + + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public enum PartitionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PARTITION_DATE(6), + PARTITION_NOT_SET(0); + private final int value; + + private PartitionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PartitionCase valueOf(int value) { + return forNumber(value); + } + + public static PartitionCase forNumber(int value) { + switch (value) { + case 6: + return PARTITION_DATE; + case 0: + return PARTITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public static final int PARTITION_DATE_FIELD_NUMBER = 6; + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object datasetId_; + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object tableId_; + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + @java.lang.Override + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + 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(); + tableId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCS_STAGING_DIR_FIELD_NUMBER = 3; + private volatile java.lang.Object gcsStagingDir_; + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + @java.lang.Override + public java.lang.String getGcsStagingDir() { + java.lang.Object ref = gcsStagingDir_; + 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(); + gcsStagingDir_ = s; + return s; + } + } + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsStagingDirBytes() { + java.lang.Object ref = gcsStagingDir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsStagingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_SCHEMA_FIELD_NUMBER = 4; + private volatile java.lang.Object dataSchema_; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + @java.lang.Override + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + 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(); + dataSchema_ = s; + return s; + } + } + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, gcsStagingDir_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dataSchema_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, projectId_); + } + if (partitionCase_ == 6) { + output.writeMessage(6, (com.google.type.Date) partition_); + } + 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(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, gcsStagingDir_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dataSchema_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, projectId_); + } + if (partitionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.type.Date) partition_); + } + 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.v2alpha.BigQuerySource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.BigQuerySource other = + (com.google.cloud.retail.v2alpha.BigQuerySource) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getTableId().equals(other.getTableId())) return false; + if (!getGcsStagingDir().equals(other.getGcsStagingDir())) return false; + if (!getDataSchema().equals(other.getDataSchema())) return false; + if (!getPartitionCase().equals(other.getPartitionCase())) return false; + switch (partitionCase_) { + case 6: + if (!getPartitionDate().equals(other.getPartitionDate())) return false; + break; + case 0: + default: + } + 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTableId().hashCode(); + hash = (37 * hash) + GCS_STAGING_DIR_FIELD_NUMBER; + hash = (53 * hash) + getGcsStagingDir().hashCode(); + hash = (37 * hash) + DATA_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDataSchema().hashCode(); + switch (partitionCase_) { + case 6: + hash = (37 * hash) + PARTITION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getPartitionDate().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.BigQuerySource 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; + } + /** + * + * + *
+   * BigQuery source import data from.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.BigQuerySource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.BigQuerySource) + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.BigQuerySource.class, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.BigQuerySource.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(); + projectId_ = ""; + + datasetId_ = ""; + + tableId_ = ""; + + gcsStagingDir_ = ""; + + dataSchema_ = ""; + + partitionCase_ = 0; + partition_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource build() { + com.google.cloud.retail.v2alpha.BigQuerySource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource buildPartial() { + com.google.cloud.retail.v2alpha.BigQuerySource result = + new com.google.cloud.retail.v2alpha.BigQuerySource(this); + if (partitionCase_ == 6) { + if (partitionDateBuilder_ == null) { + result.partition_ = partition_; + } else { + result.partition_ = partitionDateBuilder_.build(); + } + } + result.projectId_ = projectId_; + result.datasetId_ = datasetId_; + result.tableId_ = tableId_; + result.gcsStagingDir_ = gcsStagingDir_; + result.dataSchema_ = dataSchema_; + result.partitionCase_ = partitionCase_; + 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.v2alpha.BigQuerySource) { + return mergeFrom((com.google.cloud.retail.v2alpha.BigQuerySource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.BigQuerySource other) { + if (other == com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + onChanged(); + } + if (!other.getGcsStagingDir().isEmpty()) { + gcsStagingDir_ = other.gcsStagingDir_; + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + onChanged(); + } + switch (other.getPartitionCase()) { + case PARTITION_DATE: + { + mergePartitionDate(other.getPartitionDate()); + break; + } + case PARTITION_NOT_SET: + { + break; + } + } + 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.v2alpha.BigQuerySource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.BigQuerySource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public Builder clearPartition() { + partitionCase_ = 0; + partition_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + partitionDateBuilder_; + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } else { + if (partitionCase_ == 6) { + return partitionDateBuilder_.getMessage(); + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + onChanged(); + } else { + partitionDateBuilder_.setMessage(value); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date.Builder builderForValue) { + if (partitionDateBuilder_ == null) { + partition_ = builderForValue.build(); + onChanged(); + } else { + partitionDateBuilder_.setMessage(builderForValue.build()); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder mergePartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6 && partition_ != com.google.type.Date.getDefaultInstance()) { + partition_ = + com.google.type.Date.newBuilder((com.google.type.Date) partition_) + .mergeFrom(value) + .buildPartial(); + } else { + partition_ = value; + } + onChanged(); + } else { + if (partitionCase_ == 6) { + partitionDateBuilder_.mergeFrom(value); + } else { + partitionDateBuilder_.setMessage(value); + } + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder clearPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + onChanged(); + } + } else { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + } + partitionDateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public com.google.type.Date.Builder getPartitionDateBuilder() { + return getPartitionDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if ((partitionCase_ == 6) && (partitionDateBuilder_ != null)) { + return partitionDateBuilder_.getMessageOrBuilder(); + } else { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getPartitionDateFieldBuilder() { + if (partitionDateBuilder_ == null) { + if (!(partitionCase_ == 6)) { + partition_ = com.google.type.Date.getDefaultInstance(); + } + partitionDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + (com.google.type.Date) partition_, getParentForChildren(), isClean()); + partition_ = null; + } + partitionCase_ = 6; + onChanged(); + ; + return partitionDateBuilder_; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + datasetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + + datasetId_ = getDefaultInstance().getDatasetId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + datasetId_ = value; + onChanged(); + return this; + } + + private java.lang.Object tableId_ = ""; + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableId to set. + * @return This builder for chaining. + */ + public Builder setTableId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tableId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + + tableId_ = getDefaultInstance().getTableId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableId to set. + * @return This builder for chaining. + */ + public Builder setTableIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tableId_ = value; + onChanged(); + return this; + } + + private java.lang.Object gcsStagingDir_ = ""; + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + public java.lang.String getGcsStagingDir() { + java.lang.Object ref = gcsStagingDir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsStagingDir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + public com.google.protobuf.ByteString getGcsStagingDirBytes() { + java.lang.Object ref = gcsStagingDir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsStagingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @param value The gcsStagingDir to set. + * @return This builder for chaining. + */ + public Builder setGcsStagingDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsStagingDir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return This builder for chaining. + */ + public Builder clearGcsStagingDir() { + + gcsStagingDir_ = getDefaultInstance().getGcsStagingDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @param value The bytes for gcsStagingDir to set. + * @return This builder for chaining. + */ + public Builder setGcsStagingDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsStagingDir_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataSchema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @param value The dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataSchema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + + dataSchema_ = getDefaultInstance().getDataSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @param value The bytes for dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataSchema_ = 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.v2alpha.BigQuerySource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.BigQuerySource) + private static final com.google.cloud.retail.v2alpha.BigQuerySource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.BigQuerySource(); + } + + public static com.google.cloud.retail.v2alpha.BigQuerySource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQuerySource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BigQuerySource(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.v2alpha.BigQuerySource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySourceOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySourceOrBuilder.java new file mode 100644 index 00000000..42fee087 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BigQuerySourceOrBuilder.java @@ -0,0 +1,248 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface BigQuerySourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.BigQuerySource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + boolean hasPartitionDate(); + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + 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.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + com.google.type.DateOrBuilder getPartitionDateOrBuilder(); + + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + java.lang.String getTableId(); + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + com.google.protobuf.ByteString getTableIdBytes(); + + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + java.lang.String getGcsStagingDir(); + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + com.google.protobuf.ByteString getGcsStagingDirBytes(); + + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + java.lang.String getDataSchema(); + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); + + public com.google.cloud.retail.v2alpha.BigQuerySource.PartitionCase getPartitionCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BranchName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BranchName.java new file mode 100644 index 00000000..1f6b2fc0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/BranchName.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.v2alpha; + +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 BranchName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_BRANCH = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String branch; + + @Deprecated + protected BranchName() { + project = null; + location = null; + catalog = null; + branch = null; + } + + private BranchName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + branch = Preconditions.checkNotNull(builder.getBranch()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BranchName of(String project, String location, String catalog, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .build(); + } + + public static String format(String project, String location, String catalog, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .build() + .toString(); + } + + public static BranchName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_BRANCH.validatedMatch( + formattedString, "BranchName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("branch")); + } + + 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 (BranchName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_BRANCH.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 (branch != null) { + fieldMapBuilder.put("branch", branch); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_BRANCH.instantiate( + "project", project, "location", location, "catalog", catalog, "branch", branch); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BranchName that = ((BranchName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.branch, that.branch); + } + 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(branch); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String branch; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + 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 setBranch(String branch) { + this.branch = branch; + return this; + } + + private Builder(BranchName branchName) { + this.project = branchName.project; + this.location = branchName.location; + this.catalog = branchName.catalog; + this.branch = branchName.branch; + } + + public BranchName build() { + return new BranchName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Catalog.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Catalog.java new file mode 100644 index 00000000..1705011d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Catalog.java @@ -0,0 +1,1514 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The catalog configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Catalog} + */ +public final class Catalog extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Catalog) + CatalogOrBuilder { + private static final long serialVersionUID = 0L; + // Use Catalog.newBuilder() to construct. + private Catalog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Catalog() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Catalog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Catalog( + 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; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 34: + { + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder subBuilder = null; + if (productLevelConfig_ != null) { + subBuilder = productLevelConfig_.toBuilder(); + } + productLevelConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ProductLevelConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productLevelConfig_); + productLevelConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder subBuilder = null; + if (merchantCenterLinkingConfig_ != null) { + subBuilder = merchantCenterLinkingConfig_.toBuilder(); + } + merchantCenterLinkingConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(merchantCenterLinkingConfig_); + merchantCenterLinkingConfig_ = 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.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Catalog.class, + com.google.cloud.retail.v2alpha.Catalog.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 PRODUCT_LEVEL_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.retail.v2alpha.ProductLevelConfig productLevelConfig_; + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + @java.lang.Override + public boolean hasProductLevelConfig() { + return productLevelConfig_ != null; + } + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductLevelConfig getProductLevelConfig() { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder + getProductLevelConfigOrBuilder() { + return getProductLevelConfig(); + } + + public static final int MERCHANT_CENTER_LINKING_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchantCenterLinkingConfig_; + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + @java.lang.Override + public boolean hasMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfig_ != null; + } + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + getMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder() { + return getMerchantCenterLinkingConfig(); + } + + 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 (productLevelConfig_ != null) { + output.writeMessage(4, getProductLevelConfig()); + } + if (merchantCenterLinkingConfig_ != null) { + output.writeMessage(6, getMerchantCenterLinkingConfig()); + } + 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 (productLevelConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProductLevelConfig()); + } + if (merchantCenterLinkingConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, getMerchantCenterLinkingConfig()); + } + 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.v2alpha.Catalog)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Catalog other = (com.google.cloud.retail.v2alpha.Catalog) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasProductLevelConfig() != other.hasProductLevelConfig()) return false; + if (hasProductLevelConfig()) { + if (!getProductLevelConfig().equals(other.getProductLevelConfig())) return false; + } + if (hasMerchantCenterLinkingConfig() != other.hasMerchantCenterLinkingConfig()) return false; + if (hasMerchantCenterLinkingConfig()) { + if (!getMerchantCenterLinkingConfig().equals(other.getMerchantCenterLinkingConfig())) + 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(); + if (hasProductLevelConfig()) { + hash = (37 * hash) + PRODUCT_LEVEL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getProductLevelConfig().hashCode(); + } + if (hasMerchantCenterLinkingConfig()) { + hash = (37 * hash) + MERCHANT_CENTER_LINKING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMerchantCenterLinkingConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Catalog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Catalog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The catalog configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Catalog} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Catalog) + com.google.cloud.retail.v2alpha.CatalogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Catalog.class, + com.google.cloud.retail.v2alpha.Catalog.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Catalog.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_ = ""; + + displayName_ = ""; + + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = null; + } else { + productLevelConfig_ = null; + productLevelConfigBuilder_ = null; + } + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = null; + } else { + merchantCenterLinkingConfig_ = null; + merchantCenterLinkingConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_Catalog_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Catalog getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Catalog build() { + com.google.cloud.retail.v2alpha.Catalog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Catalog buildPartial() { + com.google.cloud.retail.v2alpha.Catalog result = + new com.google.cloud.retail.v2alpha.Catalog(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (productLevelConfigBuilder_ == null) { + result.productLevelConfig_ = productLevelConfig_; + } else { + result.productLevelConfig_ = productLevelConfigBuilder_.build(); + } + if (merchantCenterLinkingConfigBuilder_ == null) { + result.merchantCenterLinkingConfig_ = merchantCenterLinkingConfig_; + } else { + result.merchantCenterLinkingConfig_ = merchantCenterLinkingConfigBuilder_.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.v2alpha.Catalog) { + return mergeFrom((com.google.cloud.retail.v2alpha.Catalog) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Catalog other) { + if (other == com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasProductLevelConfig()) { + mergeProductLevelConfig(other.getProductLevelConfig()); + } + if (other.hasMerchantCenterLinkingConfig()) { + mergeMerchantCenterLinkingConfig(other.getMerchantCenterLinkingConfig()); + } + 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.v2alpha.Catalog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Catalog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 com.google.cloud.retail.v2alpha.ProductLevelConfig productLevelConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductLevelConfig, + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder, + com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder> + productLevelConfigBuilder_; + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + public boolean hasProductLevelConfig() { + return productLevelConfigBuilder_ != null || productLevelConfig_ != null; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + public com.google.cloud.retail.v2alpha.ProductLevelConfig getProductLevelConfig() { + if (productLevelConfigBuilder_ == null) { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } else { + return productLevelConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProductLevelConfig(com.google.cloud.retail.v2alpha.ProductLevelConfig value) { + if (productLevelConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productLevelConfig_ = value; + onChanged(); + } else { + productLevelConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProductLevelConfig( + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder builderForValue) { + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = builderForValue.build(); + onChanged(); + } else { + productLevelConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProductLevelConfig( + com.google.cloud.retail.v2alpha.ProductLevelConfig value) { + if (productLevelConfigBuilder_ == null) { + if (productLevelConfig_ != null) { + productLevelConfig_ = + com.google.cloud.retail.v2alpha.ProductLevelConfig.newBuilder(productLevelConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + productLevelConfig_ = value; + } + onChanged(); + } else { + productLevelConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProductLevelConfig() { + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = null; + onChanged(); + } else { + productLevelConfig_ = null; + productLevelConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder + getProductLevelConfigBuilder() { + + onChanged(); + return getProductLevelConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder + getProductLevelConfigOrBuilder() { + if (productLevelConfigBuilder_ != null) { + return productLevelConfigBuilder_.getMessageOrBuilder(); + } else { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductLevelConfig, + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder, + com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder> + getProductLevelConfigFieldBuilder() { + if (productLevelConfigBuilder_ == null) { + productLevelConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductLevelConfig, + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder, + com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder>( + getProductLevelConfig(), getParentForChildren(), isClean()); + productLevelConfig_ = null; + } + return productLevelConfigBuilder_; + } + + private com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + merchantCenterLinkingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder> + merchantCenterLinkingConfigBuilder_; + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + public boolean hasMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfigBuilder_ != null || merchantCenterLinkingConfig_ != null; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + getMerchantCenterLinkingConfig() { + if (merchantCenterLinkingConfigBuilder_ == null) { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } else { + return merchantCenterLinkingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder setMerchantCenterLinkingConfig( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig value) { + if (merchantCenterLinkingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + merchantCenterLinkingConfig_ = value; + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder setMerchantCenterLinkingConfig( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder builderForValue) { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = builderForValue.build(); + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder mergeMerchantCenterLinkingConfig( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig value) { + if (merchantCenterLinkingConfigBuilder_ == null) { + if (merchantCenterLinkingConfig_ != null) { + merchantCenterLinkingConfig_ = + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.newBuilder( + merchantCenterLinkingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + merchantCenterLinkingConfig_ = value; + } + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder clearMerchantCenterLinkingConfig() { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = null; + onChanged(); + } else { + merchantCenterLinkingConfig_ = null; + merchantCenterLinkingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder + getMerchantCenterLinkingConfigBuilder() { + + onChanged(); + return getMerchantCenterLinkingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder() { + if (merchantCenterLinkingConfigBuilder_ != null) { + return merchantCenterLinkingConfigBuilder_.getMessageOrBuilder(); + } else { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder> + getMerchantCenterLinkingConfigFieldBuilder() { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder>( + getMerchantCenterLinkingConfig(), getParentForChildren(), isClean()); + merchantCenterLinkingConfig_ = null; + } + return merchantCenterLinkingConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Catalog) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Catalog) + private static final com.google.cloud.retail.v2alpha.Catalog DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Catalog(); + } + + public static com.google.cloud.retail.v2alpha.Catalog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Catalog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Catalog(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.v2alpha.Catalog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttribute.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttribute.java new file mode 100644 index 00000000..ce47c7cf --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttribute.java @@ -0,0 +1,2244 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Catalog level attribute config for an attribute. For example, if customers
+ * want to enable/disable facet for a specific attribute.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CatalogAttribute} + */ +public final class CatalogAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CatalogAttribute) + CatalogAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CatalogAttribute.newBuilder() to construct. + private CatalogAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CatalogAttribute() { + key_ = ""; + type_ = 0; + indexableOption_ = 0; + dynamicFacetableOption_ = 0; + searchableOption_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CatalogAttribute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CatalogAttribute( + 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(); + + key_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + indexableOption_ = rawValue; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + dynamicFacetableOption_ = rawValue; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + searchableOption_ = rawValue; + break; + } + case 72: + { + inUse_ = input.readBool(); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + 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.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CatalogAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CatalogAttribute.class, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder.class); + } + + /** + * + * + *
+   * The type of an attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.CatalogAttribute.AttributeType} + */ + public enum AttributeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the attribute is unknown.
+     * Used when type cannot be derived from attribute that is not
+     * [in_use][google.cloud.retail.v2alpha.CatalogAttribute.in_use].
+     * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * + * + *
+     * Textual attribute.
+     * 
+ * + * TEXTUAL = 1; + */ + TEXTUAL(1), + /** + * + * + *
+     * Numerical attribute.
+     * 
+ * + * NUMERICAL = 2; + */ + NUMERICAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the attribute is unknown.
+     * Used when type cannot be derived from attribute that is not
+     * [in_use][google.cloud.retail.v2alpha.CatalogAttribute.in_use].
+     * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+     * Textual attribute.
+     * 
+ * + * TEXTUAL = 1; + */ + public static final int TEXTUAL_VALUE = 1; + /** + * + * + *
+     * Numerical attribute.
+     * 
+ * + * NUMERICAL = 2; + */ + public static final int NUMERICAL_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 AttributeType 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 AttributeType forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return TEXTUAL; + case 2: + return NUMERICAL; + 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 AttributeType findValueByNumber(int number) { + return AttributeType.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.v2alpha.CatalogAttribute.getDescriptor().getEnumTypes().get(0); + } + + private static final AttributeType[] VALUES = values(); + + public static AttributeType 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 AttributeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.CatalogAttribute.AttributeType) + } + + /** + * + * + *
+   * The status of the indexable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption} + */ + public enum IndexableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + INDEXABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Indexable option enabled for an attribute.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + INDEXABLE_ENABLED(1), + /** + * + * + *
+     * Indexable option disabled for an attribute.
+     * 
+ * + * INDEXABLE_DISABLED = 2; + */ + INDEXABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int INDEXABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indexable option enabled for an attribute.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + public static final int INDEXABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Indexable option disabled for an attribute.
+     * 
+ * + * INDEXABLE_DISABLED = 2; + */ + public static final int INDEXABLE_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 IndexableOption 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 IndexableOption forNumber(int value) { + switch (value) { + case 0: + return INDEXABLE_OPTION_UNSPECIFIED; + case 1: + return INDEXABLE_ENABLED; + case 2: + return INDEXABLE_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 IndexableOption findValueByNumber(int number) { + return IndexableOption.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.v2alpha.CatalogAttribute.getDescriptor().getEnumTypes().get(1); + } + + private static final IndexableOption[] VALUES = values(); + + public static IndexableOption 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 IndexableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption) + } + + /** + * + * + *
+   * The status of the dynamic facetable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption} + */ + public enum DynamicFacetableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Dynamic facetable option enabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + DYNAMIC_FACETABLE_ENABLED(1), + /** + * + * + *
+     * Dynamic facetable option disabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_DISABLED = 2; + */ + DYNAMIC_FACETABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int DYNAMIC_FACETABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Dynamic facetable option enabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + public static final int DYNAMIC_FACETABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Dynamic facetable option disabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_DISABLED = 2; + */ + public static final int DYNAMIC_FACETABLE_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 DynamicFacetableOption 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 DynamicFacetableOption forNumber(int value) { + switch (value) { + case 0: + return DYNAMIC_FACETABLE_OPTION_UNSPECIFIED; + case 1: + return DYNAMIC_FACETABLE_ENABLED; + case 2: + return DYNAMIC_FACETABLE_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 DynamicFacetableOption findValueByNumber(int number) { + return DynamicFacetableOption.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.v2alpha.CatalogAttribute.getDescriptor().getEnumTypes().get(2); + } + + private static final DynamicFacetableOption[] VALUES = values(); + + public static DynamicFacetableOption 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 DynamicFacetableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption) + } + + /** + * + * + *
+   * The status of the searchable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption} + */ + public enum SearchableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + SEARCHABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Searchable option enabled for an attribute.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + SEARCHABLE_ENABLED(1), + /** + * + * + *
+     * Searchable option disabled for an attribute.
+     * 
+ * + * SEARCHABLE_DISABLED = 2; + */ + SEARCHABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int SEARCHABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Searchable option enabled for an attribute.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + public static final int SEARCHABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Searchable option disabled for an attribute.
+     * 
+ * + * SEARCHABLE_DISABLED = 2; + */ + public static final int 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 SearchableOption 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 SearchableOption forNumber(int value) { + switch (value) { + case 0: + return SEARCHABLE_OPTION_UNSPECIFIED; + case 1: + return SEARCHABLE_ENABLED; + case 2: + return 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 SearchableOption findValueByNumber(int number) { + return SearchableOption.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.v2alpha.CatalogAttribute.getDescriptor().getEnumTypes().get(3); + } + + private static final SearchableOption[] VALUES = values(); + + public static SearchableOption 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 SearchableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption) + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IN_USE_FIELD_NUMBER = 9; + private boolean inUse_; + /** + * + * + *
+   * Output only. Indicates whether this attribute has been used by any
+   * products. `True` if at least one
+   * [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
+   * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * Otherwise, this field is `False`.
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
+   * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+   * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
+   * Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
+   * are not in use by products can be deleted.
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
+   * in use by products cannot be deleted; however, their configuration
+   * properties will reset to default values upon removal request.
+   * After catalog changes, it takes about 10 minutes for this field to update.
+   * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + + public static final int TYPE_FIELD_NUMBER = 10; + private int type_; + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType result = + com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.valueOf(type_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.UNRECOGNIZED + : result; + } + + public static final int INDEXABLE_OPTION_FIELD_NUMBER = 5; + private int indexableOption_; + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption getIndexableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.valueOf(indexableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.UNRECOGNIZED + : result; + } + + public static final int DYNAMIC_FACETABLE_OPTION_FIELD_NUMBER = 6; + private int dynamicFacetableOption_; + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.valueOf( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.UNRECOGNIZED + : result; + } + + public static final int SEARCHABLE_OPTION_FIELD_NUMBER = 7; + private int searchableOption_; + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+   * as there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+   * as there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption getSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.valueOf( + searchableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.UNRECOGNIZED + : result; + } + + 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (indexableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, searchableOption_); + } + if (inUse_ != false) { + output.writeBool(9, inUse_); + } + if (type_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { + output.writeEnum(10, type_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (indexableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, searchableOption_); + } + if (inUse_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, inUse_); + } + if (type_ + != com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, type_); + } + 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.v2alpha.CatalogAttribute)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CatalogAttribute other = + (com.google.cloud.retail.v2alpha.CatalogAttribute) obj; + + if (!getKey().equals(other.getKey())) return false; + if (getInUse() != other.getInUse()) return false; + if (type_ != other.type_) return false; + if (indexableOption_ != other.indexableOption_) return false; + if (dynamicFacetableOption_ != other.dynamicFacetableOption_) return false; + if (searchableOption_ != other.searchableOption_) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInUse()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + INDEXABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + indexableOption_; + hash = (37 * hash) + DYNAMIC_FACETABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + dynamicFacetableOption_; + hash = (37 * hash) + SEARCHABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + searchableOption_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CatalogAttribute 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; + } + /** + * + * + *
+   * Catalog level attribute config for an attribute. For example, if customers
+   * want to enable/disable facet for a specific attribute.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CatalogAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CatalogAttribute) + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CatalogAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CatalogAttribute.class, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CatalogAttribute.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(); + key_ = ""; + + inUse_ = false; + + type_ = 0; + + indexableOption_ = 0; + + dynamicFacetableOption_ = 0; + + searchableOption_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute build() { + com.google.cloud.retail.v2alpha.CatalogAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute buildPartial() { + com.google.cloud.retail.v2alpha.CatalogAttribute result = + new com.google.cloud.retail.v2alpha.CatalogAttribute(this); + result.key_ = key_; + result.inUse_ = inUse_; + result.type_ = type_; + result.indexableOption_ = indexableOption_; + result.dynamicFacetableOption_ = dynamicFacetableOption_; + result.searchableOption_ = searchableOption_; + 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.v2alpha.CatalogAttribute) { + return mergeFrom((com.google.cloud.retail.v2alpha.CatalogAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CatalogAttribute other) { + if (other == com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getInUse() != false) { + setInUse(other.getInUse()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.indexableOption_ != 0) { + setIndexableOptionValue(other.getIndexableOptionValue()); + } + if (other.dynamicFacetableOption_ != 0) { + setDynamicFacetableOptionValue(other.getDynamicFacetableOptionValue()); + } + if (other.searchableOption_ != 0) { + setSearchableOptionValue(other.getSearchableOptionValue()); + } + 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.v2alpha.CatalogAttribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.CatalogAttribute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private boolean inUse_; + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The inUse to set. + * @return This builder for chaining. + */ + public Builder setInUse(boolean value) { + + inUse_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearInUse() { + + inUse_ = false; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType result = + com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.valueOf(type_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int indexableOption_ = 0; + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @param value The enum numeric value on the wire for indexableOption to set. + * @return This builder for chaining. + */ + public Builder setIndexableOptionValue(int value) { + + indexableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption getIndexableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.valueOf( + indexableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @param value The indexableOption to set. + * @return This builder for chaining. + */ + public Builder setIndexableOption( + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + indexableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearIndexableOption() { + + indexableOption_ = 0; + onChanged(); + return this; + } + + private int dynamicFacetableOption_ = 0; + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @param value The enum numeric value on the wire for dynamicFacetableOption to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacetableOptionValue(int value) { + + dynamicFacetableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.valueOf( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @param value The dynamicFacetableOption to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacetableOption( + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + dynamicFacetableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacetableOption() { + + dynamicFacetableOption_ = 0; + onChanged(); + return this; + } + + private int searchableOption_ = 0; + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * as there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * as there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @param value The enum numeric value on the wire for searchableOption to set. + * @return This builder for chaining. + */ + public Builder setSearchableOptionValue(int value) { + + searchableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * as there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption getSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption result = + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.valueOf( + searchableOption_); + return result == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * as there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @param value The searchableOption to set. + * @return This builder for chaining. + */ + public Builder setSearchableOption( + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + searchableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+     * as there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchableOption() { + + searchableOption_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CatalogAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CatalogAttribute) + private static final com.google.cloud.retail.v2alpha.CatalogAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CatalogAttribute(); + } + + public static com.google.cloud.retail.v2alpha.CatalogAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CatalogAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CatalogAttribute(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.v2alpha.CatalogAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttributeOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttributeOrBuilder.java new file mode 100644 index 00000000..2c3731e9 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogAttributeOrBuilder.java @@ -0,0 +1,226 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface CatalogAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CatalogAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Output only. Indicates whether this attribute has been used by any
+   * products. `True` if at least one
+   * [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
+   * [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * Otherwise, this field is `False`.
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
+   * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+   * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
+   * Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
+   * are not in use by products can be deleted.
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
+   * in use by products cannot be deleted; however, their configuration
+   * properties will reset to default values upon removal request.
+   * After catalog changes, it takes about 10 minutes for this field to update.
+   * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + boolean getInUse(); + + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType getType(); + + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + int getIndexableOptionValue(); + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The indexableOption. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption getIndexableOption(); + + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + int getDynamicFacetableOptionValue(); + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption(); + + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+   * as there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + int getSearchableOptionValue(); + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
+   * as there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption getSearchableOption(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogName.java new file mode 100644 index 00000000..d1aa58f9 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogName.java @@ -0,0 +1,223 @@ +/* + * 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.v2alpha; + +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 CatalogName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected CatalogName() { + project = null; + location = null; + catalog = null; + } + + private CatalogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CatalogName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static CatalogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "CatalogName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (CatalogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CatalogName that = ((CatalogName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(CatalogName catalogName) { + this.project = catalogName.project; + this.location = catalogName.location; + this.catalog = catalogName.catalog; + } + + public CatalogName build() { + return new CatalogName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogOrBuilder.java new file mode 100644 index 00000000..43b5694a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogOrBuilder.java @@ -0,0 +1,179 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface CatalogOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Catalog) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + boolean hasProductLevelConfig(); + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + com.google.cloud.retail.v2alpha.ProductLevelConfig getProductLevelConfig(); + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder getProductLevelConfigOrBuilder(); + + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + boolean hasMerchantCenterLinkingConfig(); + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig getMerchantCenterLinkingConfig(); + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogProto.java new file mode 100644 index 00000000..72ebd8d8 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogProto.java @@ -0,0 +1,253 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public final class CatalogProto { + private CatalogProto() {} + + 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_v2alpha_ProductLevelConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CatalogAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AttributesConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompletionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Catalog_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Catalog_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/v2alpha/catalog.pr" + + "oto\022\033google.cloud.retail.v2alpha\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032(google/cloud/retail/v2alph" + + "a/common.proto\032/google/cloud/retail/v2al" + + "pha/import_config.proto\"^\n\022ProductLevelC" + + "onfig\022\036\n\026ingestion_product_type\030\001 \001(\t\022(\n" + + " merchant_center_product_id_field\030\002 \001(\t\"" + + "\257\006\n\020CatalogAttribute\022\020\n\003key\030\001 \001(\tB\003\340A\002\022\023" + + "\n\006in_use\030\t \001(\010B\003\340A\003\022N\n\004type\030\n \001(\0162;.goog" + + "le.cloud.retail.v2alpha.CatalogAttribute" + + ".AttributeTypeB\003\340A\003\022W\n\020indexable_option\030" + + "\005 \001(\0162=.google.cloud.retail.v2alpha.Cata" + + "logAttribute.IndexableOption\022f\n\030dynamic_" + + "facetable_option\030\006 \001(\0162D.google.cloud.re" + + "tail.v2alpha.CatalogAttribute.DynamicFac" + + "etableOption\022Y\n\021searchable_option\030\007 \001(\0162" + + ">.google.cloud.retail.v2alpha.CatalogAtt" + + "ribute.SearchableOption\"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\034INDEXABLE_OPTION" + + "_UNSPECIFIED\020\000\022\025\n\021INDEXABLE_ENABLED\020\001\022\026\n" + + "\022INDEXABLE_DISABLED\020\002\"\201\001\n\026DynamicFacetab" + + "leOption\022(\n$DYNAMIC_FACETABLE_OPTION_UNS" + + "PECIFIED\020\000\022\035\n\031DYNAMIC_FACETABLE_ENABLED\020" + + "\001\022\036\n\032DYNAMIC_FACETABLE_DISABLED\020\002\"f\n\020Sea" + + "rchableOption\022!\n\035SEARCHABLE_OPTION_UNSPE" + + "CIFIED\020\000\022\026\n\022SEARCHABLE_ENABLED\020\001\022\027\n\023SEAR" + + "CHABLE_DISABLED\020\002\"\305\003\n\020AttributesConfig\022\024" + + "\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022`\n\022catalog_attribut" + + "es\030\002 \003(\0132D.google.cloud.retail.v2alpha.A" + + "ttributesConfig.CatalogAttributesEntry\022V" + + "\n\026attribute_config_level\030\003 \001(\01621.google." + + "cloud.retail.v2alpha.AttributeConfigLeve" + + "lB\003\340A\003\032g\n\026CatalogAttributesEntry\022\013\n\003key\030" + + "\001 \001(\t\022<\n\005value\030\002 \001(\0132-.google.cloud.reta" + + "il.v2alpha.CatalogAttribute:\0028\001:x\352Au\n&re" + + "tail.googleapis.com/AttributesConfig\022Kpr" + + "ojects/{project}/locations/{location}/ca" + + "talogs/{catalog}/attributesConfig\"\250\005\n\020Co" + + "mpletionConfig\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022\026\n\016" + + "matching_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_con" + + "fig\030\005 \001(\01326.google.cloud.retail.v2alpha." + + "CompletionDataInputConfigB\003\340A\003\022.\n!last_s" + + "uggestions_import_operation\030\006 \001(\tB\003\340A\003\022Z" + + "\n\025denylist_input_config\030\007 \001(\01326.google.c" + + "loud.retail.v2alpha.CompletionDataInputC" + + "onfigB\003\340A\003\022+\n\036last_denylist_import_opera" + + "tion\030\010 \001(\tB\003\340A\003\022[\n\026allowlist_input_confi" + + "g\030\t \001(\01326.google.cloud.retail.v2alpha.Co" + + "mpletionDataInputConfigB\003\340A\003\022,\n\037last_all" + + "owlist_import_operation\030\n \001(\tB\003\340A\003:x\352Au\n" + + "&retail.googleapis.com/CompletionConfig\022" + + "Kprojects/{project}/locations/{location}" + + "/catalogs/{catalog}/completionConfig\"\222\001\n" + + "\022MerchantCenterLink\022\'\n\032merchant_center_a" + + "ccount_id\030\001 \001(\003B\003\340A\002\022\021\n\tbranch_id\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\033MerchantCen" + + "terLinkingConfig\022>\n\005links\030\001 \003(\0132/.google" + + ".cloud.retail.v2alpha.MerchantCenterLink" + + "\"\323\002\n\007Catalog\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022\034\n\014di" + + "splay_name\030\002 \001(\tB\006\340A\002\340A\005\022R\n\024product_leve" + + "l_config\030\004 \001(\0132/.google.cloud.retail.v2a" + + "lpha.ProductLevelConfigB\003\340A\002\022`\n\036merchant" + + "_center_linking_config\030\006 \001(\01328.google.cl" + + "oud.retail.v2alpha.MerchantCenterLinking" + + "Config:^\352A[\n\035retail.googleapis.com/Catal" + + "og\022:projects/{project}/locations/{locati" + + "on}/catalogs/{catalog}B\332\001\n\037com.google.cl" + + "oud.retail.v2alphaB\014CatalogProtoP\001ZAgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "retail/v2alpha;retail\242\002\006RETAIL\252\002\033Google." + + "Cloud.Retail.V2Alpha\312\002\033Google\\Cloud\\Reta" + + "il\\V2alpha\352\002\036Google::Cloud::Retail::V2al" + + "phab\006proto3" + }; + 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.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_descriptor, + new java.lang.String[] { + "IngestionProductType", "MerchantCenterProductIdField", + }); + internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_CatalogAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CatalogAttribute_descriptor, + new java.lang.String[] { + "Key", + "InUse", + "Type", + "IndexableOption", + "DynamicFacetableOption", + "SearchableOption", + }); + internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_AttributesConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor, + new java.lang.String[] { + "Name", "CatalogAttributes", "AttributeConfigLevel", + }); + internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_AttributesConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AttributesConfig_CatalogAttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_CompletionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor, + new java.lang.String[] { + "Name", + "MatchingOrder", + "MaxSuggestions", + "MinPrefixLength", + "AutoLearning", + "SuggestionsInputConfig", + "LastSuggestionsImportOperation", + "DenylistInputConfig", + "LastDenylistImportOperation", + "AllowlistInputConfig", + "LastAllowlistImportOperation", + }); + internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor, + new java.lang.String[] { + "MerchantCenterAccountId", "BranchId", "Destinations", "RegionCode", "LanguageCode", + }); + internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor, + new java.lang.String[] { + "Links", + }); + internal_static_google_cloud_retail_v2alpha_Catalog_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_Catalog_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Catalog_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "ProductLevelConfig", "MerchantCenterLinkingConfig", + }); + 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.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceProto.java new file mode 100644 index 00000000..c9207e9b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceProto.java @@ -0,0 +1,355 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class CatalogServiceProto { + private CatalogServiceProto() {} + + 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_v2alpha_ListCatalogsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/retail/v2alpha/catalog_se" + + "rvice.proto\022\033google.cloud.retail.v2alpha" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032)goo" + + "gle/cloud/retail/v2alpha/catalog.proto\032\033" + + "google/protobuf/empty.proto\032 google/prot" + + "obuf/field_mask.proto\032\037google/protobuf/t" + + "imestamp.proto\"w\n\023ListCatalogsRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googlea" + + "pis.com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" + + "age_token\030\003 \001(\t\"g\n\024ListCatalogsResponse\022" + + "6\n\010catalogs\030\001 \003(\0132$.google.cloud.retail." + + "v2alpha.Catalog\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\203\001\n\024UpdateCatalogRequest\022:\n\007catalog\030\001 \001" + + "(\0132$.google.cloud.retail.v2alpha.Catalog" + + "B\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMask\"\241\001\n\027SetDefaultBranchReque" + + "st\0223\n\007catalog\030\001 \001(\tB\"\372A\037\n\035retail.googlea" + + "pis.com/Catalog\0224\n\tbranch_id\030\002 \001(\tB!\372A\036\n" + + "\034retail.googleapis.com/Branch\022\014\n\004note\030\003 " + + "\001(\t\022\r\n\005force\030\004 \001(\010\"N\n\027GetDefaultBranchRe" + + "quest\0223\n\007catalog\030\001 \001(\tB\"\372A\037\n\035retail.goog" + + "leapis.com/Catalog\"\211\001\n\030GetDefaultBranchR" + + "esponse\0221\n\006branch\030\001 \001(\tB!\372A\036\n\034retail.goo" + + "gleapis.com/Branch\022,\n\010set_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022\014\n\004note\030\003 \001(\t\"Z" + + "\n\032GetCompletionConfigRequest\022<\n\004name\030\001 \001" + + "(\tB.\340A\002\372A(\n&retail.googleapis.com/Comple" + + "tionConfig\"\237\001\n\035UpdateCompletionConfigReq" + + "uest\022M\n\021completion_config\030\001 \001(\0132-.google" + + ".cloud.retail.v2alpha.CompletionConfigB\003" + + "\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.protob" + + "uf.FieldMask\"Z\n\032GetAttributesConfigReque" + + "st\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&retail.googlea" + + "pis.com/AttributesConfig\"\237\001\n\035UpdateAttri" + + "butesConfigRequest\022M\n\021attributes_config\030" + + "\001 \001(\0132-.google.cloud.retail.v2alpha.Attr" + + "ibutesConfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032" + + ".google.protobuf.FieldMask\"\266\001\n\032AddCatalo" + + "gAttributeRequest\022I\n\021attributes_config\030\001" + + " \001(\tB.\340A\002\372A(\n&retail.googleapis.com/Attr" + + "ibutesConfig\022M\n\021catalog_attribute\030\002 \001(\0132" + + "-.google.cloud.retail.v2alpha.CatalogAtt" + + "ributeB\003\340A\002\"|\n\035RemoveCatalogAttributeReq" + + "uest\022I\n\021attributes_config\030\001 \001(\tB.\340A\002\372A(\n" + + "&retail.googleapis.com/AttributesConfig\022" + + "\020\n\003key\030\002 \001(\tB\003\340A\002\"\353\001\n\036ReplaceCatalogAttr" + + "ibuteRequest\022I\n\021attributes_config\030\001 \001(\tB" + + ".\340A\002\372A(\n&retail.googleapis.com/Attribute" + + "sConfig\022M\n\021catalog_attribute\030\002 \001(\0132-.goo" + + "gle.cloud.retail.v2alpha.CatalogAttribut" + + "eB\003\340A\002\022/\n\013update_mask\030\003 \001(\0132\032.google.pro" + + "tobuf.FieldMask2\267\024\n\016CatalogService\022\267\001\n\014L" + + "istCatalogs\0220.google.cloud.retail.v2alph" + + "a.ListCatalogsRequest\0321.google.cloud.ret" + + "ail.v2alpha.ListCatalogsResponse\"B\202\323\344\223\0023" + + "\0221/v2alpha/{parent=projects/*/locations/" + + "*}/catalogs\332A\006parent\022\312\001\n\rUpdateCatalog\0221" + + ".google.cloud.retail.v2alpha.UpdateCatal" + + "ogRequest\032$.google.cloud.retail.v2alpha." + + "Catalog\"`\202\323\344\223\002D29/v2alpha/{catalog.name=" + + "projects/*/locations/*/catalogs/*}:\007cata" + + "log\332A\023catalog,update_mask\022\274\001\n\020SetDefault" + + "Branch\0224.google.cloud.retail.v2alpha.Set" + + "DefaultBranchRequest\032\026.google.protobuf.E" + + "mpty\"Z\202\323\344\223\002J\"E/v2alpha/{catalog=projects" + + "/*/locations/*/catalogs/*}:setDefaultBra" + + "nch:\001*\332A\007catalog\022\330\001\n\020GetDefaultBranch\0224." + + "google.cloud.retail.v2alpha.GetDefaultBr" + + "anchRequest\0325.google.cloud.retail.v2alph" + + "a.GetDefaultBranchResponse\"W\202\323\344\223\002G\022E/v2a" + + "lpha/{catalog=projects/*/locations/*/cat" + + "alogs/*}:getDefaultBranch\332A\007catalog\022\320\001\n\023" + + "GetCompletionConfig\0227.google.cloud.retai" + + "l.v2alpha.GetCompletionConfigRequest\032-.g" + + "oogle.cloud.retail.v2alpha.CompletionCon" + + "fig\"Q\202\323\344\223\002D\022B/v2alpha/{name=projects/*/l" + + "ocations/*/catalogs/*/completionConfig}\332" + + "A\004name\022\225\002\n\026UpdateCompletionConfig\022:.goog" + + "le.cloud.retail.v2alpha.UpdateCompletion" + + "ConfigRequest\032-.google.cloud.retail.v2al" + + "pha.CompletionConfig\"\217\001\202\323\344\223\002i2T/v2alpha/" + + "{completion_config.name=projects/*/locat" + + "ions/*/catalogs/*/completionConfig}:\021com" + + "pletion_config\332A\035completion_config,updat" + + "e_mask\022\320\001\n\023GetAttributesConfig\0227.google." + + "cloud.retail.v2alpha.GetAttributesConfig" + + "Request\032-.google.cloud.retail.v2alpha.At" + + "tributesConfig\"Q\202\323\344\223\002D\022B/v2alpha/{name=p" + + "rojects/*/locations/*/catalogs/*/attribu" + + "tesConfig}\332A\004name\022\225\002\n\026UpdateAttributesCo" + + "nfig\022:.google.cloud.retail.v2alpha.Updat" + + "eAttributesConfigRequest\032-.google.cloud." + + "retail.v2alpha.AttributesConfig\"\217\001\202\323\344\223\002i" + + "2T/v2alpha/{attributes_config.name=proje" + + "cts/*/locations/*/catalogs/*/attributesC" + + "onfig}:\021attributes_config\332A\035attributes_c" + + "onfig,update_mask\022\355\001\n\023AddCatalogAttribut" + + "e\0227.google.cloud.retail.v2alpha.AddCatal" + + "ogAttributeRequest\032-.google.cloud.retail" + + ".v2alpha.AttributesConfig\"n\202\323\344\223\002h\"c/v2al" + + "pha/{attributes_config=projects/*/locati" + + "ons/*/catalogs/*/attributesConfig}:addCa" + + "talogAttribute:\001*\022\366\001\n\026RemoveCatalogAttri" + + "bute\022:.google.cloud.retail.v2alpha.Remov" + + "eCatalogAttributeRequest\032-.google.cloud." + + "retail.v2alpha.AttributesConfig\"q\202\323\344\223\002k\"" + + "f/v2alpha/{attributes_config=projects/*/" + + "locations/*/catalogs/*/attributesConfig}" + + ":removeCatalogAttribute:\001*\022\371\001\n\027ReplaceCa" + + "talogAttribute\022;.google.cloud.retail.v2a" + + "lpha.ReplaceCatalogAttributeRequest\032-.go" + + "ogle.cloud.retail.v2alpha.AttributesConf" + + "ig\"r\202\323\344\223\002l\"g/v2alpha/{attributes_config=" + + "projects/*/locations/*/catalogs/*/attrib" + + "utesConfig}:replaceCatalogAttribute:\001*\032I" + + "\312A\025retail.googleapis.com\322A.https://www.g" + + "oogleapis.com/auth/cloud-platformB\341\001\n\037co" + + "m.google.cloud.retail.v2alphaB\023CatalogSe" + + "rviceProtoP\001ZAgoogle.golang.org/genproto" + + "/googleapis/cloud/retail/v2alpha;retail\242" + + "\002\006RETAIL\252\002\033Google.Cloud.Retail.V2Alpha\312\002" + + "\033Google\\Cloud\\Retail\\V2alpha\352\002\036Google::C" + + "loud::Retail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.CatalogProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor, + new java.lang.String[] { + "Catalogs", "NextPageToken", + }); + internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor, + new java.lang.String[] { + "Catalog", "UpdateMask", + }); + internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor, + new java.lang.String[] { + "Catalog", "BranchId", "Note", "Force", + }); + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor, + new java.lang.String[] { + "Catalog", + }); + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor, + new java.lang.String[] { + "Branch", "SetTime", "Note", + }); + internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor, + new java.lang.String[] { + "CompletionConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "CatalogAttribute", + }); + internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "Key", + }); + internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "CatalogAttribute", "UpdateMask", + }); + 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); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.CatalogProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequest.java new file mode 100644 index 00000000..452f6247 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequest.java @@ -0,0 +1,1130 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for CollectUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CollectUserEventRequest} + */ +public final class CollectUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CollectUserEventRequest) + CollectUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CollectUserEventRequest.newBuilder() to construct. + private CollectUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CollectUserEventRequest() { + parent_ = ""; + userEvent_ = ""; + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CollectUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CollectUserEventRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + userEvent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 32: + { + ets_ = input.readInt64(); + 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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CollectUserEventRequest.class, + com.google.cloud.retail.v2alpha.CollectUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_FIELD_NUMBER = 2; + private volatile java.lang.Object userEvent_; + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + @java.lang.Override + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + 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(); + userEvent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 3; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETS_FIELD_NUMBER = 4; + private long ets_; + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + @java.lang.Override + public long getEts() { + return ets_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userEvent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userEvent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (ets_ != 0L) { + output.writeInt64(4, ets_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userEvent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userEvent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (ets_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ets_); + } + 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.v2alpha.CollectUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CollectUserEventRequest other = + (com.google.cloud.retail.v2alpha.CollectUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserEvent().equals(other.getUserEvent())) return false; + if (!getUri().equals(other.getUri())) return false; + if (getEts() != other.getEts()) 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) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + ETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEts()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CollectUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for CollectUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CollectUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CollectUserEventRequest) + com.google.cloud.retail.v2alpha.CollectUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CollectUserEventRequest.class, + com.google.cloud.retail.v2alpha.CollectUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CollectUserEventRequest.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_ = ""; + + userEvent_ = ""; + + uri_ = ""; + + ets_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CollectUserEventRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CollectUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CollectUserEventRequest build() { + com.google.cloud.retail.v2alpha.CollectUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CollectUserEventRequest buildPartial() { + com.google.cloud.retail.v2alpha.CollectUserEventRequest result = + new com.google.cloud.retail.v2alpha.CollectUserEventRequest(this); + result.parent_ = parent_; + result.userEvent_ = userEvent_; + result.uri_ = uri_; + result.ets_ = ets_; + 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.v2alpha.CollectUserEventRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.CollectUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CollectUserEventRequest other) { + if (other == com.google.cloud.retail.v2alpha.CollectUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getUserEvent().isEmpty()) { + userEvent_ = other.userEvent_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getEts() != 0L) { + setEts(other.getEts()); + } + 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.v2alpha.CollectUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CollectUserEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 java.lang.Object userEvent_ = ""; + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userEvent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userEvent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserEvent() { + + userEvent_ = getDefaultInstance().getUserEvent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userEvent_ = value; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private long ets_; + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + @java.lang.Override + public long getEts() { + return ets_; + } + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @param value The ets to set. + * @return This builder for chaining. + */ + public Builder setEts(long value) { + + ets_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @return This builder for chaining. + */ + public Builder clearEts() { + + ets_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CollectUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CollectUserEventRequest) + private static final com.google.cloud.retail.v2alpha.CollectUserEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CollectUserEventRequest(); + } + + public static com.google.cloud.retail.v2alpha.CollectUserEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CollectUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CollectUserEventRequest(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.v2alpha.CollectUserEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequestOrBuilder.java new file mode 100644 index 00000000..4122ae5d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CollectUserEventRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CollectUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CollectUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + java.lang.String getUserEvent(); + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + com.google.protobuf.ByteString getUserEventBytes(); + + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + long getEts(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfo.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfo.java new file mode 100644 index 00000000..ecb78fe3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfo.java @@ -0,0 +1,1260 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The color information of a [Product][google.cloud.retail.v2alpha.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ColorInfo} + */ +public final class ColorInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ColorInfo) + ColorInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ColorInfo.newBuilder() to construct. + private ColorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColorInfo() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColorInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ColorInfo( + 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)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + colorFamilies_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + colors_.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)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ColorInfo.class, + com.google.cloud.retail.v2alpha.ColorInfo.Builder.class); + } + + public static final int COLOR_FAMILIES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList colorFamilies_; + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_; + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + + public static final int COLORS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList colors_; + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_; + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.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 < colorFamilies_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, colorFamilies_.getRaw(i)); + } + for (int i = 0; i < colors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, colors_.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 < colorFamilies_.size(); i++) { + dataSize += computeStringSizeNoTag(colorFamilies_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorFamiliesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < colors_.size(); i++) { + dataSize += computeStringSizeNoTag(colors_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorsList().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.v2alpha.ColorInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ColorInfo other = + (com.google.cloud.retail.v2alpha.ColorInfo) obj; + + if (!getColorFamiliesList().equals(other.getColorFamiliesList())) return false; + if (!getColorsList().equals(other.getColorsList())) 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 (getColorFamiliesCount() > 0) { + hash = (37 * hash) + COLOR_FAMILIES_FIELD_NUMBER; + hash = (53 * hash) + getColorFamiliesList().hashCode(); + } + if (getColorsCount() > 0) { + hash = (37 * hash) + COLORS_FIELD_NUMBER; + hash = (53 * hash) + getColorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ColorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The color information of a [Product][google.cloud.retail.v2alpha.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ColorInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ColorInfo) + com.google.cloud.retail.v2alpha.ColorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ColorInfo.class, + com.google.cloud.retail.v2alpha.ColorInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ColorInfo.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(); + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + colors_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ColorInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ColorInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ColorInfo build() { + com.google.cloud.retail.v2alpha.ColorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ColorInfo buildPartial() { + com.google.cloud.retail.v2alpha.ColorInfo result = + new com.google.cloud.retail.v2alpha.ColorInfo(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.colorFamilies_ = colorFamilies_; + if (((bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.colors_ = colors_; + 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.v2alpha.ColorInfo) { + return mergeFrom((com.google.cloud.retail.v2alpha.ColorInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ColorInfo other) { + if (other == com.google.cloud.retail.v2alpha.ColorInfo.getDefaultInstance()) return this; + if (!other.colorFamilies_.isEmpty()) { + if (colorFamilies_.isEmpty()) { + colorFamilies_ = other.colorFamilies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColorFamiliesIsMutable(); + colorFamilies_.addAll(other.colorFamilies_); + } + onChanged(); + } + if (!other.colors_.isEmpty()) { + if (colors_.isEmpty()) { + colors_ = other.colors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureColorsIsMutable(); + colors_.addAll(other.colors_); + } + 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.v2alpha.ColorInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.ColorInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList colorFamilies_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorFamiliesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(colorFamilies_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_.getUnmodifiableView(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index to set the value at. + * @param value The colorFamilies to set. + * @return This builder for chaining. + */ + public Builder setColorFamilies(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamilies(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param values The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addAllColorFamilies(java.lang.Iterable values) { + ensureColorFamiliesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colorFamilies_); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return This builder for chaining. + */ + public Builder clearColorFamilies() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The bytes of the colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamiliesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList colors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(colors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_.getUnmodifiableView(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.getByteString(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index to set the value at. + * @param value The colors to set. + * @return This builder for chaining. + */ + public Builder setColors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The colors to add. + * @return This builder for chaining. + */ + public Builder addColors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param values The colors to add. + * @return This builder for chaining. + */ + public Builder addAllColors(java.lang.Iterable values) { + ensureColorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colors_); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return This builder for chaining. + */ + public Builder clearColors() { + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The bytes of the colors to add. + * @return This builder for chaining. + */ + public Builder addColorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorsIsMutable(); + colors_.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.v2alpha.ColorInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ColorInfo) + private static final com.google.cloud.retail.v2alpha.ColorInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ColorInfo(); + } + + public static com.google.cloud.retail.v2alpha.ColorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColorInfo(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.v2alpha.ColorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfoOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfoOrBuilder.java new file mode 100644 index 00000000..99505c5e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ColorInfoOrBuilder.java @@ -0,0 +1,203 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface ColorInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ColorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + java.util.List getColorFamiliesList(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + int getColorFamiliesCount(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + java.lang.String getColorFamilies(int index); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + com.google.protobuf.ByteString getColorFamiliesBytes(int index); + + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + java.util.List getColorsList(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + int getColorsCount(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + java.lang.String getColors(int index); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + com.google.protobuf.ByteString getColorsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CommonProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CommonProto.java new file mode 100644 index 00000000..bad82b81 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CommonProto.java @@ -0,0 +1,453 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public final class CommonProto { + private CommonProto() {} + + 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_v2alpha_Condition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Condition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Audience_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Audience_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ColorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Image_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Interval_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PriceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Rating_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Rating_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_LocalInventory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_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/v2alpha/common.pro" + + "to\022\033google.cloud.retail.v2alpha\032\037google/" + + "api/field_behavior.proto\032\037google/protobu" + + "f/timestamp.proto\"\272\002\n\tCondition\022E\n\013query" + + "_terms\030\001 \003(\01320.google.cloud.retail.v2alp" + + "ha.Condition.QueryTerm\022K\n\021active_time_ra" + + "nge\030\003 \003(\01320.google.cloud.retail.v2alpha." + + "Condition.TimeRange\032.\n\tQueryTerm\022\r\n\005valu" + + "e\030\001 \001(\t\022\022\n\nfull_match\030\002 \001(\010\032i\n\tTimeRange" + + "\022.\n\nstart_time\030\001 \001(\0132\032.google.protobuf.T" + + "imestamp\022,\n\010end_time\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\"\252\t\n\004Rule\022E\n\014boost_action\030" + + "\002 \001(\0132-.google.cloud.retail.v2alpha.Rule" + + ".BoostActionH\000\022K\n\017redirect_action\030\003 \001(\0132" + + "0.google.cloud.retail.v2alpha.Rule.Redir" + + "ectActionH\000\022X\n\026oneway_synonyms_action\030\006 " + + "\001(\01326.google.cloud.retail.v2alpha.Rule.O" + + "newaySynonymsActionH\000\022Y\n\027do_not_associat" + + "e_action\030\007 \001(\01326.google.cloud.retail.v2a" + + "lpha.Rule.DoNotAssociateActionH\000\022Q\n\022repl" + + "acement_action\030\010 \001(\01323.google.cloud.reta" + + "il.v2alpha.Rule.ReplacementActionH\000\022G\n\ri" + + "gnore_action\030\t \001(\0132..google.cloud.retail" + + ".v2alpha.Rule.IgnoreActionH\000\022G\n\rfilter_a" + + "ction\030\n \001(\0132..google.cloud.retail.v2alph" + + "a.Rule.FilterActionH\000\022X\n\026twoway_synonyms" + + "_action\030\013 \001(\01326.google.cloud.retail.v2al" + + "pha.Rule.TwowaySynonymsActionH\000\022>\n\tcondi" + + "tion\030\001 \001(\0132&.google.cloud.retail.v2alpha" + + ".ConditionB\003\340A\002\0325\n\013BoostAction\022\r\n\005boost\030" + + "\001 \001(\002\022\027\n\017products_filter\030\002 \001(\t\032\036\n\014Filter" + + "Action\022\016\n\006filter\030\001 \001(\t\032&\n\016RedirectAction" + + "\022\024\n\014redirect_uri\030\001 \001(\t\032(\n\024TwowaySynonyms" + + "Action\022\020\n\010synonyms\030\001 \003(\t\032S\n\024OnewaySynony" + + "msAction\022\023\n\013query_terms\030\003 \003(\t\022\020\n\010synonym" + + "s\030\004 \003(\t\022\024\n\014oneway_terms\030\002 \003(\t\032Z\n\024DoNotAs" + + "sociateAction\022\023\n\013query_terms\030\002 \003(\t\022\036\n\026do" + + "_not_associate_terms\030\003 \003(\t\022\r\n\005terms\030\001 \003(" + + "\t\032P\n\021ReplacementAction\022\023\n\013query_terms\030\002 " + + "\003(\t\022\030\n\020replacement_term\030\003 \001(\t\022\014\n\004term\030\001 " + + "\001(\t\032$\n\014IgnoreAction\022\024\n\014ignore_terms\030\001 \003(" + + "\tB\010\n\006action\"/\n\010Audience\022\017\n\007genders\030\001 \003(\t" + + "\022\022\n\nage_groups\030\002 \003(\t\"3\n\tColorInfo\022\026\n\016col" + + "or_families\030\001 \003(\t\022\016\n\006colors\030\002 \003(\t\"~\n\017Cus" + + "tomAttribute\022\014\n\004text\030\001 \003(\t\022\017\n\007numbers\030\002 " + + "\003(\001\022\027\n\nsearchable\030\003 \001(\010H\000\210\001\001\022\026\n\tindexabl" + + "e\030\004 \001(\010H\001\210\001\001B\r\n\013_searchableB\014\n\n_indexabl" + + "e\"2\n\017FulfillmentInfo\022\014\n\004type\030\001 \001(\t\022\021\n\tpl" + + "ace_ids\030\002 \003(\t\"8\n\005Image\022\020\n\003uri\030\001 \001(\tB\003\340A\002" + + "\022\016\n\006height\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\"x\n\010Inter" + + "val\022\021\n\007minimum\030\001 \001(\001H\000\022\033\n\021exclusive_mini" + + "mum\030\002 \001(\001H\000\022\021\n\007maximum\030\003 \001(\001H\001\022\033\n\021exclus" + + "ive_maximum\030\004 \001(\001H\001B\005\n\003minB\005\n\003max\"\231\003\n\tPr" + + "iceInfo\022\025\n\rcurrency_code\030\001 \001(\t\022\r\n\005price\030" + + "\002 \001(\002\022\026\n\016original_price\030\003 \001(\002\022\014\n\004cost\030\004 " + + "\001(\002\0228\n\024price_effective_time\030\005 \001(\0132\032.goog" + + "le.protobuf.Timestamp\0225\n\021price_expire_ti" + + "me\030\006 \001(\0132\032.google.protobuf.Timestamp\022K\n\013" + + "price_range\030\007 \001(\01321.google.cloud.retail." + + "v2alpha.PriceInfo.PriceRangeB\003\340A\003\032\201\001\n\nPr" + + "iceRange\0224\n\005price\030\001 \001(\0132%.google.cloud.r" + + "etail.v2alpha.Interval\022=\n\016original_price" + + "\030\002 \001(\0132%.google.cloud.retail.v2alpha.Int" + + "erval\"P\n\006Rating\022\024\n\014rating_count\030\001 \001(\005\022\026\n" + + "\016average_rating\030\002 \001(\002\022\030\n\020rating_histogra" + + "m\030\003 \003(\005\"`\n\010UserInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n\n" + + "ip_address\030\002 \001(\t\022\022\n\nuser_agent\030\003 \001(\t\022\033\n\023" + + "direct_user_request\030\004 \001(\010\"\260\002\n\016LocalInven" + + "tory\022\020\n\010place_id\030\001 \001(\t\022:\n\nprice_info\030\002 \001" + + "(\0132&.google.cloud.retail.v2alpha.PriceIn" + + "fo\022O\n\nattributes\030\003 \003(\0132;.google.cloud.re" + + "tail.v2alpha.LocalInventory.AttributesEn" + + "try\022\036\n\021fulfillment_types\030\004 \003(\tB\003\340A\004\032_\n\017A" + + "ttributesEntry\022\013\n\003key\030\001 \001(\t\022;\n\005value\030\002 \001" + + "(\0132,.google.cloud.retail.v2alpha.CustomA" + + "ttribute:\0028\001*\206\001\n\024AttributeConfigLevel\022&\n" + + "\"ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED\020\000\022\"\n" + + "\036PRODUCT_LEVEL_ATTRIBUTE_CONFIG\020\001\022\"\n\036CAT" + + "ALOG_LEVEL_ATTRIBUTE_CONFIG\020\002*i\n\014Solutio" + + "nType\022\035\n\031SOLUTION_TYPE_UNSPECIFIED\020\000\022 \n\034" + + "SOLUTION_TYPE_RECOMMENDATION\020\001\022\030\n\024SOLUTI" + + "ON_TYPE_SEARCH\020\002*\213\001\n\025SearchSolutionUseCa" + + "se\022(\n$SEARCH_SOLUTION_USE_CASE_UNSPECIFI" + + "ED\020\000\022#\n\037SEARCH_SOLUTION_USE_CASE_SEARCH\020" + + "\001\022#\n\037SEARCH_SOLUTION_USE_CASE_BROWSE\020\002B\331" + + "\001\n\037com.google.cloud.retail.v2alphaB\013Comm" + + "onProtoP\001ZAgoogle.golang.org/genproto/go" + + "ogleapis/cloud/retail/v2alpha;retail\242\002\006R" + + "ETAIL\252\002\033Google.Cloud.Retail.V2Alpha\312\002\033Go" + + "ogle\\Cloud\\Retail\\V2alpha\352\002\036Google::Clou" + + "d::Retail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_Condition_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Condition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Condition_descriptor, + new java.lang.String[] { + "QueryTerms", "ActiveTimeRange", + }); + internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor = + internal_static_google_cloud_retail_v2alpha_Condition_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor, + new java.lang.String[] { + "Value", "FullMatch", + }); + internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor = + internal_static_google_cloud_retail_v2alpha_Condition_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", + }); + internal_static_google_cloud_retail_v2alpha_Rule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_descriptor, + new java.lang.String[] { + "BoostAction", + "RedirectAction", + "OnewaySynonymsAction", + "DoNotAssociateAction", + "ReplacementAction", + "IgnoreAction", + "FilterAction", + "TwowaySynonymsAction", + "Condition", + "Action", + }); + internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor, + new java.lang.String[] { + "Boost", "ProductsFilter", + }); + internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor, + new java.lang.String[] { + "Filter", + }); + internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor, + new java.lang.String[] { + "RedirectUri", + }); + internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor, + new java.lang.String[] { + "Synonyms", + }); + internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor, + new java.lang.String[] { + "QueryTerms", "Synonyms", "OnewayTerms", + }); + internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor, + new java.lang.String[] { + "QueryTerms", "DoNotAssociateTerms", "Terms", + }); + internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor, + new java.lang.String[] { + "QueryTerms", "ReplacementTerm", "Term", + }); + internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor = + internal_static_google_cloud_retail_v2alpha_Rule_descriptor.getNestedTypes().get(7); + internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor, + new java.lang.String[] { + "IgnoreTerms", + }); + internal_static_google_cloud_retail_v2alpha_Audience_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_Audience_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Audience_descriptor, + new java.lang.String[] { + "Genders", "AgeGroups", + }); + internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_ColorInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ColorInfo_descriptor, + new java.lang.String[] { + "ColorFamilies", "Colors", + }); + internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor, + new java.lang.String[] { + "Text", "Numbers", "Searchable", "Indexable", "Searchable", "Indexable", + }); + internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor, + new java.lang.String[] { + "Type", "PlaceIds", + }); + internal_static_google_cloud_retail_v2alpha_Image_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_Image_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Image_descriptor, + new java.lang.String[] { + "Uri", "Height", "Width", + }); + internal_static_google_cloud_retail_v2alpha_Interval_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2alpha_Interval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Interval_descriptor, + new java.lang.String[] { + "Minimum", "ExclusiveMinimum", "Maximum", "ExclusiveMaximum", "Min", "Max", + }); + internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2alpha_PriceInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor, + new java.lang.String[] { + "CurrencyCode", + "Price", + "OriginalPrice", + "Cost", + "PriceEffectiveTime", + "PriceExpireTime", + "PriceRange", + }); + internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor = + internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor, + new java.lang.String[] { + "Price", "OriginalPrice", + }); + internal_static_google_cloud_retail_v2alpha_Rating_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2alpha_Rating_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Rating_descriptor, + new java.lang.String[] { + "RatingCount", "AverageRating", "RatingHistogram", + }); + internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2alpha_UserInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor, + new java.lang.String[] { + "UserId", "IpAddress", "UserAgent", "DirectUserRequest", + }); + internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2alpha_LocalInventory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor, + new java.lang.String[] { + "PlaceId", "PriceInfo", "Attributes", "FulfillmentTypes", + }); + internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequest.java new file mode 100644 index 00000000..d64f45b2 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequest.java @@ -0,0 +1,1994 @@ +/* + * 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/v2alpha/completion_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Auto-complete parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryRequest} + */ +public final class CompleteQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompleteQueryRequest) + CompleteQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryRequest.newBuilder() to construct. + private CompleteQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryRequest() { + catalog_ = ""; + query_ = ""; + visitorId_ = ""; + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deviceType_ = ""; + dataset_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryRequest( + 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(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + languageCodes_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + deviceType_ = s; + break; + } + case 40: + { + maxSuggestions_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataset_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = 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)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryRequest.class, + com.google.cloud.retail.v2alpha.CompleteQueryRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languageCodes_; + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return languageCodes_; + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object deviceType_; + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_FIELD_NUMBER = 6; + private volatile java.lang.Object dataset_; + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + @java.lang.Override + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + 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(); + dataset_ = s; + return s; + } + } + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_SUGGESTIONS_FIELD_NUMBER = 5; + private int maxSuggestions_; + /** + * + * + *
+   * Completion max suggestions. If left unset or set to 0, then will fallback
+   * to the configured value
+   * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
+   * The maximum allowed max suggestions is 20. If it is set higher, it will be
+   * capped by 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + for (int i = 0; i < languageCodes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCodes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceType_); + } + if (maxSuggestions_ != 0) { + output.writeInt32(5, maxSuggestions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dataset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, visitorId_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + { + int dataSize = 0; + for (int i = 0; i < languageCodes_.size(); i++) { + dataSize += computeStringSizeNoTag(languageCodes_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguageCodesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deviceType_); + } + if (maxSuggestions_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxSuggestions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dataset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, visitorId_); + } + 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.v2alpha.CompleteQueryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompleteQueryRequest other = + (com.google.cloud.retail.v2alpha.CompleteQueryRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getLanguageCodesList().equals(other.getLanguageCodesList())) return false; + if (!getDeviceType().equals(other.getDeviceType())) return false; + if (!getDataset().equals(other.getDataset())) return false; + if (getMaxSuggestions() != other.getMaxSuggestions()) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (getLanguageCodesCount() > 0) { + hash = (37 * hash) + LANGUAGE_CODES_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCodesList().hashCode(); + } + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + hash = (37 * hash) + MAX_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxSuggestions(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CompleteQueryRequest 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; + } + /** + * + * + *
+   * Auto-complete parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompleteQueryRequest) + com.google.cloud.retail.v2alpha.CompleteQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryRequest.class, + com.google.cloud.retail.v2alpha.CompleteQueryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CompleteQueryRequest.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(); + catalog_ = ""; + + query_ = ""; + + visitorId_ = ""; + + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + deviceType_ = ""; + + dataset_ = ""; + + maxSuggestions_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompleteQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryRequest build() { + com.google.cloud.retail.v2alpha.CompleteQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryRequest buildPartial() { + com.google.cloud.retail.v2alpha.CompleteQueryRequest result = + new com.google.cloud.retail.v2alpha.CompleteQueryRequest(this); + int from_bitField0_ = bitField0_; + result.catalog_ = catalog_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languageCodes_ = languageCodes_; + result.deviceType_ = deviceType_; + result.dataset_ = dataset_; + result.maxSuggestions_ = maxSuggestions_; + 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.v2alpha.CompleteQueryRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.CompleteQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CompleteQueryRequest other) { + if (other == com.google.cloud.retail.v2alpha.CompleteQueryRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.languageCodes_.isEmpty()) { + if (languageCodes_.isEmpty()) { + languageCodes_ = other.languageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguageCodesIsMutable(); + languageCodes_.addAll(other.languageCodes_); + } + onChanged(); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + onChanged(); + } + if (!other.getDataset().isEmpty()) { + dataset_ = other.dataset_; + onChanged(); + } + if (other.getMaxSuggestions() != 0) { + setMaxSuggestions(other.getMaxSuggestions()); + } + 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.v2alpha.CompleteQueryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CompleteQueryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languageCodes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(languageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return languageCodes_.getUnmodifiableView(); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index to set the value at. + * @param value The languageCodes to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param values The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addAllLanguageCodes(java.lang.Iterable values) { + ensureLanguageCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languageCodes_); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCodes() { + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The bytes of the languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object deviceType_ = ""; + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + + deviceType_ = getDefaultInstance().getDeviceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataset_ = ""; + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @param value The dataset to set. + * @return This builder for chaining. + */ + public Builder setDataset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return This builder for chaining. + */ + public Builder clearDataset() { + + dataset_ = getDefaultInstance().getDataset(); + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @param value The bytes for dataset to set. + * @return This builder for chaining. + */ + public Builder setDatasetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataset_ = value; + onChanged(); + return this; + } + + private int maxSuggestions_; + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @param value The maxSuggestions to set. + * @return This builder for chaining. + */ + public Builder setMaxSuggestions(int value) { + + maxSuggestions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxSuggestions() { + + maxSuggestions_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CompleteQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompleteQueryRequest) + private static final com.google.cloud.retail.v2alpha.CompleteQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CompleteQueryRequest(); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryRequest(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.v2alpha.CompleteQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequestOrBuilder.java new file mode 100644 index 00000000..966f4cab --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryRequestOrBuilder.java @@ -0,0 +1,292 @@ +/* + * 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/v2alpha/completion_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CompleteQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompleteQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + java.util.List getLanguageCodesList(); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + int getLanguageCodesCount(); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + java.lang.String getLanguageCodes(int index); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + com.google.protobuf.ByteString getLanguageCodesBytes(int index); + + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString getDeviceTypeBytes(); + + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + java.lang.String getDataset(); + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + com.google.protobuf.ByteString getDatasetBytes(); + + /** + * + * + *
+   * Completion max suggestions. If left unset or set to 0, then will fallback
+   * to the configured value
+   * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
+   * The maximum allowed max suggestions is 20. If it is set higher, it will be
+   * capped by 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + int getMaxSuggestions(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponse.java new file mode 100644 index 00000000..e6eda58e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponse.java @@ -0,0 +1,4002 @@ +/* + * 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/v2alpha/completion_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the auto-complete query.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse} + */ +public final class CompleteQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompleteQueryResponse) + CompleteQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryResponse.newBuilder() to construct. + private CompleteQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryResponse() { + completionResults_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + recentSearchResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryResponse( + 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)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult>(); + mutable_bitField0_ |= 0x00000001; + } + completionResults_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult>(); + mutable_bitField0_ |= 0x00000002; + } + recentSearchResults_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + .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)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.Builder.class); + } + + public interface CompletionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + java.lang.String getSuggestion(); + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + com.google.protobuf.ByteString getSuggestionBytes(); + + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + int getAttributesCount(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getAttributes(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute defaultValue); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Resource that represents completion results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} + */ + public static final class CompletionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + CompletionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionResult.newBuilder() to construct. + private CompletionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionResult() { + suggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionResult( + 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(); + + suggestion_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + 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.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder.class); + } + + public static final int SUGGESTION_FIELD_NUMBER = 1; + private volatile java.lang.Object suggestion_; + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + @java.lang.Override + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + 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(); + suggestion_ = s; + return s; + } + } + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(suggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, suggestion_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2); + 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(suggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, suggestion_); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__); + } + 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.v2alpha.CompleteQueryResponse.CompletionResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult other = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) obj; + + if (!getSuggestion().equals(other.getSuggestion())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) 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) + SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSuggestion().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult 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; + } + /** + * + * + *
+     * Resource that represents completion results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.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(); + suggestion_ = ""; + + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult build() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult buildPartial() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult result = + new com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(this); + int from_bitField0_ = bitField0_; + result.suggestion_ = suggestion_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + 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.v2alpha.CompleteQueryResponse.CompletionResult) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult other) { + if (other + == com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + .getDefaultInstance()) return this; + if (!other.getSuggestion().isEmpty()) { + suggestion_ = other.suggestion_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + 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.v2alpha.CompleteQueryResponse.CompletionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object suggestion_ = ""; + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + suggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + suggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return This builder for chaining. + */ + public Builder clearSuggestion() { + + suggestion_ = getDefaultInstance().getSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The bytes for suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + suggestion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 2; + * + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + private static final com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionResult(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.v2alpha.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RecentSearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + java.lang.String getRecentSearch(); + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + com.google.protobuf.ByteString getRecentSearchBytes(); + } + /** + * + * + *
+   * Recent search of this user.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} + */ + public static final class RecentSearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + RecentSearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecentSearchResult.newBuilder() to construct. + private RecentSearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecentSearchResult() { + recentSearch_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecentSearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RecentSearchResult( + 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(); + + recentSearch_ = 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.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + .class); + } + + public static final int RECENT_SEARCH_FIELD_NUMBER = 1; + private volatile java.lang.Object recentSearch_; + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + @java.lang.Override + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + 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(); + recentSearch_ = s; + return s; + } + } + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = 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(recentSearch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, recentSearch_); + } + 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(recentSearch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, recentSearch_); + } + 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.v2alpha.CompleteQueryResponse.RecentSearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult other = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) obj; + + if (!getRecentSearch().equals(other.getRecentSearch())) 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) + RECENT_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearch().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult 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; + } + /** + * + * + *
+     * Recent search of this user.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.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(); + recentSearch_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult build() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + buildPartial() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult result = + new com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(this); + result.recentSearch_ = recentSearch_; + 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.v2alpha.CompleteQueryResponse.RecentSearchResult) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult other) { + if (other + == com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()) return this; + if (!other.getRecentSearch().isEmpty()) { + recentSearch_ = other.recentSearch_; + 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.v2alpha.CompleteQueryResponse.RecentSearchResult parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object recentSearch_ = ""; + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recentSearch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recentSearch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return This builder for chaining. + */ + public Builder clearRecentSearch() { + + recentSearch_ = getDefaultInstance().getRecentSearch(); + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The bytes for recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recentSearch_ = 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.v2alpha.CompleteQueryResponse.RecentSearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + private static final com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecentSearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecentSearchResult(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.v2alpha.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int COMPLETION_RESULTS_FIELD_NUMBER = 1; + private java.util.List + completionResults_; + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List + getCompletionResultsList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public int getCompletionResultsCount() { + return completionResults_.size(); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + getCompletionResults(int index) { + return completionResults_.get(index); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + return completionResults_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECENT_SEARCH_RESULTS_FIELD_NUMBER = 3; + private java.util.List + recentSearchResults_; + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List + getRecentSearchResultsList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public int getRecentSearchResultsCount() { + return recentSearchResults_.size(); + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + getRecentSearchResults(int index) { + return recentSearchResults_.get(index); + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + return recentSearchResults_.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 { + for (int i = 0; i < completionResults_.size(); i++) { + output.writeMessage(1, completionResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + output.writeMessage(3, recentSearchResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < completionResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, completionResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, recentSearchResults_.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.v2alpha.CompleteQueryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompleteQueryResponse other = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse) obj; + + if (!getCompletionResultsList().equals(other.getCompletionResultsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getRecentSearchResultsList().equals(other.getRecentSearchResultsList())) 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 (getCompletionResultsCount() > 0) { + hash = (37 * hash) + COMPLETION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getCompletionResultsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getRecentSearchResultsCount() > 0) { + hash = (37 * hash) + RECENT_SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearchResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CompleteQueryResponse 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 auto-complete query.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompleteQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompleteQueryResponse) + com.google.cloud.retail.v2alpha.CompleteQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.class, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CompleteQueryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCompletionResultsFieldBuilder(); + getRecentSearchResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + completionResultsBuilder_.clear(); + } + attributionToken_ = ""; + + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CompletionServiceProto + .internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompleteQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse build() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompleteQueryResponse buildPartial() { + com.google.cloud.retail.v2alpha.CompleteQueryResponse result = + new com.google.cloud.retail.v2alpha.CompleteQueryResponse(this); + int from_bitField0_ = bitField0_; + if (completionResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.completionResults_ = completionResults_; + } else { + result.completionResults_ = completionResultsBuilder_.build(); + } + result.attributionToken_ = attributionToken_; + if (recentSearchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.recentSearchResults_ = recentSearchResults_; + } else { + result.recentSearchResults_ = recentSearchResultsBuilder_.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.v2alpha.CompleteQueryResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.CompleteQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CompleteQueryResponse other) { + if (other == com.google.cloud.retail.v2alpha.CompleteQueryResponse.getDefaultInstance()) + return this; + if (completionResultsBuilder_ == null) { + if (!other.completionResults_.isEmpty()) { + if (completionResults_.isEmpty()) { + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCompletionResultsIsMutable(); + completionResults_.addAll(other.completionResults_); + } + onChanged(); + } + } else { + if (!other.completionResults_.isEmpty()) { + if (completionResultsBuilder_.isEmpty()) { + completionResultsBuilder_.dispose(); + completionResultsBuilder_ = null; + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + completionResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCompletionResultsFieldBuilder() + : null; + } else { + completionResultsBuilder_.addAllMessages(other.completionResults_); + } + } + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (recentSearchResultsBuilder_ == null) { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResults_.isEmpty()) { + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.addAll(other.recentSearchResults_); + } + onChanged(); + } + } else { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResultsBuilder_.isEmpty()) { + recentSearchResultsBuilder_.dispose(); + recentSearchResultsBuilder_ = null; + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + recentSearchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRecentSearchResultsFieldBuilder() + : null; + } else { + recentSearchResultsBuilder_.addAllMessages(other.recentSearchResults_); + } + } + } + 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.v2alpha.CompleteQueryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CompleteQueryResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + completionResults_ = java.util.Collections.emptyList(); + + private void ensureCompletionResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult>( + completionResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder> + completionResultsBuilder_; + + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List + getCompletionResultsList() { + if (completionResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(completionResults_); + } else { + return completionResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public int getCompletionResultsCount() { + if (completionResultsBuilder_ == null) { + return completionResults_.size(); + } else { + return completionResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + getCompletionResults(int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.set(index, value); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.set(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(index, value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addAllCompletionResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult> + values) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, completionResults_); + onChanged(); + } else { + completionResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder clearCompletionResults() { + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + completionResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder removeCompletionResults(int index) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.remove(index); + onChanged(); + } else { + completionResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + getCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + if (completionResultsBuilder_ != null) { + return completionResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(completionResults_); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder() { + return getCompletionResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder> + getCompletionResultsBuilderList() { + return getCompletionResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsFieldBuilder() { + if (completionResultsBuilder_ == null) { + completionResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder>( + completionResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + completionResults_ = null; + } + return completionResultsBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.util.List + recentSearchResults_ = java.util.Collections.emptyList(); + + private void ensureRecentSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult>( + recentSearchResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder> + recentSearchResultsBuilder_; + + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List + getRecentSearchResultsList() { + if (recentSearchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } else { + return recentSearchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public int getRecentSearchResultsCount() { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.size(); + } else { + return recentSearchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + getRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addAllRecentSearchResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult> + values) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recentSearchResults_); + onChanged(); + } else { + recentSearchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder clearRecentSearchResults() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder removeRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.remove(index); + onChanged(); + } else { + recentSearchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + getRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + if (recentSearchResultsBuilder_ != null) { + return recentSearchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder() { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder> + getRecentSearchResultsBuilderList() { + return getRecentSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsFieldBuilder() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder>( + recentSearchResults_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + recentSearchResults_ = null; + } + return recentSearchResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CompleteQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompleteQueryResponse) + private static final com.google.cloud.retail.v2alpha.CompleteQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CompleteQueryResponse(); + } + + public static com.google.cloud.retail.v2alpha.CompleteQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryResponse(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.v2alpha.CompleteQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponseOrBuilder.java new file mode 100644 index 00000000..494569c4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompleteQueryResponseOrBuilder.java @@ -0,0 +1,264 @@ +/* + * 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/v2alpha/completion_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CompleteQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompleteQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List + getCompletionResultsList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult getCompletionResults( + int index); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + int getCompletionResultsCount(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index); + + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List + getRecentSearchResultsList(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult getRecentSearchResults( + int index); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + int getRecentSearchResultsCount(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfig.java new file mode 100644 index 00000000..76d9fe1a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfig.java @@ -0,0 +1,2776 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Catalog level autocomplete config for customers to customize autocomplete
+ * feature's settings.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionConfig} + */ +public final class CompletionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompletionConfig) + CompletionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionConfig.newBuilder() to construct. + private CompletionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionConfig() { + name_ = ""; + matchingOrder_ = ""; + lastSuggestionsImportOperation_ = ""; + lastDenylistImportOperation_ = ""; + lastAllowlistImportOperation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionConfig( + 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; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + matchingOrder_ = s; + break; + } + case 24: + { + maxSuggestions_ = input.readInt32(); + break; + } + case 32: + { + minPrefixLength_ = input.readInt32(); + break; + } + case 42: + { + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder subBuilder = null; + if (suggestionsInputConfig_ != null) { + subBuilder = suggestionsInputConfig_.toBuilder(); + } + suggestionsInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(suggestionsInputConfig_); + suggestionsInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastSuggestionsImportOperation_ = s; + break; + } + case 58: + { + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder subBuilder = null; + if (denylistInputConfig_ != null) { + subBuilder = denylistInputConfig_.toBuilder(); + } + denylistInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(denylistInputConfig_); + denylistInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastDenylistImportOperation_ = s; + break; + } + case 74: + { + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder subBuilder = null; + if (allowlistInputConfig_ != null) { + subBuilder = allowlistInputConfig_.toBuilder(); + } + allowlistInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allowlistInputConfig_); + allowlistInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastAllowlistImportOperation_ = s; + break; + } + case 88: + { + autoLearning_ = 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.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CompletionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionConfig.class, + com.google.cloud.retail.v2alpha.CompletionConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 MATCHING_ORDER_FIELD_NUMBER = 2; + private volatile java.lang.Object matchingOrder_; + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + @java.lang.Override + public java.lang.String getMatchingOrder() { + java.lang.Object ref = matchingOrder_; + 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(); + matchingOrder_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMatchingOrderBytes() { + java.lang.Object ref = matchingOrder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + matchingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_SUGGESTIONS_FIELD_NUMBER = 3; + private int maxSuggestions_; + /** + * + * + *
+   * The maximum number of autocomplete suggestions returned per term. The
+   * maximum allowed max suggestions is 20. Default value is 20. If left unset
+   * or set to 0, then will fallback to default value.
+   * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + + public static final int MIN_PREFIX_LENGTH_FIELD_NUMBER = 4; + private int minPrefixLength_; + /** + * + * + *
+   * The minimum number of characters needed to be typed in order to get
+   * suggestions. Default value is 2. If left unset or set to 0, then will
+   * fallback to default value.
+   * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + + public static final int AUTO_LEARNING_FIELD_NUMBER = 11; + private boolean autoLearning_; + /** + * + * + *
+   * If set to true, the auto learning function is enabled. Auto learning uses
+   * user data to generate suggestions using ML techniques. Default value is
+   * false. Only after enabling auto learning can users use `cloud-retail`
+   * data in
+   * [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
+   * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + @java.lang.Override + public boolean getAutoLearning() { + return autoLearning_; + } + + public static final int SUGGESTIONS_INPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig suggestionsInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + @java.lang.Override + public boolean hasSuggestionsInputConfig() { + return suggestionsInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getSuggestionsInputConfig() { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder() { + return getSuggestionsInputConfig(); + } + + public static final int LAST_SUGGESTIONS_IMPORT_OPERATION_FIELD_NUMBER = 6; + private volatile java.lang.Object lastSuggestionsImportOperation_; + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + @java.lang.Override + public java.lang.String getLastSuggestionsImportOperation() { + java.lang.Object ref = lastSuggestionsImportOperation_; + 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(); + lastSuggestionsImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastSuggestionsImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENYLIST_INPUT_CONFIG_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig denylistInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + @java.lang.Override + public boolean hasDenylistInputConfig() { + return denylistInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getDenylistInputConfig() { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder() { + return getDenylistInputConfig(); + } + + public static final int LAST_DENYLIST_IMPORT_OPERATION_FIELD_NUMBER = 8; + private volatile java.lang.Object lastDenylistImportOperation_; + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + @java.lang.Override + public java.lang.String getLastDenylistImportOperation() { + java.lang.Object ref = lastDenylistImportOperation_; + 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(); + lastDenylistImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastDenylistImportOperationBytes() { + java.lang.Object ref = lastDenylistImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastDenylistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOWLIST_INPUT_CONFIG_FIELD_NUMBER = 9; + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig allowlistInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + @java.lang.Override + public boolean hasAllowlistInputConfig() { + return allowlistInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getAllowlistInputConfig() { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder() { + return getAllowlistInputConfig(); + } + + public static final int LAST_ALLOWLIST_IMPORT_OPERATION_FIELD_NUMBER = 10; + private volatile java.lang.Object lastAllowlistImportOperation_; + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + @java.lang.Override + public java.lang.String getLastAllowlistImportOperation() { + java.lang.Object ref = lastAllowlistImportOperation_; + 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(); + lastAllowlistImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastAllowlistImportOperationBytes() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAllowlistImportOperation_ = 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(matchingOrder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, matchingOrder_); + } + if (maxSuggestions_ != 0) { + output.writeInt32(3, maxSuggestions_); + } + if (minPrefixLength_ != 0) { + output.writeInt32(4, minPrefixLength_); + } + if (suggestionsInputConfig_ != null) { + output.writeMessage(5, getSuggestionsInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastSuggestionsImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 6, lastSuggestionsImportOperation_); + } + if (denylistInputConfig_ != null) { + output.writeMessage(7, getDenylistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastDenylistImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, lastDenylistImportOperation_); + } + if (allowlistInputConfig_ != null) { + output.writeMessage(9, getAllowlistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAllowlistImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, lastAllowlistImportOperation_); + } + if (autoLearning_ != false) { + output.writeBool(11, autoLearning_); + } + 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(matchingOrder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, matchingOrder_); + } + if (maxSuggestions_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSuggestions_); + } + if (minPrefixLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, minPrefixLength_); + } + if (suggestionsInputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSuggestionsInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastSuggestionsImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 6, lastSuggestionsImportOperation_); + } + if (denylistInputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDenylistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastDenylistImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(8, lastDenylistImportOperation_); + } + if (allowlistInputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getAllowlistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAllowlistImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 10, lastAllowlistImportOperation_); + } + if (autoLearning_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, autoLearning_); + } + 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.v2alpha.CompletionConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompletionConfig other = + (com.google.cloud.retail.v2alpha.CompletionConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getMatchingOrder().equals(other.getMatchingOrder())) return false; + if (getMaxSuggestions() != other.getMaxSuggestions()) return false; + if (getMinPrefixLength() != other.getMinPrefixLength()) return false; + if (getAutoLearning() != other.getAutoLearning()) return false; + if (hasSuggestionsInputConfig() != other.hasSuggestionsInputConfig()) return false; + if (hasSuggestionsInputConfig()) { + if (!getSuggestionsInputConfig().equals(other.getSuggestionsInputConfig())) return false; + } + if (!getLastSuggestionsImportOperation().equals(other.getLastSuggestionsImportOperation())) + return false; + if (hasDenylistInputConfig() != other.hasDenylistInputConfig()) return false; + if (hasDenylistInputConfig()) { + if (!getDenylistInputConfig().equals(other.getDenylistInputConfig())) return false; + } + if (!getLastDenylistImportOperation().equals(other.getLastDenylistImportOperation())) + return false; + if (hasAllowlistInputConfig() != other.hasAllowlistInputConfig()) return false; + if (hasAllowlistInputConfig()) { + if (!getAllowlistInputConfig().equals(other.getAllowlistInputConfig())) return false; + } + if (!getLastAllowlistImportOperation().equals(other.getLastAllowlistImportOperation())) + 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) + MATCHING_ORDER_FIELD_NUMBER; + hash = (53 * hash) + getMatchingOrder().hashCode(); + hash = (37 * hash) + MAX_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxSuggestions(); + hash = (37 * hash) + MIN_PREFIX_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getMinPrefixLength(); + hash = (37 * hash) + AUTO_LEARNING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoLearning()); + if (hasSuggestionsInputConfig()) { + hash = (37 * hash) + SUGGESTIONS_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSuggestionsInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_SUGGESTIONS_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastSuggestionsImportOperation().hashCode(); + if (hasDenylistInputConfig()) { + hash = (37 * hash) + DENYLIST_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDenylistInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_DENYLIST_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastDenylistImportOperation().hashCode(); + if (hasAllowlistInputConfig()) { + hash = (37 * hash) + ALLOWLIST_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAllowlistInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_ALLOWLIST_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastAllowlistImportOperation().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CompletionConfig 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; + } + /** + * + * + *
+   * Catalog level autocomplete config for customers to customize autocomplete
+   * feature's settings.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompletionConfig) + com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CompletionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionConfig.class, + com.google.cloud.retail.v2alpha.CompletionConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CompletionConfig.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_ = ""; + + matchingOrder_ = ""; + + maxSuggestions_ = 0; + + minPrefixLength_ = 0; + + autoLearning_ = false; + + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = null; + } else { + suggestionsInputConfig_ = null; + suggestionsInputConfigBuilder_ = null; + } + lastSuggestionsImportOperation_ = ""; + + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = null; + } else { + denylistInputConfig_ = null; + denylistInputConfigBuilder_ = null; + } + lastDenylistImportOperation_ = ""; + + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = null; + } else { + allowlistInputConfig_ = null; + allowlistInputConfigBuilder_ = null; + } + lastAllowlistImportOperation_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_CompletionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompletionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionConfig build() { + com.google.cloud.retail.v2alpha.CompletionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionConfig buildPartial() { + com.google.cloud.retail.v2alpha.CompletionConfig result = + new com.google.cloud.retail.v2alpha.CompletionConfig(this); + result.name_ = name_; + result.matchingOrder_ = matchingOrder_; + result.maxSuggestions_ = maxSuggestions_; + result.minPrefixLength_ = minPrefixLength_; + result.autoLearning_ = autoLearning_; + if (suggestionsInputConfigBuilder_ == null) { + result.suggestionsInputConfig_ = suggestionsInputConfig_; + } else { + result.suggestionsInputConfig_ = suggestionsInputConfigBuilder_.build(); + } + result.lastSuggestionsImportOperation_ = lastSuggestionsImportOperation_; + if (denylistInputConfigBuilder_ == null) { + result.denylistInputConfig_ = denylistInputConfig_; + } else { + result.denylistInputConfig_ = denylistInputConfigBuilder_.build(); + } + result.lastDenylistImportOperation_ = lastDenylistImportOperation_; + if (allowlistInputConfigBuilder_ == null) { + result.allowlistInputConfig_ = allowlistInputConfig_; + } else { + result.allowlistInputConfig_ = allowlistInputConfigBuilder_.build(); + } + result.lastAllowlistImportOperation_ = lastAllowlistImportOperation_; + 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.v2alpha.CompletionConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.CompletionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CompletionConfig other) { + if (other == com.google.cloud.retail.v2alpha.CompletionConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getMatchingOrder().isEmpty()) { + matchingOrder_ = other.matchingOrder_; + onChanged(); + } + if (other.getMaxSuggestions() != 0) { + setMaxSuggestions(other.getMaxSuggestions()); + } + if (other.getMinPrefixLength() != 0) { + setMinPrefixLength(other.getMinPrefixLength()); + } + if (other.getAutoLearning() != false) { + setAutoLearning(other.getAutoLearning()); + } + if (other.hasSuggestionsInputConfig()) { + mergeSuggestionsInputConfig(other.getSuggestionsInputConfig()); + } + if (!other.getLastSuggestionsImportOperation().isEmpty()) { + lastSuggestionsImportOperation_ = other.lastSuggestionsImportOperation_; + onChanged(); + } + if (other.hasDenylistInputConfig()) { + mergeDenylistInputConfig(other.getDenylistInputConfig()); + } + if (!other.getLastDenylistImportOperation().isEmpty()) { + lastDenylistImportOperation_ = other.lastDenylistImportOperation_; + onChanged(); + } + if (other.hasAllowlistInputConfig()) { + mergeAllowlistInputConfig(other.getAllowlistInputConfig()); + } + if (!other.getLastAllowlistImportOperation().isEmpty()) { + lastAllowlistImportOperation_ = other.lastAllowlistImportOperation_; + 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.v2alpha.CompletionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.CompletionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 matchingOrder_ = ""; + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + public java.lang.String getMatchingOrder() { + java.lang.Object ref = matchingOrder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + matchingOrder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + public com.google.protobuf.ByteString getMatchingOrderBytes() { + java.lang.Object ref = matchingOrder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + matchingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @param value The matchingOrder to set. + * @return This builder for chaining. + */ + public Builder setMatchingOrder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + matchingOrder_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return This builder for chaining. + */ + public Builder clearMatchingOrder() { + + matchingOrder_ = getDefaultInstance().getMatchingOrder(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @param value The bytes for matchingOrder to set. + * @return This builder for chaining. + */ + public Builder setMatchingOrderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + matchingOrder_ = value; + onChanged(); + return this; + } + + private int maxSuggestions_; + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @param value The maxSuggestions to set. + * @return This builder for chaining. + */ + public Builder setMaxSuggestions(int value) { + + maxSuggestions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxSuggestions() { + + maxSuggestions_ = 0; + onChanged(); + return this; + } + + private int minPrefixLength_; + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @param value The minPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMinPrefixLength(int value) { + + minPrefixLength_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearMinPrefixLength() { + + minPrefixLength_ = 0; + onChanged(); + return this; + } + + private boolean autoLearning_; + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + @java.lang.Override + public boolean getAutoLearning() { + return autoLearning_; + } + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @param value The autoLearning to set. + * @return This builder for chaining. + */ + public Builder setAutoLearning(boolean value) { + + autoLearning_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @return This builder for chaining. + */ + public Builder clearAutoLearning() { + + autoLearning_ = false; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig suggestionsInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + suggestionsInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + public boolean hasSuggestionsInputConfig() { + return suggestionsInputConfigBuilder_ != null || suggestionsInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getSuggestionsInputConfig() { + if (suggestionsInputConfigBuilder_ == null) { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } else { + return suggestionsInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSuggestionsInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (suggestionsInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + suggestionsInputConfig_ = value; + onChanged(); + } else { + suggestionsInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSuggestionsInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder builderForValue) { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = builderForValue.build(); + onChanged(); + } else { + suggestionsInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSuggestionsInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (suggestionsInputConfigBuilder_ == null) { + if (suggestionsInputConfig_ != null) { + suggestionsInputConfig_ = + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.newBuilder( + suggestionsInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + suggestionsInputConfig_ = value; + } + onChanged(); + } else { + suggestionsInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSuggestionsInputConfig() { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = null; + onChanged(); + } else { + suggestionsInputConfig_ = null; + suggestionsInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder + getSuggestionsInputConfigBuilder() { + + onChanged(); + return getSuggestionsInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder() { + if (suggestionsInputConfigBuilder_ != null) { + return suggestionsInputConfigBuilder_.getMessageOrBuilder(); + } else { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + getSuggestionsInputConfigFieldBuilder() { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder>( + getSuggestionsInputConfig(), getParentForChildren(), isClean()); + suggestionsInputConfig_ = null; + } + return suggestionsInputConfigBuilder_; + } + + private java.lang.Object lastSuggestionsImportOperation_ = ""; + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + public java.lang.String getLastSuggestionsImportOperation() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastSuggestionsImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + public com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastSuggestionsImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastSuggestionsImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastSuggestionsImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastSuggestionsImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastSuggestionsImportOperation() { + + lastSuggestionsImportOperation_ = getDefaultInstance().getLastSuggestionsImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastSuggestionsImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastSuggestionsImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastSuggestionsImportOperation_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig denylistInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + denylistInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + public boolean hasDenylistInputConfig() { + return denylistInputConfigBuilder_ != null || denylistInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getDenylistInputConfig() { + if (denylistInputConfigBuilder_ == null) { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } else { + return denylistInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDenylistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (denylistInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + denylistInputConfig_ = value; + onChanged(); + } else { + denylistInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDenylistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder builderForValue) { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = builderForValue.build(); + onChanged(); + } else { + denylistInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDenylistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (denylistInputConfigBuilder_ == null) { + if (denylistInputConfig_ != null) { + denylistInputConfig_ = + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.newBuilder( + denylistInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + denylistInputConfig_ = value; + } + onChanged(); + } else { + denylistInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDenylistInputConfig() { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = null; + onChanged(); + } else { + denylistInputConfig_ = null; + denylistInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder + getDenylistInputConfigBuilder() { + + onChanged(); + return getDenylistInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder() { + if (denylistInputConfigBuilder_ != null) { + return denylistInputConfigBuilder_.getMessageOrBuilder(); + } else { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + getDenylistInputConfigFieldBuilder() { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder>( + getDenylistInputConfig(), getParentForChildren(), isClean()); + denylistInputConfig_ = null; + } + return denylistInputConfigBuilder_; + } + + private java.lang.Object lastDenylistImportOperation_ = ""; + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + public java.lang.String getLastDenylistImportOperation() { + java.lang.Object ref = lastDenylistImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastDenylistImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + public com.google.protobuf.ByteString getLastDenylistImportOperationBytes() { + java.lang.Object ref = lastDenylistImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastDenylistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastDenylistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastDenylistImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastDenylistImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastDenylistImportOperation() { + + lastDenylistImportOperation_ = getDefaultInstance().getLastDenylistImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastDenylistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastDenylistImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastDenylistImportOperation_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig allowlistInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + allowlistInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + public boolean hasAllowlistInputConfig() { + return allowlistInputConfigBuilder_ != null || allowlistInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getAllowlistInputConfig() { + if (allowlistInputConfigBuilder_ == null) { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } else { + return allowlistInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllowlistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (allowlistInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allowlistInputConfig_ = value; + onChanged(); + } else { + allowlistInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllowlistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder builderForValue) { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = builderForValue.build(); + onChanged(); + } else { + allowlistInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAllowlistInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (allowlistInputConfigBuilder_ == null) { + if (allowlistInputConfig_ != null) { + allowlistInputConfig_ = + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.newBuilder( + allowlistInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + allowlistInputConfig_ = value; + } + onChanged(); + } else { + allowlistInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAllowlistInputConfig() { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = null; + onChanged(); + } else { + allowlistInputConfig_ = null; + allowlistInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder + getAllowlistInputConfigBuilder() { + + onChanged(); + return getAllowlistInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder() { + if (allowlistInputConfigBuilder_ != null) { + return allowlistInputConfigBuilder_.getMessageOrBuilder(); + } else { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + getAllowlistInputConfigFieldBuilder() { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder>( + getAllowlistInputConfig(), getParentForChildren(), isClean()); + allowlistInputConfig_ = null; + } + return allowlistInputConfigBuilder_; + } + + private java.lang.Object lastAllowlistImportOperation_ = ""; + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + public java.lang.String getLastAllowlistImportOperation() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastAllowlistImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + public com.google.protobuf.ByteString getLastAllowlistImportOperationBytes() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAllowlistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastAllowlistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastAllowlistImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastAllowlistImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastAllowlistImportOperation() { + + lastAllowlistImportOperation_ = getDefaultInstance().getLastAllowlistImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastAllowlistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastAllowlistImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastAllowlistImportOperation_ = 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.v2alpha.CompletionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompletionConfig) + private static final com.google.cloud.retail.v2alpha.CompletionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CompletionConfig(); + } + + public static com.google.cloud.retail.v2alpha.CompletionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionConfig(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.v2alpha.CompletionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigName.java new file mode 100644 index 00000000..80b45946 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigName.java @@ -0,0 +1,223 @@ +/* + * 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.v2alpha; + +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 CompletionConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected CompletionConfigName() { + project = null; + location = null; + catalog = null; + } + + private CompletionConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CompletionConfigName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static CompletionConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "CompletionConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (CompletionConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CompletionConfigName that = ((CompletionConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(CompletionConfigName completionConfigName) { + this.project = completionConfigName.project; + this.location = completionConfigName.location; + this.catalog = completionConfigName.catalog; + } + + public CompletionConfigName build() { + return new CompletionConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigOrBuilder.java new file mode 100644 index 00000000..7c2dee0a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionConfigOrBuilder.java @@ -0,0 +1,372 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface CompletionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompletionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + java.lang.String getMatchingOrder(); + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + com.google.protobuf.ByteString getMatchingOrderBytes(); + + /** + * + * + *
+   * The maximum number of autocomplete suggestions returned per term. The
+   * maximum allowed max suggestions is 20. Default value is 20. If left unset
+   * or set to 0, then will fallback to default value.
+   * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + int getMaxSuggestions(); + + /** + * + * + *
+   * The minimum number of characters needed to be typed in order to get
+   * suggestions. Default value is 2. If left unset or set to 0, then will
+   * fallback to default value.
+   * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + int getMinPrefixLength(); + + /** + * + * + *
+   * If set to true, the auto learning function is enabled. Auto learning uses
+   * user data to generate suggestions using ML techniques. Default value is
+   * false. Only after enabling auto learning can users use `cloud-retail`
+   * data in
+   * [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
+   * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + boolean getAutoLearning(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + boolean hasSuggestionsInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfig getSuggestionsInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + java.lang.String getLastSuggestionsImportOperation(); + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + boolean hasDenylistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfig getDenylistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + java.lang.String getLastDenylistImportOperation(); + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + com.google.protobuf.ByteString getLastDenylistImportOperationBytes(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + boolean hasAllowlistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfig getAllowlistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + java.lang.String getLastAllowlistImportOperation(); + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + com.google.protobuf.ByteString getLastAllowlistImportOperationBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfig.java new file mode 100644 index 00000000..5947ba72 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfig.java @@ -0,0 +1,899 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The input config source for completion data.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionDataInputConfig} + */ +public final class CompletionDataInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompletionDataInputConfig) + CompletionDataInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDataInputConfig.newBuilder() to construct. + private CompletionDataInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDataInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDataInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDataInputConfig( + 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.v2alpha.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.retail.v2alpha.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.class, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIG_QUERY_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + 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.v2alpha.CompletionDataInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompletionDataInputConfig other = + (com.google.cloud.retail.v2alpha.CompletionDataInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for completion data.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionDataInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompletionDataInputConfig) + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.class, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CompletionDataInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig build() { + com.google.cloud.retail.v2alpha.CompletionDataInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig buildPartial() { + com.google.cloud.retail.v2alpha.CompletionDataInputConfig result = + new com.google.cloud.retail.v2alpha.CompletionDataInputConfig(this); + if (sourceCase_ == 1) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.v2alpha.CompletionDataInputConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.CompletionDataInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CompletionDataInputConfig other) { + if (other == com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.v2alpha.CompletionDataInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CompletionDataInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2alpha.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 1) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CompletionDataInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompletionDataInputConfig) + private static final com.google.cloud.retail.v2alpha.CompletionDataInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CompletionDataInputConfig(); + } + + public static com.google.cloud.retail.v2alpha.CompletionDataInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDataInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDataInputConfig(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.v2alpha.CompletionDataInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfigOrBuilder.java new file mode 100644 index 00000000..c423b154 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDataInputConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface CompletionDataInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompletionDataInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetail.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetail.java new file mode 100644 index 00000000..a14ebe51 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetail.java @@ -0,0 +1,932 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Detailed completion information including completion attribution token and
+ * clicked completion info.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionDetail} + */ +public final class CompletionDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CompletionDetail) + CompletionDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDetail.newBuilder() to construct. + private CompletionDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDetail() { + completionAttributionToken_ = ""; + selectedSuggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDetail( + 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(); + + completionAttributionToken_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + selectedSuggestion_ = s; + break; + } + case 24: + { + selectedPosition_ = input.readInt32(); + 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.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionDetail.class, + com.google.cloud.retail.v2alpha.CompletionDetail.Builder.class); + } + + public static final int COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object completionAttributionToken_; + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + @java.lang.Override + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + 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(); + completionAttributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_SUGGESTION_FIELD_NUMBER = 2; + private volatile java.lang.Object selectedSuggestion_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + @java.lang.Override + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + 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(); + selectedSuggestion_ = s; + return s; + } + } + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_POSITION_FIELD_NUMBER = 3; + private int selectedPosition_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + + 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(completionAttributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, completionAttributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedSuggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + output.writeInt32(3, selectedPosition_); + } + 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(completionAttributionToken_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(1, completionAttributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedSuggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, selectedPosition_); + } + 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.v2alpha.CompletionDetail)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CompletionDetail other = + (com.google.cloud.retail.v2alpha.CompletionDetail) obj; + + if (!getCompletionAttributionToken().equals(other.getCompletionAttributionToken())) + return false; + if (!getSelectedSuggestion().equals(other.getSelectedSuggestion())) return false; + if (getSelectedPosition() != other.getSelectedPosition()) 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) + COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getCompletionAttributionToken().hashCode(); + hash = (37 * hash) + SELECTED_SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedSuggestion().hashCode(); + hash = (37 * hash) + SELECTED_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedPosition(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CompletionDetail 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; + } + /** + * + * + *
+   * Detailed completion information including completion attribution token and
+   * clicked completion info.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CompletionDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CompletionDetail) + com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CompletionDetail.class, + com.google.cloud.retail.v2alpha.CompletionDetail.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CompletionDetail.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(); + completionAttributionToken_ = ""; + + selectedSuggestion_ = ""; + + selectedPosition_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDetail getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CompletionDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDetail build() { + com.google.cloud.retail.v2alpha.CompletionDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDetail buildPartial() { + com.google.cloud.retail.v2alpha.CompletionDetail result = + new com.google.cloud.retail.v2alpha.CompletionDetail(this); + result.completionAttributionToken_ = completionAttributionToken_; + result.selectedSuggestion_ = selectedSuggestion_; + result.selectedPosition_ = selectedPosition_; + 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.v2alpha.CompletionDetail) { + return mergeFrom((com.google.cloud.retail.v2alpha.CompletionDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CompletionDetail other) { + if (other == com.google.cloud.retail.v2alpha.CompletionDetail.getDefaultInstance()) + return this; + if (!other.getCompletionAttributionToken().isEmpty()) { + completionAttributionToken_ = other.completionAttributionToken_; + onChanged(); + } + if (!other.getSelectedSuggestion().isEmpty()) { + selectedSuggestion_ = other.selectedSuggestion_; + onChanged(); + } + if (other.getSelectedPosition() != 0) { + setSelectedPosition(other.getSelectedPosition()); + } + 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.v2alpha.CompletionDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.CompletionDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object completionAttributionToken_ = ""; + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + completionAttributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + completionAttributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompletionAttributionToken() { + + completionAttributionToken_ = getDefaultInstance().getCompletionAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The bytes for completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + completionAttributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object selectedSuggestion_ = ""; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedSuggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + selectedSuggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return This builder for chaining. + */ + public Builder clearSelectedSuggestion() { + + selectedSuggestion_ = getDefaultInstance().getSelectedSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The bytes for selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + selectedSuggestion_ = value; + onChanged(); + return this; + } + + private int selectedPosition_; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @param value The selectedPosition to set. + * @return This builder for chaining. + */ + public Builder setSelectedPosition(int value) { + + selectedPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return This builder for chaining. + */ + public Builder clearSelectedPosition() { + + selectedPosition_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.CompletionDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CompletionDetail) + private static final com.google.cloud.retail.v2alpha.CompletionDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CompletionDetail(); + } + + public static com.google.cloud.retail.v2alpha.CompletionDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDetail(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.v2alpha.CompletionDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetailOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetailOrBuilder.java new file mode 100644 index 00000000..e384fbe1 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionDetailOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +public interface CompletionDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CompletionDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + java.lang.String getCompletionAttributionToken(); + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + com.google.protobuf.ByteString getCompletionAttributionTokenBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + java.lang.String getSelectedSuggestion(); + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + com.google.protobuf.ByteString getSelectedSuggestionBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + int getSelectedPosition(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceProto.java new file mode 100644 index 00000000..a37e5b10 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceProto.java @@ -0,0 +1,192 @@ +/* + * 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/v2alpha/completion_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class CompletionServiceProto { + private CompletionServiceProto() {} + + 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_v2alpha_CompleteQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/retail/v2alpha/completion" + + "_service.proto\022\033google.cloud.retail.v2al" + + "pha\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\032(" + + "google/cloud/retail/v2alpha/common.proto" + + "\032/google/cloud/retail/v2alpha/import_con" + + "fig.proto\032#google/longrunning/operations" + + ".proto\"\315\001\n\024CompleteQueryRequest\0226\n\007catal" + + "og\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.com/" + + "Catalog\022\022\n\005query\030\002 \001(\tB\003\340A\002\022\022\n\nvisitor_i" + + "d\030\007 \001(\t\022\026\n\016language_codes\030\003 \003(\t\022\023\n\013devic" + + "e_type\030\004 \001(\t\022\017\n\007dataset\030\006 \001(\t\022\027\n\017max_sug" + + "gestions\030\005 \001(\005\"\231\004\n\025CompleteQueryResponse" + + "\022_\n\022completion_results\030\001 \003(\0132C.google.cl" + + "oud.retail.v2alpha.CompleteQueryResponse" + + ".CompletionResult\022\031\n\021attribution_token\030\002" + + " \001(\t\022d\n\025recent_search_results\030\003 \003(\0132E.go" + + "ogle.cloud.retail.v2alpha.CompleteQueryR" + + "esponse.RecentSearchResult\032\360\001\n\020Completio" + + "nResult\022\022\n\nsuggestion\030\001 \001(\t\022g\n\nattribute" + + "s\030\002 \003(\0132S.google.cloud.retail.v2alpha.Co" + + "mpleteQueryResponse.CompletionResult.Att" + + "ributesEntry\032_\n\017AttributesEntry\022\013\n\003key\030\001" + + " \001(\t\022;\n\005value\030\002 \001(\0132,.google.cloud.retai" + + "l.v2alpha.CustomAttribute:\0028\001\032+\n\022RecentS" + + "earchResult\022\025\n\rrecent_search\030\001 \001(\t2\325\004\n\021C" + + "ompletionService\022\302\001\n\rCompleteQuery\0221.goo" + + "gle.cloud.retail.v2alpha.CompleteQueryRe" + + "quest\0322.google.cloud.retail.v2alpha.Comp" + + "leteQueryResponse\"J\202\323\344\223\002D\022B/v2alpha/{cat" + + "alog=projects/*/locations/*/catalogs/*}:" + + "completeQuery\022\257\002\n\024ImportCompletionData\0228" + + ".google.cloud.retail.v2alpha.ImportCompl" + + "etionDataRequest\032\035.google.longrunning.Op" + + "eration\"\275\001\202\323\344\223\002N\"I/v2alpha/{parent=proje" + + "cts/*/locations/*/catalogs/*}/completion" + + "Data:import:\001*\312Af\n8google.cloud.retail.v" + + "2alpha.ImportCompletionDataResponse\022*goo" + + "gle.cloud.retail.v2alpha.ImportMetadata\032" + + "I\312A\025retail.googleapis.com\322A.https://www." + + "googleapis.com/auth/cloud-platformB\344\001\n\037c" + + "om.google.cloud.retail.v2alphaB\026Completi" + + "onServiceProtoP\001ZAgoogle.golang.org/genp" + + "roto/googleapis/cloud/retail/v2alpha;ret" + + "ail\242\002\006RETAIL\252\002\033Google.Cloud.Retail.V2Alp" + + "ha\312\002\033Google\\Cloud\\Retail\\V2alpha\352\002\036Googl" + + "e::Cloud::Retail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompleteQueryRequest_descriptor, + new java.lang.String[] { + "Catalog", + "Query", + "VisitorId", + "LanguageCodes", + "DeviceType", + "Dataset", + "MaxSuggestions", + }); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor, + new java.lang.String[] { + "CompletionResults", "AttributionToken", "RecentSearchResults", + }); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor = + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor, + new java.lang.String[] { + "Suggestion", "Attributes", + }); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor = + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompleteQueryResponse_RecentSearchResult_descriptor, + new java.lang.String[] { + "RecentSearch", + }); + 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.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.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Condition.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Condition.java new file mode 100644 index 00000000..881623ae --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Condition.java @@ -0,0 +1,3434 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata that is used to define a condition that triggers an action.
+ * A valid condition must specify at least one of 'query_terms' or
+ * 'products_filter'. If multiple fields are specified, the condition is met if
+ * all the fields are satisfied e.g. if a set of query terms and product_filter
+ * are set, then only items matching the product_filter for requests with a
+ * query matching the query terms wil get boosted.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition} + */ +public final class Condition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Condition) + ConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Condition.newBuilder() to construct. + private Condition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Condition() { + queryTerms_ = java.util.Collections.emptyList(); + activeTimeRange_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Condition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Condition( + 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)) { + queryTerms_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Condition.QueryTerm.parser(), + extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + activeTimeRange_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Condition.TimeRange.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)) { + queryTerms_ = java.util.Collections.unmodifiableList(queryTerms_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = java.util.Collections.unmodifiableList(activeTimeRange_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.class, + com.google.cloud.retail.v2alpha.Condition.Builder.class); + } + + public interface QueryTermOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Condition.QueryTerm) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+     * Whether this is supposed to be a full or partial match.
+     * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + boolean getFullMatch(); + } + /** + * + * + *
+   * Query terms that we want to match on.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition.QueryTerm} + */ + public static final class QueryTerm extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Condition.QueryTerm) + QueryTermOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryTerm.newBuilder() to construct. + private QueryTerm(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryTerm() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryTerm(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryTerm( + 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(); + + value_ = s; + break; + } + case 16: + { + fullMatch_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.QueryTerm.class, + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULL_MATCH_FIELD_NUMBER = 2; + private boolean fullMatch_; + /** + * + * + *
+     * Whether this is supposed to be a full or partial match.
+     * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + @java.lang.Override + public boolean getFullMatch() { + return fullMatch_; + } + + 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(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + if (fullMatch_ != false) { + output.writeBool(2, fullMatch_); + } + 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(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + if (fullMatch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, fullMatch_); + } + 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.v2alpha.Condition.QueryTerm)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Condition.QueryTerm other = + (com.google.cloud.retail.v2alpha.Condition.QueryTerm) obj; + + if (!getValue().equals(other.getValue())) return false; + if (getFullMatch() != other.getFullMatch()) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + FULL_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFullMatch()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Condition.QueryTerm 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; + } + /** + * + * + *
+     * Query terms that we want to match on.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition.QueryTerm} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Condition.QueryTerm) + com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.QueryTerm.class, + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Condition.QueryTerm.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(); + value_ = ""; + + fullMatch_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.QueryTerm getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Condition.QueryTerm.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.QueryTerm build() { + com.google.cloud.retail.v2alpha.Condition.QueryTerm result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.QueryTerm buildPartial() { + com.google.cloud.retail.v2alpha.Condition.QueryTerm result = + new com.google.cloud.retail.v2alpha.Condition.QueryTerm(this); + result.value_ = value_; + result.fullMatch_ = fullMatch_; + 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.v2alpha.Condition.QueryTerm) { + return mergeFrom((com.google.cloud.retail.v2alpha.Condition.QueryTerm) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Condition.QueryTerm other) { + if (other == com.google.cloud.retail.v2alpha.Condition.QueryTerm.getDefaultInstance()) + return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (other.getFullMatch() != false) { + setFullMatch(other.getFullMatch()); + } + 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.v2alpha.Condition.QueryTerm parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Condition.QueryTerm) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private boolean fullMatch_; + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + @java.lang.Override + public boolean getFullMatch() { + return fullMatch_; + } + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @param value The fullMatch to set. + * @return This builder for chaining. + */ + public Builder setFullMatch(boolean value) { + + fullMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @return This builder for chaining. + */ + public Builder clearFullMatch() { + + fullMatch_ = 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.v2alpha.Condition.QueryTerm) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Condition.QueryTerm) + private static final com.google.cloud.retail.v2alpha.Condition.QueryTerm DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Condition.QueryTerm(); + } + + public static com.google.cloud.retail.v2alpha.Condition.QueryTerm getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryTerm parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryTerm(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.v2alpha.Condition.QueryTerm getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Condition.TimeRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + } + /** + * + * + *
+   * Used for time-dependent conditions.
+   * Example: Want to have rule applied for week long sale.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition.TimeRange} + */ + public static final class TimeRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Condition.TimeRange) + TimeRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeRange.newBuilder() to construct. + private TimeRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeRange( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.TimeRange.class, + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + 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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + 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.v2alpha.Condition.TimeRange)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Condition.TimeRange other = + (com.google.cloud.retail.v2alpha.Condition.TimeRange) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) 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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Condition.TimeRange 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; + } + /** + * + * + *
+     * Used for time-dependent conditions.
+     * Example: Want to have rule applied for week long sale.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition.TimeRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Condition.TimeRange) + com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.TimeRange.class, + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Condition.TimeRange.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 (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_TimeRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.TimeRange getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Condition.TimeRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.TimeRange build() { + com.google.cloud.retail.v2alpha.Condition.TimeRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.TimeRange buildPartial() { + com.google.cloud.retail.v2alpha.Condition.TimeRange result = + new com.google.cloud.retail.v2alpha.Condition.TimeRange(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.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.v2alpha.Condition.TimeRange) { + return mergeFrom((com.google.cloud.retail.v2alpha.Condition.TimeRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Condition.TimeRange other) { + if (other == com.google.cloud.retail.v2alpha.Condition.TimeRange.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + 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.v2alpha.Condition.TimeRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Condition.TimeRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_) + .mergeFrom(value) + .buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Condition.TimeRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Condition.TimeRange) + private static final com.google.cloud.retail.v2alpha.Condition.TimeRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Condition.TimeRange(); + } + + public static com.google.cloud.retail.v2alpha.Condition.TimeRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeRange(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.v2alpha.Condition.TimeRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 1; + private java.util.List queryTerms_; + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public java.util.List getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public java.util.List + getQueryTermsOrBuilderList() { + return queryTerms_; + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.QueryTerm getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder getQueryTermsOrBuilder( + int index) { + return queryTerms_.get(index); + } + + public static final int ACTIVE_TIME_RANGE_FIELD_NUMBER = 3; + private java.util.List activeTimeRange_; + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public java.util.List + getActiveTimeRangeList() { + return activeTimeRange_; + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public java.util.List + getActiveTimeRangeOrBuilderList() { + return activeTimeRange_; + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public int getActiveTimeRangeCount() { + return activeTimeRange_.size(); + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.TimeRange getActiveTimeRange(int index) { + return activeTimeRange_.get(index); + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index) { + return activeTimeRange_.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 { + for (int i = 0; i < queryTerms_.size(); i++) { + output.writeMessage(1, queryTerms_.get(i)); + } + for (int i = 0; i < activeTimeRange_.size(); i++) { + output.writeMessage(3, activeTimeRange_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, queryTerms_.get(i)); + } + for (int i = 0; i < activeTimeRange_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, activeTimeRange_.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.v2alpha.Condition)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Condition other = + (com.google.cloud.retail.v2alpha.Condition) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getActiveTimeRangeList().equals(other.getActiveTimeRangeList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getActiveTimeRangeCount() > 0) { + hash = (37 * hash) + ACTIVE_TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getActiveTimeRangeList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Condition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Condition 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 is used to define a condition that triggers an action.
+   * A valid condition must specify at least one of 'query_terms' or
+   * 'products_filter'. If multiple fields are specified, the condition is met if
+   * all the fields are satisfied e.g. if a set of query terms and product_filter
+   * are set, then only items matching the product_filter for requests with a
+   * query matching the query terms wil get boosted.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Condition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Condition) + com.google.cloud.retail.v2alpha.ConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Condition.class, + com.google.cloud.retail.v2alpha.Condition.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Condition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQueryTermsFieldBuilder(); + getActiveTimeRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (queryTermsBuilder_ == null) { + queryTerms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + queryTermsBuilder_.clear(); + } + if (activeTimeRangeBuilder_ == null) { + activeTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + activeTimeRangeBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Condition_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition build() { + com.google.cloud.retail.v2alpha.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition buildPartial() { + com.google.cloud.retail.v2alpha.Condition result = + new com.google.cloud.retail.v2alpha.Condition(this); + int from_bitField0_ = bitField0_; + if (queryTermsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = java.util.Collections.unmodifiableList(queryTerms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + } else { + result.queryTerms_ = queryTermsBuilder_.build(); + } + if (activeTimeRangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = java.util.Collections.unmodifiableList(activeTimeRange_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.activeTimeRange_ = activeTimeRange_; + } else { + result.activeTimeRange_ = activeTimeRangeBuilder_.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.v2alpha.Condition) { + return mergeFrom((com.google.cloud.retail.v2alpha.Condition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Condition other) { + if (other == com.google.cloud.retail.v2alpha.Condition.getDefaultInstance()) return this; + if (queryTermsBuilder_ == null) { + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + } else { + if (!other.queryTerms_.isEmpty()) { + if (queryTermsBuilder_.isEmpty()) { + queryTermsBuilder_.dispose(); + queryTermsBuilder_ = null; + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + queryTermsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQueryTermsFieldBuilder() + : null; + } else { + queryTermsBuilder_.addAllMessages(other.queryTerms_); + } + } + } + if (activeTimeRangeBuilder_ == null) { + if (!other.activeTimeRange_.isEmpty()) { + if (activeTimeRange_.isEmpty()) { + activeTimeRange_ = other.activeTimeRange_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.addAll(other.activeTimeRange_); + } + onChanged(); + } + } else { + if (!other.activeTimeRange_.isEmpty()) { + if (activeTimeRangeBuilder_.isEmpty()) { + activeTimeRangeBuilder_.dispose(); + activeTimeRangeBuilder_ = null; + activeTimeRange_ = other.activeTimeRange_; + bitField0_ = (bitField0_ & ~0x00000002); + activeTimeRangeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getActiveTimeRangeFieldBuilder() + : null; + } else { + activeTimeRangeBuilder_.addAllMessages(other.activeTimeRange_); + } + } + } + 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.v2alpha.Condition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Condition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List queryTerms_ = + java.util.Collections.emptyList(); + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = + new java.util.ArrayList( + queryTerms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.QueryTerm, + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder> + queryTermsBuilder_; + + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public java.util.List getQueryTermsList() { + if (queryTermsBuilder_ == null) { + return java.util.Collections.unmodifiableList(queryTerms_); + } else { + return queryTermsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public int getQueryTermsCount() { + if (queryTermsBuilder_ == null) { + return queryTerms_.size(); + } else { + return queryTermsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2alpha.Condition.QueryTerm getQueryTerms(int index) { + if (queryTermsBuilder_ == null) { + return queryTerms_.get(index); + } else { + return queryTermsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder setQueryTerms( + int index, com.google.cloud.retail.v2alpha.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + } else { + queryTermsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder setQueryTerms( + int index, com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.set(index, builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms(com.google.cloud.retail.v2alpha.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + } else { + queryTermsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + int index, com.google.cloud.retail.v2alpha.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(index, value); + onChanged(); + } else { + queryTermsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.add(builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + int index, com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.add(index, builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder addAllQueryTerms( + java.lang.Iterable values) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + } else { + queryTermsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder clearQueryTerms() { + if (queryTermsBuilder_ == null) { + queryTerms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + queryTermsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public Builder removeQueryTerms(int index) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.remove(index); + onChanged(); + } else { + queryTermsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder getQueryTermsBuilder( + int index) { + return getQueryTermsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder getQueryTermsOrBuilder( + int index) { + if (queryTermsBuilder_ == null) { + return queryTerms_.get(index); + } else { + return queryTermsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public java.util.List + getQueryTermsOrBuilderList() { + if (queryTermsBuilder_ != null) { + return queryTermsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(queryTerms_); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder addQueryTermsBuilder() { + return getQueryTermsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Condition.QueryTerm.getDefaultInstance()); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder addQueryTermsBuilder( + int index) { + return getQueryTermsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2alpha.Condition.QueryTerm.getDefaultInstance()); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + public java.util.List + getQueryTermsBuilderList() { + return getQueryTermsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.QueryTerm, + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder> + getQueryTermsFieldBuilder() { + if (queryTermsBuilder_ == null) { + queryTermsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.QueryTerm, + com.google.cloud.retail.v2alpha.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder>( + queryTerms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + queryTerms_ = null; + } + return queryTermsBuilder_; + } + + private java.util.List activeTimeRange_ = + java.util.Collections.emptyList(); + + private void ensureActiveTimeRangeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = + new java.util.ArrayList( + activeTimeRange_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.TimeRange, + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder, + com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder> + activeTimeRangeBuilder_; + + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeList() { + if (activeTimeRangeBuilder_ == null) { + return java.util.Collections.unmodifiableList(activeTimeRange_); + } else { + return activeTimeRangeBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public int getActiveTimeRangeCount() { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.size(); + } else { + return activeTimeRangeBuilder_.getCount(); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2alpha.Condition.TimeRange getActiveTimeRange(int index) { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.get(index); + } else { + return activeTimeRangeBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder setActiveTimeRange( + int index, com.google.cloud.retail.v2alpha.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.set(index, value); + onChanged(); + } else { + activeTimeRangeBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder setActiveTimeRange( + int index, com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.set(index, builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange(com.google.cloud.retail.v2alpha.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(value); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + int index, com.google.cloud.retail.v2alpha.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(index, value); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + int index, com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(index, builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder addAllActiveTimeRange( + java.lang.Iterable values) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, activeTimeRange_); + onChanged(); + } else { + activeTimeRangeBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder clearActiveTimeRange() { + if (activeTimeRangeBuilder_ == null) { + activeTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + activeTimeRangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public Builder removeActiveTimeRange(int index) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.remove(index); + onChanged(); + } else { + activeTimeRangeBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder getActiveTimeRangeBuilder( + int index) { + return getActiveTimeRangeFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index) { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.get(index); + } else { + return activeTimeRangeBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeOrBuilderList() { + if (activeTimeRangeBuilder_ != null) { + return activeTimeRangeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(activeTimeRange_); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder addActiveTimeRangeBuilder() { + return getActiveTimeRangeFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Condition.TimeRange.getDefaultInstance()); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder addActiveTimeRangeBuilder( + int index) { + return getActiveTimeRangeFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2alpha.Condition.TimeRange.getDefaultInstance()); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeBuilderList() { + return getActiveTimeRangeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.TimeRange, + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder, + com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder> + getActiveTimeRangeFieldBuilder() { + if (activeTimeRangeBuilder_ == null) { + activeTimeRangeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition.TimeRange, + com.google.cloud.retail.v2alpha.Condition.TimeRange.Builder, + com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder>( + activeTimeRange_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + activeTimeRange_ = null; + } + return activeTimeRangeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Condition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Condition) + private static final com.google.cloud.retail.v2alpha.Condition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Condition(); + } + + public static com.google.cloud.retail.v2alpha.Condition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Condition(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.v2alpha.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ConditionOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ConditionOrBuilder.java new file mode 100644 index 00000000..dc3f101d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ConditionOrBuilder.java @@ -0,0 +1,150 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface ConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Condition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + com.google.cloud.retail.v2alpha.Condition.QueryTerm getQueryTerms(int index); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + int getQueryTermsCount(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + java.util.List + getQueryTermsOrBuilderList(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1; + */ + com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder getQueryTermsOrBuilder(int index); + + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + java.util.List getActiveTimeRangeList(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + com.google.cloud.retail.v2alpha.Condition.TimeRange getActiveTimeRange(int index); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + int getActiveTimeRangeCount(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + java.util.List + getActiveTimeRangeOrBuilderList(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3; + */ + com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Control.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Control.java new file mode 100644 index 00000000..1720911d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Control.java @@ -0,0 +1,2910 @@ +/* + * 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/v2alpha/control.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Configures dynamic serving time metadata that is used to pre and post
+ * process search/recommendation model results.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Control} + */ +public final class Control extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Control) + ControlOrBuilder { + private static final long serialVersionUID = 0L; + // Use Control.newBuilder() to construct. + private Control(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Control() { + name_ = ""; + displayName_ = ""; + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + solutionTypes_ = java.util.Collections.emptyList(); + searchSolutionUseCase_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Control(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Control( + 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 26: + { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder subBuilder = null; + if (controlCase_ == 3) { + subBuilder = + ((com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_) + .toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_); + control_ = subBuilder.buildPartial(); + } + controlCase_ = 3; + break; + } + case 34: + { + com.google.cloud.retail.v2alpha.Rule.Builder subBuilder = null; + if (controlCase_ == 4) { + subBuilder = ((com.google.cloud.retail.v2alpha.Rule) control_).toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Rule) control_); + control_ = subBuilder.buildPartial(); + } + controlCase_ = 4; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + associatedServingConfigIds_.add(s); + break; + } + case 48: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + solutionTypes_.add(rawValue); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + solutionTypes_.add(rawValue); + } + 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)) { + 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)) { + associatedServingConfigIds_ = associatedServingConfigIds_.getUnmodifiableView(); + } + 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(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlProto + .internal_static_google_cloud_retail_v2alpha_Control_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlProto + .internal_static_google_cloud_retail_v2alpha_Control_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Control.class, + com.google.cloud.retail.v2alpha.Control.Builder.class); + } + + private int controlCase_ = 0; + private java.lang.Object control_; + + public enum ControlCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FACET_SPEC(3), + RULE(4), + CONTROL_NOT_SET(0); + private final int value; + + private ControlCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ControlCase valueOf(int value) { + return forNumber(value); + } + + public static ControlCase forNumber(int value) { + switch (value) { + case 3: + return FACET_SPEC; + case 4: + return RULE; + case 0: + return CONTROL_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ControlCase getControlCase() { + return ControlCase.forNumber(controlCase_); + } + + public static final int FACET_SPEC_FIELD_NUMBER = 3; + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + @java.lang.Override + public boolean hasFacetSpec() { + return controlCase_ == 3; + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpec() { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder() { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + + public static final int RULE_FIELD_NUMBER = 4; + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return controlCase_ == 4; + } + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule getRule() { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2alpha.Rule) control_; + } + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.RuleOrBuilder getRuleOrBuilder() { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2alpha.Rule) control_; + } + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * 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 human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * 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 ASSOCIATED_SERVING_CONFIG_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList associatedServingConfigIds_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList() { + return associatedServingConfigIds_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + public int getAssociatedServingConfigIdsCount() { + return associatedServingConfigIds_.size(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + public java.lang.String getAssociatedServingConfigIds(int index) { + return associatedServingConfigIds_.get(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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(int index) { + return associatedServingConfigIds_.getByteString(index); + } + + public static final int SOLUTION_TYPES_FIELD_NUMBER = 6; + private java.util.List solutionTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType> + solutionTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>() { + public com.google.cloud.retail.v2alpha.SolutionType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SolutionType result = + com.google.cloud.retail.v2alpha.SolutionType.valueOf(from); + return result == null + ? com.google.cloud.retail.v2alpha.SolutionType.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + @java.lang.Override + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesValueList() { + return solutionTypes_; + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + @java.lang.Override + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(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.v2alpha.SearchSolutionUseCase> + searchSolutionUseCase_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SearchSolutionUseCase>() { + public com.google.cloud.retail.v2alpha.SearchSolutionUseCase convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchSolutionUseCase result = + com.google.cloud.retail.v2alpha.SearchSolutionUseCase.valueOf(from); + return result == null + ? com.google.cloud.retail.v2alpha.SearchSolutionUseCase.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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.v2alpha.SearchSolutionUseCase>( + searchSolutionUseCase_, searchSolutionUseCase_converter_); + } + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The count of searchSolutionUseCase. + */ + @java.lang.Override + public int getSearchSolutionUseCaseCount() { + return searchSolutionUseCase_.size(); + } + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchSolutionUseCase getSearchSolutionUseCase(int index) { + return searchSolutionUseCase_converter_.convert(searchSolutionUseCase_.get(index)); + } + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + @java.lang.Override + public java.util.List getSearchSolutionUseCaseValueList() { + return searchSolutionUseCase_; + } + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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 + 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 { + getSerializedSize(); + 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 (controlCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_); + } + if (controlCase_ == 4) { + output.writeMessage(4, (com.google.cloud.retail.v2alpha.Rule) control_); + } + for (int i = 0; i < associatedServingConfigIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 5, associatedServingConfigIds_.getRaw(i)); + } + if (getSolutionTypesList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(solutionTypesMemoizedSerializedSize); + } + 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); + } + + @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 (controlCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_); + } + if (controlCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.retail.v2alpha.Rule) control_); + } + { + int dataSize = 0; + for (int i = 0; i < associatedServingConfigIds_.size(); i++) { + dataSize += computeStringSizeNoTag(associatedServingConfigIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAssociatedServingConfigIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < solutionTypes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(solutionTypes_.get(i)); + } + size += dataSize; + if (!getSolutionTypesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + 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; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.Control)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Control other = (com.google.cloud.retail.v2alpha.Control) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + 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: + if (!getFacetSpec().equals(other.getFacetSpec())) return false; + break; + case 4: + if (!getRule().equals(other.getRule())) return false; + break; + case 0: + default: + } + 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(); + if (getAssociatedServingConfigIdsCount() > 0) { + hash = (37 * hash) + ASSOCIATED_SERVING_CONFIG_IDS_FIELD_NUMBER; + hash = (53 * hash) + getAssociatedServingConfigIdsList().hashCode(); + } + if (getSolutionTypesCount() > 0) { + 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; + hash = (53 * hash) + getFacetSpec().hashCode(); + break; + case 4: + hash = (37 * hash) + RULE_FIELD_NUMBER; + hash = (53 * hash) + getRule().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Control parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Control parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Control parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Control 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; + } + /** + * + * + *
+   * Configures dynamic serving time metadata that is used to pre and post
+   * process search/recommendation model results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Control} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Control) + com.google.cloud.retail.v2alpha.ControlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlProto + .internal_static_google_cloud_retail_v2alpha_Control_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlProto + .internal_static_google_cloud_retail_v2alpha_Control_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Control.class, + com.google.cloud.retail.v2alpha.Control.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Control.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_ = ""; + + displayName_ = ""; + + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + 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; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ControlProto + .internal_static_google_cloud_retail_v2alpha_Control_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Control.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control build() { + com.google.cloud.retail.v2alpha.Control result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control buildPartial() { + com.google.cloud.retail.v2alpha.Control result = + new com.google.cloud.retail.v2alpha.Control(this); + int from_bitField0_ = bitField0_; + if (controlCase_ == 3) { + if (facetSpecBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = facetSpecBuilder_.build(); + } + } + if (controlCase_ == 4) { + if (ruleBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = ruleBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + if (((bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = associatedServingConfigIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.associatedServingConfigIds_ = associatedServingConfigIds_; + if (((bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + 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; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.Control) { + return mergeFrom((com.google.cloud.retail.v2alpha.Control) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Control other) { + if (other == com.google.cloud.retail.v2alpha.Control.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.associatedServingConfigIds_.isEmpty()) { + if (associatedServingConfigIds_.isEmpty()) { + associatedServingConfigIds_ = other.associatedServingConfigIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.addAll(other.associatedServingConfigIds_); + } + onChanged(); + } + if (!other.solutionTypes_.isEmpty()) { + if (solutionTypes_.isEmpty()) { + solutionTypes_ = other.solutionTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSolutionTypesIsMutable(); + solutionTypes_.addAll(other.solutionTypes_); + } + 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: + { + mergeFacetSpec(other.getFacetSpec()); + break; + } + case RULE: + { + mergeRule(other.getRule()); + break; + } + case CONTROL_NOT_SET: + { + break; + } + } + 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.v2alpha.Control parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Control) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int controlCase_ = 0; + private java.lang.Object control_; + + public ControlCase getControlCase() { + return ControlCase.forNumber(controlCase_); + } + + public Builder clearControl() { + controlCase_ = 0; + control_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder> + facetSpecBuilder_; + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + @java.lang.Override + public boolean hasFacetSpec() { + return controlCase_ == 3; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpec() { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } else { + if (controlCase_ == 3) { + return facetSpecBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder setFacetSpec(com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec value) { + if (facetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + facetSpecBuilder_.setMessage(value); + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder setFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + facetSpecBuilder_.setMessage(builderForValue.build()); + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder mergeFacetSpec(com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec value) { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3 + && control_ + != com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance()) { + control_ = + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.newBuilder( + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + if (controlCase_ == 3) { + facetSpecBuilder_.mergeFrom(value); + } else { + facetSpecBuilder_.setMessage(value); + } + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder clearFacetSpec() { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3) { + controlCase_ = 0; + control_ = null; + onChanged(); + } + } else { + if (controlCase_ == 3) { + controlCase_ = 0; + control_ = null; + } + facetSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder getFacetSpecBuilder() { + return getFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder + getFacetSpecOrBuilder() { + if ((controlCase_ == 3) && (facetSpecBuilder_ != null)) { + return facetSpecBuilder_.getMessageOrBuilder(); + } else { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder> + getFacetSpecFieldBuilder() { + if (facetSpecBuilder_ == null) { + if (!(controlCase_ == 3)) { + control_ = com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + facetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder>( + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) control_, + getParentForChildren(), + isClean()); + control_ = null; + } + controlCase_ = 3; + onChanged(); + ; + return facetSpecBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule, + com.google.cloud.retail.v2alpha.Rule.Builder, + com.google.cloud.retail.v2alpha.RuleOrBuilder> + ruleBuilder_; + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return controlCase_ == 4; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule getRule() { + if (ruleBuilder_ == null) { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2alpha.Rule) control_; + } + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } else { + if (controlCase_ == 4) { + return ruleBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + public Builder setRule(com.google.cloud.retail.v2alpha.Rule value) { + if (ruleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + ruleBuilder_.setMessage(value); + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + public Builder setRule(com.google.cloud.retail.v2alpha.Rule.Builder builderForValue) { + if (ruleBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + ruleBuilder_.setMessage(builderForValue.build()); + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + public Builder mergeRule(com.google.cloud.retail.v2alpha.Rule value) { + if (ruleBuilder_ == null) { + if (controlCase_ == 4 + && control_ != com.google.cloud.retail.v2alpha.Rule.getDefaultInstance()) { + control_ = + com.google.cloud.retail.v2alpha.Rule.newBuilder( + (com.google.cloud.retail.v2alpha.Rule) control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + if (controlCase_ == 4) { + ruleBuilder_.mergeFrom(value); + } else { + ruleBuilder_.setMessage(value); + } + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + public Builder clearRule() { + if (ruleBuilder_ == null) { + if (controlCase_ == 4) { + controlCase_ = 0; + control_ = null; + onChanged(); + } + } else { + if (controlCase_ == 4) { + controlCase_ = 0; + control_ = null; + } + ruleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + public com.google.cloud.retail.v2alpha.Rule.Builder getRuleBuilder() { + return getRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.RuleOrBuilder getRuleOrBuilder() { + if ((controlCase_ == 4) && (ruleBuilder_ != null)) { + return ruleBuilder_.getMessageOrBuilder(); + } else { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2alpha.Rule) control_; + } + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule, + com.google.cloud.retail.v2alpha.Rule.Builder, + com.google.cloud.retail.v2alpha.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + if (!(controlCase_ == 4)) { + control_ = com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + ruleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule, + com.google.cloud.retail.v2alpha.Rule.Builder, + com.google.cloud.retail.v2alpha.RuleOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule) control_, getParentForChildren(), isClean()); + control_ = null; + } + controlCase_ = 4; + onChanged(); + ; + return ruleBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 com.google.protobuf.LazyStringList associatedServingConfigIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAssociatedServingConfigIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = + new com.google.protobuf.LazyStringArrayList(associatedServingConfigIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList() { + return associatedServingConfigIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + public int getAssociatedServingConfigIdsCount() { + return associatedServingConfigIds_.size(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + public java.lang.String getAssociatedServingConfigIds(int index) { + return associatedServingConfigIds_.get(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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(int index) { + return associatedServingConfigIds_.getByteString(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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The associatedServingConfigIds to set. + * @return This builder for chaining. + */ + public Builder setAssociatedServingConfigIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAssociatedServingConfigIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAllAssociatedServingConfigIds(java.lang.Iterable values) { + ensureAssociatedServingConfigIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, associatedServingConfigIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAssociatedServingConfigIds() { + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAssociatedServingConfigIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.add(value); + onChanged(); + return this; + } + + private java.util.List solutionTypes_ = java.util.Collections.emptyList(); + + private void ensureSolutionTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(solutionTypes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + public com.google.cloud.retail.v2alpha.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(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.
+     * 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index to set the value at. + * @param value The solutionTypes to set. + * @return This builder for chaining. + */ + public Builder setSolutionTypes(int index, com.google.cloud.retail.v2alpha.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypes(com.google.cloud.retail.v2alpha.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypes( + java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (com.google.cloud.retail.v2alpha.SolutionType value : values) { + solutionTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearSolutionTypes() { + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + public java.util.List getSolutionTypesValueList() { + return java.util.Collections.unmodifiableList(solutionTypes_); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(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.
+     * 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + * @return This builder for chaining. + */ + public Builder setSolutionTypesValue(int index, int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypesValue(int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The enum numeric values on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypesValue(java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (int value : values) { + solutionTypes_.add(value); + } + onChanged(); + 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; + } + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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.v2alpha.SearchSolutionUseCase>( + searchSolutionUseCase_, searchSolutionUseCase_converter_); + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The count of searchSolutionUseCase. + */ + public int getSearchSolutionUseCaseCount() { + return searchSolutionUseCase_.size(); + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + public com.google.cloud.retail.v2alpha.SearchSolutionUseCase getSearchSolutionUseCase( + int index) { + return searchSolutionUseCase_converter_.convert(searchSolutionUseCase_.get(index)); + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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.v2alpha.SearchSolutionUseCase value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addSearchSolutionUseCase( + com.google.cloud.retail.v2alpha.SearchSolutionUseCase value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param values The searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addAllSearchSolutionUseCase( + java.lang.Iterable + values) { + ensureSearchSolutionUseCaseIsMutable(); + for (com.google.cloud.retail.v2alpha.SearchSolutionUseCase value : values) { + searchSolutionUseCase_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchSolutionUseCase() { + searchSolutionUseCase_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + public java.util.List getSearchSolutionUseCaseValueList() { + return java.util.Collections.unmodifiableList(searchSolutionUseCase_); + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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); + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of searchSolutionUseCase at the given index. + * @return This builder for chaining. + */ + public Builder setSearchSolutionUseCaseValue(int index, int value) { + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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; + } + /** + * + * + *
+     * Required. 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 if not specified.
+     * Currently only allow one search_solution_use_case per control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Control) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Control) + private static final com.google.cloud.retail.v2alpha.Control DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Control(); + } + + public static com.google.cloud.retail.v2alpha.Control getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Control parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Control(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.v2alpha.Control getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlName.java new file mode 100644 index 00000000..75b1d778 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlName.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.v2alpha; + +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 ControlName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_CONTROL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String control; + + @Deprecated + protected ControlName() { + project = null; + location = null; + catalog = null; + control = null; + } + + private ControlName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + control = Preconditions.checkNotNull(builder.getControl()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getControl() { + return control; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ControlName of(String project, String location, String catalog, String control) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setControl(control) + .build(); + } + + public static String format(String project, String location, String catalog, String control) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setControl(control) + .build() + .toString(); + } + + public static ControlName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_CONTROL.validatedMatch( + formattedString, "ControlName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("control")); + } + + 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 (ControlName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_CONTROL.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 (control != null) { + fieldMapBuilder.put("control", control); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_CONTROL.instantiate( + "project", project, "location", location, "catalog", catalog, "control", control); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ControlName that = ((ControlName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.control, that.control); + } + 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(control); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String control; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getControl() { + return control; + } + + 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 setControl(String control) { + this.control = control; + return this; + } + + private Builder(ControlName controlName) { + this.project = controlName.project; + this.location = controlName.location; + this.catalog = controlName.catalog; + this.control = controlName.control; + } + + public ControlName build() { + return new ControlName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlOrBuilder.java new file mode 100644 index 00000000..748452df --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlOrBuilder.java @@ -0,0 +1,422 @@ +/* + * 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/v2alpha/control.proto + +package com.google.cloud.retail.v2alpha; + +public interface ControlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Control) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + boolean hasFacetSpec(); + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpec(); + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_spec = 3; + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder(); + + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + boolean hasRule(); + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + * + * @return The rule. + */ + com.google.cloud.retail.v2alpha.Rule getRule(); + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule rule = 4; + */ + com.google.cloud.retail.v2alpha.RuleOrBuilder getRuleOrBuilder(); + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + java.util.List 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + java.util.List getSolutionTypesList(); + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + 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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + com.google.cloud.retail.v2alpha.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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + 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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + int getSolutionTypesValue(int index); + + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return A list containing the searchSolutionUseCase. + */ + java.util.List + getSearchSolutionUseCaseList(); + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The count of searchSolutionUseCase. + */ + int getSearchSolutionUseCaseCount(); + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + com.google.cloud.retail.v2alpha.SearchSolutionUseCase getSearchSolutionUseCase(int index); + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + java.util.List getSearchSolutionUseCaseValueList(); + /** + * + * + *
+   * Required. 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 if not specified.
+   * Currently only allow one search_solution_use_case per control.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchSolutionUseCase search_solution_use_case = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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.v2alpha.Control.ControlCase getControlCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlProto.java new file mode 100644 index 00000000..da64e994 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlProto.java @@ -0,0 +1,106 @@ +/* + * 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/v2alpha/control.proto + +package com.google.cloud.retail.v2alpha; + +public final class ControlProto { + private ControlProto() {} + + 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_v2alpha_Control_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Control_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/v2alpha/control.pr" + + "oto\022\033google.cloud.retail.v2alpha\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032(google/cloud/retail/v2alph" + + "a/common.proto\0320google/cloud/retail/v2al" + + "pha/search_service.proto\"\206\004\n\007Control\022J\n\n" + + "facet_spec\030\003 \001(\01324.google.cloud.retail.v" + + "2alpha.SearchRequest.FacetSpecH\000\0221\n\004rule" + + "\030\004 \001(\0132!.google.cloud.retail.v2alpha.Rul" + + "eH\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_i" + + "ds\030\005 \003(\tB\003\340A\003\022I\n\016solution_types\030\006 \003(\0162)." + + "google.cloud.retail.v2alpha.SolutionType" + + "B\006\340A\002\340A\005\022Y\n\030search_solution_use_case\030\007 \003" + + "(\01622.google.cloud.retail.v2alpha.SearchS" + + "olutionUseCaseB\003\340A\002:q\352An\n\035retail.googlea" + + "pis.com/Control\022Mprojects/{project}/loca" + + "tions/{location}/catalogs/{catalog}/cont" + + "rols/{control}B\t\n\007controlB\332\001\n\037com.google" + + ".cloud.retail.v2alphaB\014ControlProtoP\001ZAg" + + "oogle.golang.org/genproto/googleapis/clo" + + "ud/retail/v2alpha;retail\242\002\006RETAIL\252\002\033Goog" + + "le.Cloud.Retail.V2Alpha\312\002\033Google\\Cloud\\R" + + "etail\\V2alpha\352\002\036Google::Cloud::Retail::V" + + "2alphab\006proto3" + }; + 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.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.SearchServiceProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_Control_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Control_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Control_descriptor, + new java.lang.String[] { + "FacetSpec", + "Rule", + "Name", + "DisplayName", + "AssociatedServingConfigIds", + "SolutionTypes", + "SearchSolutionUseCase", + "Control", + }); + 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.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.SearchServiceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceProto.java new file mode 100644 index 00000000..07f793a7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceProto.java @@ -0,0 +1,202 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class ControlServiceProto { + private ControlServiceProto() {} + + 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_v2alpha_CreateControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CreateControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListControlsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListControlsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListControlsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListControlsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/retail/v2alpha/control_se" + + "rvice.proto\022\033google.cloud.retail.v2alpha" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032)goo" + + "gle/cloud/retail/v2alpha/control.proto\032\033" + + "google/protobuf/empty.proto\032 google/prot" + + "obuf/field_mask.proto\"\242\001\n\024CreateControlR" + + "equest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035retail.g" + + "oogleapis.com/Catalog\022:\n\007control\030\002 \001(\0132$" + + ".google.cloud.retail.v2alpha.ControlB\003\340A" + + "\002\022\027\n\ncontrol_id\030\003 \001(\tB\003\340A\002\"\203\001\n\024UpdateCon" + + "trolRequest\022:\n\007control\030\001 \001(\0132$.google.cl" + + "oud.retail.v2alpha.ControlB\003\340A\002\022/\n\013updat" + + "e_mask\030\002 \001(\0132\032.google.protobuf.FieldMask" + + "\"K\n\024DeleteControlRequest\0223\n\004name\030\001 \001(\tB%" + + "\340A\002\372A\037\n\035retail.googleapis.com/Control\"H\n" + + "\021GetControlRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037" + + "\n\035retail.googleapis.com/Control\"\222\001\n\023List" + + "ControlsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n" + + "\035retail.googleapis.com/Catalog\022\026\n\tpage_s" + + "ize\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022" + + "\023\n\006filter\030\004 \001(\tB\003\340A\001\"g\n\024ListControlsResp" + + "onse\0226\n\010controls\030\001 \003(\0132$.google.cloud.re" + + "tail.v2alpha.Control\022\027\n\017next_page_token\030" + + "\002 \001(\t2\252\010\n\016ControlService\022\323\001\n\rCreateContr" + + "ol\0221.google.cloud.retail.v2alpha.CreateC" + + "ontrolRequest\032$.google.cloud.retail.v2al" + + "pha.Control\"i\202\323\344\223\002G\"*\022\022 + * Request for CreateControl method. + * + * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateControlRequest} + */ +public final class CreateControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CreateControlRequest) + CreateControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateControlRequest.newBuilder() to construct. + private CreateControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateControlRequest() { + parent_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateControlRequest( + 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.v2alpha.Control.Builder subBuilder = null; + if (control_ != null) { + subBuilder = control_.toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Control.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(control_); + control_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateControlRequest.class, + com.google.cloud.retail.v2alpha.CreateControlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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 CONTROL_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.Control control_; + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + @java.lang.Override + public boolean hasControl() { + return control_ != null; + } + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control getControl() { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder() { + return getControl(); + } + + public static final int CONTROL_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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 (control_ != null) { + output.writeMessage(2, getControl()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, controlId_); + } + 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 (control_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getControl()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, controlId_); + } + 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.v2alpha.CreateControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CreateControlRequest other = + (com.google.cloud.retail.v2alpha.CreateControlRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasControl() != other.hasControl()) return false; + if (hasControl()) { + if (!getControl().equals(other.getControl())) return false; + } + if (!getControlId().equals(other.getControlId())) 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 (hasControl()) { + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getControl().hashCode(); + } + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CreateControlRequest 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 CreateControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CreateControlRequest) + com.google.cloud.retail.v2alpha.CreateControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateControlRequest.class, + com.google.cloud.retail.v2alpha.CreateControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CreateControlRequest.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 (controlBuilder_ == null) { + control_ = null; + } else { + control_ = null; + controlBuilder_ = null; + } + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CreateControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateControlRequest build() { + com.google.cloud.retail.v2alpha.CreateControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.CreateControlRequest result = + new com.google.cloud.retail.v2alpha.CreateControlRequest(this); + result.parent_ = parent_; + if (controlBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = controlBuilder_.build(); + } + result.controlId_ = controlId_; + 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.v2alpha.CreateControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.CreateControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CreateControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.CreateControlRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasControl()) { + mergeControl(other.getControl()); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.v2alpha.CreateControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CreateControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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.v2alpha.Control control_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + controlBuilder_; + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + public boolean hasControl() { + return controlBuilder_ != null || control_ != null; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + public com.google.cloud.retail.v2alpha.Control getControl() { + if (controlBuilder_ == null) { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } else { + return controlBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2alpha.Control value) { + if (controlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + controlBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2alpha.Control.Builder builderForValue) { + if (controlBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + controlBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeControl(com.google.cloud.retail.v2alpha.Control value) { + if (controlBuilder_ == null) { + if (control_ != null) { + control_ = + com.google.cloud.retail.v2alpha.Control.newBuilder(control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + controlBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearControl() { + if (controlBuilder_ == null) { + control_ = null; + onChanged(); + } else { + control_ = null; + controlBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Control.Builder getControlBuilder() { + + onChanged(); + return getControlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder() { + if (controlBuilder_ != null) { + return controlBuilder_.getMessageOrBuilder(); + } else { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + getControlFieldBuilder() { + if (controlBuilder_ == null) { + controlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder>( + getControl(), getParentForChildren(), isClean()); + control_ = null; + } + return controlBuilder_; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.v2alpha.CreateControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CreateControlRequest) + private static final com.google.cloud.retail.v2alpha.CreateControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CreateControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.CreateControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateControlRequest(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.v2alpha.CreateControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateControlRequestOrBuilder.java new file mode 100644 index 00000000..b265ec5e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateControlRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CreateControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CreateControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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 Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + boolean hasControl(); + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + com.google.cloud.retail.v2alpha.Control getControl(); + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequest.java new file mode 100644 index 00000000..c81ef492 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequest.java @@ -0,0 +1,1216 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [CreateProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateProductRequest} + */ +public final class CreateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CreateProductRequest) + CreateProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProductRequest.newBuilder() to construct. + private CreateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProductRequest() { + parent_ = ""; + productId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateProductRequest( + 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.v2alpha.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + productId_ = 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateProductRequest.class, + com.google.cloud.retail.v2alpha.CreateProductRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * 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 catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * 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 PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.Product product_; + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int PRODUCT_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object productId_; + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + @java.lang.Override + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + 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(); + productId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productId_ = 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 (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); + } + 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 (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productId_); + } + 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.v2alpha.CreateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CreateProductRequest other = + (com.google.cloud.retail.v2alpha.CreateProductRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (!getProductId().equals(other.getProductId())) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProductId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CreateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [CreateProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CreateProductRequest) + com.google.cloud.retail.v2alpha.CreateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateProductRequest.class, + com.google.cloud.retail.v2alpha.CreateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CreateProductRequest.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + productId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CreateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateProductRequest build() { + com.google.cloud.retail.v2alpha.CreateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateProductRequest buildPartial() { + com.google.cloud.retail.v2alpha.CreateProductRequest result = + new com.google.cloud.retail.v2alpha.CreateProductRequest(this); + result.parent_ = parent_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.productId_ = productId_; + 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.v2alpha.CreateProductRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.CreateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CreateProductRequest other) { + if (other == com.google.cloud.retail.v2alpha.CreateProductRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (!other.getProductId().isEmpty()) { + productId_ = other.productId_; + 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.v2alpha.CreateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CreateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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.v2alpha.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2alpha.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2alpha.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private java.lang.Object productId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + public com.google.protobuf.ByteString getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The productId to set. + * @return This builder for chaining. + */ + public Builder setProductId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProductId() { + + productId_ = getDefaultInstance().getProductId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for productId to set. + * @return This builder for chaining. + */ + public Builder setProductIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productId_ = 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.v2alpha.CreateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CreateProductRequest) + private static final com.google.cloud.retail.v2alpha.CreateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CreateProductRequest(); + } + + public static com.google.cloud.retail.v2alpha.CreateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProductRequest(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.v2alpha.CreateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequestOrBuilder.java new file mode 100644 index 00000000..8e04ce8c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateProductRequestOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CreateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CreateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2alpha.Product getProduct(); + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2alpha.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + java.lang.String getProductId(); + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2alpha.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2alpha.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + com.google.protobuf.ByteString getProductIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequest.java new file mode 100644 index 00000000..827d398c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequest.java @@ -0,0 +1,1162 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for CreateServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateServingConfigRequest} + */ +public final class CreateServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CreateServingConfigRequest) + CreateServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServingConfigRequest.newBuilder() to construct. + private CreateServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServingConfigRequest() { + parent_ = ""; + servingConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServingConfigRequest( + 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.v2alpha.ServingConfig.Builder subBuilder = null; + if (servingConfig_ != null) { + subBuilder = servingConfig_.toBuilder(); + } + servingConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ServingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(servingConfig_); + servingConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + servingConfigId_ = 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest.class, + com.google.cloud.retail.v2alpha.CreateServingConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Full resource name of parent. 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. Full resource name of parent. 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 SERVING_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ServingConfig servingConfig_; + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + @java.lang.Override + public boolean hasServingConfig() { + return servingConfig_ != null; + } + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfig() { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder() { + return getServingConfig(); + } + + public static final int SERVING_CONFIG_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object servingConfigId_; + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + @java.lang.Override + public java.lang.String getServingConfigId() { + java.lang.Object ref = servingConfigId_; + 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(); + servingConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigIdBytes() { + java.lang.Object ref = servingConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfigId_ = 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 (servingConfig_ != null) { + output.writeMessage(2, getServingConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfigId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, servingConfigId_); + } + 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 (servingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServingConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfigId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, servingConfigId_); + } + 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.v2alpha.CreateServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CreateServingConfigRequest other = + (com.google.cloud.retail.v2alpha.CreateServingConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasServingConfig() != other.hasServingConfig()) return false; + if (hasServingConfig()) { + if (!getServingConfig().equals(other.getServingConfig())) return false; + } + if (!getServingConfigId().equals(other.getServingConfigId())) 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 (hasServingConfig()) { + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + } + hash = (37 * hash) + SERVING_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest 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 CreateServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CreateServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CreateServingConfigRequest) + com.google.cloud.retail.v2alpha.CreateServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CreateServingConfigRequest.class, + com.google.cloud.retail.v2alpha.CreateServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CreateServingConfigRequest.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 (servingConfigBuilder_ == null) { + servingConfig_ = null; + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + servingConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CreateServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateServingConfigRequest build() { + com.google.cloud.retail.v2alpha.CreateServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CreateServingConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.CreateServingConfigRequest result = + new com.google.cloud.retail.v2alpha.CreateServingConfigRequest(this); + result.parent_ = parent_; + if (servingConfigBuilder_ == null) { + result.servingConfig_ = servingConfig_; + } else { + result.servingConfig_ = servingConfigBuilder_.build(); + } + result.servingConfigId_ = servingConfigId_; + 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.v2alpha.CreateServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.CreateServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CreateServingConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.CreateServingConfigRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasServingConfig()) { + mergeServingConfig(other.getServingConfig()); + } + if (!other.getServingConfigId().isEmpty()) { + servingConfigId_ = other.servingConfigId_; + 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.v2alpha.CreateServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.CreateServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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.v2alpha.ServingConfig servingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + servingConfigBuilder_; + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + public boolean hasServingConfig() { + return servingConfigBuilder_ != null || servingConfig_ != null; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfig() { + if (servingConfigBuilder_ == null) { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } else { + return servingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig(com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + onChanged(); + } else { + servingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig( + com.google.cloud.retail.v2alpha.ServingConfig.Builder builderForValue) { + if (servingConfigBuilder_ == null) { + servingConfig_ = builderForValue.build(); + onChanged(); + } else { + servingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServingConfig(com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (servingConfig_ != null) { + servingConfig_ = + com.google.cloud.retail.v2alpha.ServingConfig.newBuilder(servingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + servingConfig_ = value; + } + onChanged(); + } else { + servingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServingConfig() { + if (servingConfigBuilder_ == null) { + servingConfig_ = null; + onChanged(); + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ServingConfig.Builder getServingConfigBuilder() { + + onChanged(); + return getServingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder() { + if (servingConfigBuilder_ != null) { + return servingConfigBuilder_.getMessageOrBuilder(); + } else { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + getServingConfigFieldBuilder() { + if (servingConfigBuilder_ == null) { + servingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder>( + getServingConfig(), getParentForChildren(), isClean()); + servingConfig_ = null; + } + return servingConfigBuilder_; + } + + private java.lang.Object servingConfigId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + public java.lang.String getServingConfigId() { + java.lang.Object ref = servingConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + public com.google.protobuf.ByteString getServingConfigIdBytes() { + java.lang.Object ref = servingConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The servingConfigId to set. + * @return This builder for chaining. + */ + public Builder setServingConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearServingConfigId() { + + servingConfigId_ = getDefaultInstance().getServingConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for servingConfigId to set. + * @return This builder for chaining. + */ + public Builder setServingConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfigId_ = 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.v2alpha.CreateServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CreateServingConfigRequest) + private static final com.google.cloud.retail.v2alpha.CreateServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CreateServingConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.CreateServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServingConfigRequest(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.v2alpha.CreateServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..e0c133da --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CreateServingConfigRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface CreateServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CreateServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent. 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. Full resource name of parent. 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 ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + boolean hasServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + com.google.cloud.retail.v2alpha.ServingConfig getServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + java.lang.String getServingConfigId(); + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + com.google.protobuf.ByteString getServingConfigIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttribute.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttribute.java new file mode 100644 index 00000000..e8d95789 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttribute.java @@ -0,0 +1,1493 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * A custom attribute that is not explicitly modeled in
+ * [Product][google.cloud.retail.v2alpha.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CustomAttribute} + */ +public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.CustomAttribute) + CustomAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomAttribute.newBuilder() to construct. + private CustomAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomAttribute() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + numbers_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAttribute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomAttribute( + 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)) { + text_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + text_.add(s); + break; + } + case 17: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + numbers_ = newDoubleList(); + mutable_bitField0_ |= 0x00000002; + } + numbers_.addDouble(input.readDouble()); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { + numbers_ = newDoubleList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + numbers_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 24: + { + bitField0_ |= 0x00000001; + searchable_ = input.readBool(); + break; + } + case 32: + { + bitField0_ |= 0x00000002; + indexable_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + numbers_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CustomAttribute.class, + com.google.cloud.retail.v2alpha.CustomAttribute.Builder.class); + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList text_; + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_; + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + + public static final int NUMBERS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.DoubleList numbers_; + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + @java.lang.Override + public java.util.List getNumbersList() { + return numbers_; + } + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + public int getNumbersCount() { + return numbers_.size(); + } + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + public double getNumbers(int index) { + return numbers_.getDouble(index); + } + + private int numbersMemoizedSerializedSize = -1; + + public static final int SEARCHABLE_FIELD_NUMBER = 3; + private boolean searchable_; + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+   * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+   * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + + public static final int INDEXABLE_FIELD_NUMBER = 4; + private boolean indexable_; + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + + 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 { + getSerializedSize(); + for (int i = 0; i < text_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_.getRaw(i)); + } + if (getNumbersList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(numbersMemoizedSerializedSize); + } + for (int i = 0; i < numbers_.size(); i++) { + output.writeDoubleNoTag(numbers_.getDouble(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(4, indexable_); + } + 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 < text_.size(); i++) { + dataSize += computeStringSizeNoTag(text_.getRaw(i)); + } + size += dataSize; + size += 1 * getTextList().size(); + } + { + int dataSize = 0; + dataSize = 8 * getNumbersList().size(); + size += dataSize; + if (!getNumbersList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + numbersMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, indexable_); + } + 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.v2alpha.CustomAttribute)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.CustomAttribute other = + (com.google.cloud.retail.v2alpha.CustomAttribute) obj; + + if (!getTextList().equals(other.getTextList())) return false; + if (!getNumbersList().equals(other.getNumbersList())) return false; + if (hasSearchable() != other.hasSearchable()) return false; + if (hasSearchable()) { + if (getSearchable() != other.getSearchable()) return false; + } + if (hasIndexable() != other.hasIndexable()) return false; + if (hasIndexable()) { + if (getIndexable() != other.getIndexable()) 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 (getTextCount() > 0) { + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getTextList().hashCode(); + } + if (getNumbersCount() > 0) { + hash = (37 * hash) + NUMBERS_FIELD_NUMBER; + hash = (53 * hash) + getNumbersList().hashCode(); + } + if (hasSearchable()) { + hash = (37 * hash) + SEARCHABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSearchable()); + } + if (hasIndexable()) { + hash = (37 * hash) + INDEXABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIndexable()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.CustomAttribute 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; + } + /** + * + * + *
+   * A custom attribute that is not explicitly modeled in
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.CustomAttribute) + com.google.cloud.retail.v2alpha.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.CustomAttribute.class, + com.google.cloud.retail.v2alpha.CustomAttribute.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.CustomAttribute.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(); + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + numbers_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000002); + searchable_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + indexable_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute build() { + com.google.cloud.retail.v2alpha.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute buildPartial() { + com.google.cloud.retail.v2alpha.CustomAttribute result = + new com.google.cloud.retail.v2alpha.CustomAttribute(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.text_ = text_; + if (((bitField0_ & 0x00000002) != 0)) { + numbers_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.numbers_ = numbers_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.searchable_ = searchable_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.indexable_ = indexable_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; + 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.v2alpha.CustomAttribute) { + return mergeFrom((com.google.cloud.retail.v2alpha.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.CustomAttribute other) { + if (other == com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance()) + return this; + if (!other.text_.isEmpty()) { + if (text_.isEmpty()) { + text_ = other.text_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTextIsMutable(); + text_.addAll(other.text_); + } + onChanged(); + } + if (!other.numbers_.isEmpty()) { + if (numbers_.isEmpty()) { + numbers_ = other.numbers_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNumbersIsMutable(); + numbers_.addAll(other.numbers_); + } + onChanged(); + } + if (other.hasSearchable()) { + setSearchable(other.getSearchable()); + } + if (other.hasIndexable()) { + setIndexable(other.getIndexable()); + } + 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.v2alpha.CustomAttribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.CustomAttribute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList text_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTextIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + text_ = new com.google.protobuf.LazyStringArrayList(text_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_.getUnmodifiableView(); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index to set the value at. + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param value The text to add. + * @return This builder for chaining. + */ + public Builder addText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param values The text to add. + * @return This builder for chaining. + */ + public Builder addAllText(java.lang.Iterable values) { + ensureTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, text_); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param value The bytes of the text to add. + * @return This builder for chaining. + */ + public Builder addTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList numbers_ = emptyDoubleList(); + + private void ensureNumbersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + numbers_ = mutableCopy(numbers_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + public java.util.List getNumbersList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(numbers_) + : numbers_; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + public int getNumbersCount() { + return numbers_.size(); + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + public double getNumbers(int index) { + return numbers_.getDouble(index); + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param index The index to set the value at. + * @param value The numbers to set. + * @return This builder for chaining. + */ + public Builder setNumbers(int index, double value) { + ensureNumbersIsMutable(); + numbers_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param value The numbers to add. + * @return This builder for chaining. + */ + public Builder addNumbers(double value) { + ensureNumbersIsMutable(); + numbers_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param values The numbers to add. + * @return This builder for chaining. + */ + public Builder addAllNumbers(java.lang.Iterable values) { + ensureNumbersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, numbers_); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return This builder for chaining. + */ + public Builder clearNumbers() { + numbers_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private boolean searchable_; + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+     * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+     * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+     * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @param value The searchable to set. + * @return This builder for chaining. + */ + public Builder setSearchable(boolean value) { + bitField0_ |= 0x00000004; + searchable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+     * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return This builder for chaining. + */ + public Builder clearSearchable() { + bitField0_ = (bitField0_ & ~0x00000004); + searchable_ = false; + onChanged(); + return this; + } + + private boolean indexable_; + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @param value The indexable to set. + * @return This builder for chaining. + */ + public Builder setIndexable(boolean value) { + bitField0_ |= 0x00000008; + indexable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return This builder for chaining. + */ + public Builder clearIndexable() { + bitField0_ = (bitField0_ & ~0x00000008); + indexable_ = 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.v2alpha.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.CustomAttribute) + private static final com.google.cloud.retail.v2alpha.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.CustomAttribute(); + } + + public static com.google.cloud.retail.v2alpha.CustomAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomAttribute(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.v2alpha.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttributeOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttributeOrBuilder.java new file mode 100644 index 00000000..867a3ca5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/CustomAttributeOrBuilder.java @@ -0,0 +1,244 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.CustomAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + java.util.List getTextList(); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + int getTextCount(); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + java.lang.String getText(int index); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + com.google.protobuf.ByteString getTextBytes(int index); + + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + java.util.List getNumbersList(); + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + int getNumbersCount(); + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + double getNumbers(int index); + + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+   * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + boolean hasSearchable(); + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
+   * is set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + boolean getSearchable(); + + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + boolean hasIndexable(); + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2alpha.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + boolean getIndexable(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequest.java new file mode 100644 index 00000000..d7f121c1 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequest.java @@ -0,0 +1,659 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for DeleteControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteControlRequest} + */ +public final class DeleteControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.DeleteControlRequest) + DeleteControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteControlRequest.newBuilder() to construct. + private DeleteControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteControlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteControlRequest( + 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteControlRequest.class, + com.google.cloud.retail.v2alpha.DeleteControlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.v2alpha.DeleteControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.DeleteControlRequest other = + (com.google.cloud.retail.v2alpha.DeleteControlRequest) 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.v2alpha.DeleteControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.DeleteControlRequest 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 DeleteControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.DeleteControlRequest) + com.google.cloud.retail.v2alpha.DeleteControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteControlRequest.class, + com.google.cloud.retail.v2alpha.DeleteControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.DeleteControlRequest.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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.DeleteControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteControlRequest build() { + com.google.cloud.retail.v2alpha.DeleteControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.DeleteControlRequest result = + new com.google.cloud.retail.v2alpha.DeleteControlRequest(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.v2alpha.DeleteControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.DeleteControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.DeleteControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.DeleteControlRequest.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.v2alpha.DeleteControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.DeleteControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.v2alpha.DeleteControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.DeleteControlRequest) + private static final com.google.cloud.retail.v2alpha.DeleteControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.DeleteControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.DeleteControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteControlRequest(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.v2alpha.DeleteControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequestOrBuilder.java new file mode 100644 index 00000000..6fa17e4a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteControlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface DeleteControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.DeleteControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequest.java new file mode 100644 index 00000000..965fc8c0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequest.java @@ -0,0 +1,771 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [DeleteProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteProductRequest} + */ +public final class DeleteProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.DeleteProductRequest) + DeleteProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProductRequest.newBuilder() to construct. + private DeleteProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProductRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProductRequest( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteProductRequest.class, + com.google.cloud.retail.v2alpha.DeleteProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] with more than one
+   * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+   * 
+ * + * + * 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. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] with more than one
+   * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+   * 
+ * + * + * 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.v2alpha.DeleteProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.DeleteProductRequest other = + (com.google.cloud.retail.v2alpha.DeleteProductRequest) 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.v2alpha.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.DeleteProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [DeleteProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.DeleteProductRequest) + com.google.cloud.retail.v2alpha.DeleteProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteProductRequest.class, + com.google.cloud.retail.v2alpha.DeleteProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.DeleteProductRequest.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.DeleteProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteProductRequest build() { + com.google.cloud.retail.v2alpha.DeleteProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteProductRequest buildPartial() { + com.google.cloud.retail.v2alpha.DeleteProductRequest result = + new com.google.cloud.retail.v2alpha.DeleteProductRequest(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.v2alpha.DeleteProductRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.DeleteProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.DeleteProductRequest other) { + if (other == com.google.cloud.retail.v2alpha.DeleteProductRequest.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.v2alpha.DeleteProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.DeleteProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] with more than one
+     * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] with more than one
+     * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] with more than one
+     * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] with more than one
+     * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] with more than one
+     * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+     * 
+ * + * + * 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.v2alpha.DeleteProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.DeleteProductRequest) + private static final com.google.cloud.retail.v2alpha.DeleteProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.DeleteProductRequest(); + } + + public static com.google.cloud.retail.v2alpha.DeleteProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProductRequest(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.v2alpha.DeleteProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequestOrBuilder.java new file mode 100644 index 00000000..54521f8f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteProductRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface DeleteProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.DeleteProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] with more than one
+   * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] with more than one
+   * [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2alpha.Product] will be deleted.
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequest.java new file mode 100644 index 00000000..5b9db0ec --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequest.java @@ -0,0 +1,660 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for DeleteServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteServingConfigRequest} + */ +public final class DeleteServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.DeleteServingConfigRequest) + DeleteServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServingConfigRequest.newBuilder() to construct. + private DeleteServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServingConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServingConfigRequest( + 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.class, + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @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.v2alpha.DeleteServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest other = + (com.google.cloud.retail.v2alpha.DeleteServingConfigRequest) 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.v2alpha.DeleteServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest 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 DeleteServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.DeleteServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.DeleteServingConfigRequest) + com.google.cloud.retail.v2alpha.DeleteServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.class, + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteServingConfigRequest build() { + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.DeleteServingConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.DeleteServingConfigRequest result = + new com.google.cloud.retail.v2alpha.DeleteServingConfigRequest(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.v2alpha.DeleteServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.DeleteServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.DeleteServingConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.DeleteServingConfigRequest.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.v2alpha.DeleteServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.DeleteServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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.v2alpha.DeleteServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.DeleteServingConfigRequest) + private static final com.google.cloud.retail.v2alpha.DeleteServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.DeleteServingConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.DeleteServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServingConfigRequest(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.v2alpha.DeleteServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..7d5792a5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/DeleteServingConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface DeleteServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.DeleteServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @return The name. + */ + 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}
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java new file mode 100644 index 00000000..0e62ed90 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java @@ -0,0 +1,127 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public final class ExportConfigProto { + private ExportConfigProto() {} + + 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_v2alpha_ExportErrorsConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_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/v2alpha/export_con" + + "fig.proto\022\033google.cloud.retail.v2alpha\032\037" + + "google/api/field_behavior.proto\032\031google/" + + "api/resource.proto\032\037google/protobuf/time" + + "stamp.proto\032\027google/rpc/status.proto\"9\n\022" + + "ExportErrorsConfig\022\024\n\ngcs_prefix\030\001 \001(\tH\000" + + "B\r\n\013destination\"r\n\016ExportMetadata\022/\n\013cre" + + "ate_time\030\001 \001(\0132\032.google.protobuf.Timesta" + + "mp\022/\n\013update_time\030\002 \001(\0132\032.google.protobu" + + "f.Timestamp\"\213\001\n\026ExportProductsResponse\022)" + + "\n\rerror_samples\030\001 \003(\0132\022.google.rpc.Statu" + + "s\022F\n\rerrors_config\030\002 \001(\0132/.google.cloud." + + "retail.v2alpha.ExportErrorsConfig\"\215\001\n\030Ex" + + "portUserEventsResponse\022)\n\rerror_samples\030" + + "\001 \003(\0132\022.google.rpc.Status\022F\n\rerrors_conf" + + "ig\030\002 \001(\0132/.google.cloud.retail.v2alpha.E" + + "xportErrorsConfigB\337\001\n\037com.google.cloud.r" + + "etail.v2alphaB\021ExportConfigProtoP\001ZAgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "retail/v2alpha;retail\242\002\006RETAIL\252\002\033Google." + + "Cloud.Retail.V2Alpha\312\002\033Google\\Cloud\\Reta" + + "il\\V2alpha\352\002\036Google::Cloud::Retail::V2al" + + "phab\006proto3" + }; + 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(), + }); + internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_ExportMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfig.java new file mode 100644 index 00000000..87ef20d4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfig.java @@ -0,0 +1,795 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Configuration of destination for Export related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportErrorsConfig} + */ +public final class ExportErrorsConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportErrorsConfig) + ExportErrorsConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportErrorsConfig.newBuilder() to construct. + private ExportErrorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportErrorsConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportErrorsConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportErrorsConfig( + 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(); + destinationCase_ = 1; + destination_ = 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.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.class, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + 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(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = 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 (destinationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + 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.v2alpha.ExportErrorsConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportErrorsConfig other = + (com.google.cloud.retail.v2alpha.ExportErrorsConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 0: + default: + } + 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(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ExportErrorsConfig 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; + } + /** + * + * + *
+   * Configuration of destination for Export related errors.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportErrorsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportErrorsConfig) + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.class, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportErrorsConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig build() { + com.google.cloud.retail.v2alpha.ExportErrorsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig buildPartial() { + com.google.cloud.retail.v2alpha.ExportErrorsConfig result = + new com.google.cloud.retail.v2alpha.ExportErrorsConfig(this); + if (destinationCase_ == 1) { + result.destination_ = destination_; + } + result.destinationCase_ = destinationCase_; + 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.v2alpha.ExportErrorsConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportErrorsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportErrorsConfig other) { + if (other == com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + 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.v2alpha.ExportErrorsConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ExportErrorsConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationCase_ = 1; + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The bytes for gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationCase_ = 1; + destination_ = 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.v2alpha.ExportErrorsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportErrorsConfig) + private static final com.google.cloud.retail.v2alpha.ExportErrorsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportErrorsConfig(); + } + + public static com.google.cloud.retail.v2alpha.ExportErrorsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportErrorsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportErrorsConfig(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.v2alpha.ExportErrorsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfigOrBuilder.java new file mode 100644 index 00000000..5f4d4894 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportErrorsConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportErrorsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportErrorsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + java.lang.String getGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + public com.google.cloud.retail.v2alpha.ExportErrorsConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadata.java new file mode 100644 index 00000000..43649d8c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadata.java @@ -0,0 +1,1014 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the Export operation. This will be
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportMetadata} + */ +public final class ExportMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportMetadata) + ExportMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportMetadata.newBuilder() to construct. + private ExportMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportMetadata( + 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.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 18: + { + 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; + } + 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.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportMetadata.class, + com.google.cloud.retail.v2alpha.ExportMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(2, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateTime()); + } + 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.v2alpha.ExportMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportMetadata other = + (com.google.cloud.retail.v2alpha.ExportMetadata) obj; + + 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 (!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 (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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ExportMetadata 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 related to the progress of the Export operation. This will be
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportMetadata) + com.google.cloud.retail.v2alpha.ExportMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportMetadata.class, + com.google.cloud.retail.v2alpha.ExportMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportMetadata build() { + com.google.cloud.retail.v2alpha.ExportMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportMetadata buildPartial() { + com.google.cloud.retail.v2alpha.ExportMetadata result = + new com.google.cloud.retail.v2alpha.ExportMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.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.v2alpha.ExportMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportMetadata other) { + if (other == com.google.cloud.retail.v2alpha.ExportMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.v2alpha.ExportMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.ExportMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ExportMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportMetadata) + private static final com.google.cloud.retail.v2alpha.ExportMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportMetadata(); + } + + public static com.google.cloud.retail.v2alpha.ExportMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportMetadata(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.v2alpha.ExportMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadataOrBuilder.java new file mode 100644 index 00000000..4909c80e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponse.java new file mode 100644 index 00000000..40760111 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponse.java @@ -0,0 +1,1222 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the ExportProductsRequest. If the long running
+ * operation is done, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportProductsResponse} + */ +public final class ExportProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportProductsResponse) + ExportProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportProductsResponse.newBuilder() to construct. + private ExportProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportProductsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportProductsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportProductsResponse.class, + com.google.cloud.retail.v2alpha.ExportProductsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.v2alpha.ExportProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportProductsResponse other = + (com.google.cloud.retail.v2alpha.ExportProductsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ExportProductsResponse 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 ExportProductsRequest. If the long running
+   * operation is done, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportProductsResponse) + com.google.cloud.retail.v2alpha.ExportProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportProductsResponse.class, + com.google.cloud.retail.v2alpha.ExportProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportProductsResponse build() { + com.google.cloud.retail.v2alpha.ExportProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportProductsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ExportProductsResponse result = + new com.google.cloud.retail.v2alpha.ExportProductsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.v2alpha.ExportProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportProductsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ExportProductsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.v2alpha.ExportProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ExportProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ExportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ExportProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportProductsResponse) + private static final com.google.cloud.retail.v2alpha.ExportProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportProductsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ExportProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportProductsResponse(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.v2alpha.ExportProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponseOrBuilder.java new file mode 100644 index 00000000..7910fb74 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportProductsResponseOrBuilder.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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponse.java new file mode 100644 index 00000000..556f45a5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponse.java @@ -0,0 +1,1234 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the ExportUserEventsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportUserEventsResponse} + */ +public final class ExportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportUserEventsResponse) + ExportUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportUserEventsResponse.newBuilder() to construct. + private ExportUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportUserEventsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportUserEventsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportUserEventsResponse.class, + com.google.cloud.retail.v2alpha.ExportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.v2alpha.ExportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportUserEventsResponse other = + (com.google.cloud.retail.v2alpha.ExportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ExportUserEventsResponse 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 ExportUserEventsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportUserEventsResponse) + com.google.cloud.retail.v2alpha.ExportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportUserEventsResponse.class, + com.google.cloud.retail.v2alpha.ExportUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportUserEventsResponse build() { + com.google.cloud.retail.v2alpha.ExportUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportUserEventsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ExportUserEventsResponse result = + new com.google.cloud.retail.v2alpha.ExportUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.v2alpha.ExportUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportUserEventsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ExportUserEventsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.v2alpha.ExportUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ExportUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ExportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ExportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportUserEventsResponse) + private static final com.google.cloud.retail.v2alpha.ExportUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportUserEventsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ExportUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportUserEventsResponse(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.v2alpha.ExportUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..e66a2db6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportUserEventsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * 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/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfo.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfo.java new file mode 100644 index 00000000..930f9c47 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfo.java @@ -0,0 +1,1121 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Fulfillment information, such as the store IDs for in-store pickup or region
+ * IDs for different shipping methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.FulfillmentInfo} + */ +public final class FulfillmentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.FulfillmentInfo) + FulfillmentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillmentInfo.newBuilder() to construct. + private FulfillmentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillmentInfo() { + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillmentInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillmentInfo( + 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(); + + type_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.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)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.FulfillmentInfo.class, + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @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 PLACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.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(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, placeIds_.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(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().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.v2alpha.FulfillmentInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.FulfillmentInfo other = + (com.google.cloud.retail.v2alpha.FulfillmentInfo) obj; + + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.FulfillmentInfo 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; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or region
+   * IDs for different shipping methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.FulfillmentInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.FulfillmentInfo) + com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.FulfillmentInfo.class, + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.FulfillmentInfo.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(); + type_ = ""; + + placeIds_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_FulfillmentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.FulfillmentInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.FulfillmentInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.FulfillmentInfo build() { + com.google.cloud.retail.v2alpha.FulfillmentInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.FulfillmentInfo buildPartial() { + com.google.cloud.retail.v2alpha.FulfillmentInfo result = + new com.google.cloud.retail.v2alpha.FulfillmentInfo(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + 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.v2alpha.FulfillmentInfo) { + return mergeFrom((com.google.cloud.retail.v2alpha.FulfillmentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.FulfillmentInfo other) { + if (other == com.google.cloud.retail.v2alpha.FulfillmentInfo.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + 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.v2alpha.FulfillmentInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.FulfillmentInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.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.v2alpha.FulfillmentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.FulfillmentInfo) + private static final com.google.cloud.retail.v2alpha.FulfillmentInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.FulfillmentInfo(); + } + + public static com.google.cloud.retail.v2alpha.FulfillmentInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillmentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillmentInfo(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.v2alpha.FulfillmentInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfoOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfoOrBuilder.java new file mode 100644 index 00000000..a08f751c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/FulfillmentInfoOrBuilder.java @@ -0,0 +1,161 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface FulfillmentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.FulfillmentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSource.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSource.java new file mode 100644 index 00000000..90e67350 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSource.java @@ -0,0 +1,1128 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Google Cloud Storage location for input content.
+ * format.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + dataSchema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsSource( + 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)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputUris_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataSchema_ = 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)) { + inputUris_ = inputUris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GcsSource.class, + com.google.cloud.retail.v2alpha.GcsSource.Builder.class); + } + + public static final int INPUT_URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList inputUris_; + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_; + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + + public static final int DATA_SCHEMA_FIELD_NUMBER = 2; + private volatile java.lang.Object dataSchema_; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2alpha.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + @java.lang.Override + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + 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(); + dataSchema_ = s; + return s; + } + } + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2alpha.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = 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 < inputUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUris_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dataSchema_); + } + 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 < inputUris_.size(); i++) { + dataSize += computeStringSizeNoTag(inputUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputUrisList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dataSchema_); + } + 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.v2alpha.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GcsSource other = + (com.google.cloud.retail.v2alpha.GcsSource) obj; + + if (!getInputUrisList().equals(other.getInputUrisList())) return false; + if (!getDataSchema().equals(other.getDataSchema())) 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 (getInputUrisCount() > 0) { + hash = (37 * hash) + INPUT_URIS_FIELD_NUMBER; + hash = (53 * hash) + getInputUrisList().hashCode(); + } + hash = (37 * hash) + DATA_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDataSchema().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.GcsSource 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; + } + /** + * + * + *
+   * Google Cloud Storage location for input content.
+   * format.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GcsSource) + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GcsSource.class, + com.google.cloud.retail.v2alpha.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GcsSource.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(); + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + dataSchema_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource build() { + com.google.cloud.retail.v2alpha.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource buildPartial() { + com.google.cloud.retail.v2alpha.GcsSource result = + new com.google.cloud.retail.v2alpha.GcsSource(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + inputUris_ = inputUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputUris_ = inputUris_; + result.dataSchema_ = dataSchema_; + 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.v2alpha.GcsSource) { + return mergeFrom((com.google.cloud.retail.v2alpha.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GcsSource other) { + if (other == com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance()) return this; + if (!other.inputUris_.isEmpty()) { + if (inputUris_.isEmpty()) { + inputUris_ = other.inputUris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputUrisIsMutable(); + inputUris_.addAll(other.inputUris_); + } + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + 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.v2alpha.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList inputUris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInputUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(inputUris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The inputUris to set. + * @return This builder for chaining. + */ + public Builder setInputUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The inputUris to add. + * @return This builder for chaining. + */ + public Builder addAllInputUris(java.lang.Iterable values) { + ensureInputUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputUris_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUris() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2alpha.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataSchema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2alpha.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2alpha.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @param value The dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataSchema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2alpha.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + + dataSchema_ = getDefaultInstance().getDataSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2alpha.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @param value The bytes for dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataSchema_ = 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.v2alpha.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GcsSource) + private static final com.google.cloud.retail.v2alpha.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GcsSource(); + } + + public static com.google.cloud.retail.v2alpha.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(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.v2alpha.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSourceOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSourceOrBuilder.java new file mode 100644 index 00000000..7dae0f66 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GcsSourceOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + java.util.List getInputUrisList(); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + int getInputUrisCount(); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + java.lang.String getInputUris(int index); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + com.google.protobuf.ByteString getInputUrisBytes(int index); + + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2alpha.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + java.lang.String getDataSchema(); + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2alpha.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2alpha.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequest.java new file mode 100644 index 00000000..eeedeb27 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequest.java @@ -0,0 +1,664 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.GetAttributesConfig][google.cloud.retail.v2alpha.CatalogService.GetAttributesConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetAttributesConfigRequest} + */ +public final class GetAttributesConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetAttributesConfigRequest) + GetAttributesConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAttributesConfigRequest.newBuilder() to construct. + private GetAttributesConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAttributesConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAttributesConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAttributesConfigRequest( + 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.class, + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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.v2alpha.GetAttributesConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest other = + (com.google.cloud.retail.v2alpha.GetAttributesConfigRequest) 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.v2alpha.GetAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest 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.GetAttributesConfig][google.cloud.retail.v2alpha.CatalogService.GetAttributesConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetAttributesConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetAttributesConfigRequest) + com.google.cloud.retail.v2alpha.GetAttributesConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.class, + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetAttributesConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetAttributesConfigRequest build() { + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetAttributesConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetAttributesConfigRequest result = + new com.google.cloud.retail.v2alpha.GetAttributesConfigRequest(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.v2alpha.GetAttributesConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetAttributesConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetAttributesConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetAttributesConfigRequest.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.v2alpha.GetAttributesConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetAttributesConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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.v2alpha.GetAttributesConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetAttributesConfigRequest) + private static final com.google.cloud.retail.v2alpha.GetAttributesConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetAttributesConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetAttributesConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAttributesConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAttributesConfigRequest(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.v2alpha.GetAttributesConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequestOrBuilder.java new file mode 100644 index 00000000..7c6720a6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetAttributesConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetAttributesConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetAttributesConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequest.java new file mode 100644 index 00000000..46fc99d2 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequest.java @@ -0,0 +1,664 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.GetCompletionConfig][google.cloud.retail.v2alpha.CatalogService.GetCompletionConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetCompletionConfigRequest} + */ +public final class GetCompletionConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetCompletionConfigRequest) + GetCompletionConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCompletionConfigRequest.newBuilder() to construct. + private GetCompletionConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCompletionConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCompletionConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetCompletionConfigRequest( + 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.class, + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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.v2alpha.GetCompletionConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest other = + (com.google.cloud.retail.v2alpha.GetCompletionConfigRequest) 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.v2alpha.GetCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest 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.GetCompletionConfig][google.cloud.retail.v2alpha.CatalogService.GetCompletionConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetCompletionConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetCompletionConfigRequest) + com.google.cloud.retail.v2alpha.GetCompletionConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.class, + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetCompletionConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetCompletionConfigRequest build() { + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetCompletionConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetCompletionConfigRequest result = + new com.google.cloud.retail.v2alpha.GetCompletionConfigRequest(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.v2alpha.GetCompletionConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetCompletionConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetCompletionConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetCompletionConfigRequest.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.v2alpha.GetCompletionConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetCompletionConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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.v2alpha.GetCompletionConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetCompletionConfigRequest) + private static final com.google.cloud.retail.v2alpha.GetCompletionConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetCompletionConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetCompletionConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCompletionConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCompletionConfigRequest(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.v2alpha.GetCompletionConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequestOrBuilder.java new file mode 100644 index 00000000..9e07c185 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetCompletionConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetCompletionConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetCompletionConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequest.java new file mode 100644 index 00000000..79ec2992 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequest.java @@ -0,0 +1,659 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for GetControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetControlRequest} + */ +public final class GetControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetControlRequest) + GetControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetControlRequest.newBuilder() to construct. + private GetControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetControlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetControlRequest( + 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_GetControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_GetControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetControlRequest.class, + com.google.cloud.retail.v2alpha.GetControlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.v2alpha.GetControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetControlRequest other = + (com.google.cloud.retail.v2alpha.GetControlRequest) 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.v2alpha.GetControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.GetControlRequest 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 GetControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetControlRequest) + com.google.cloud.retail.v2alpha.GetControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_GetControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_GetControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetControlRequest.class, + com.google.cloud.retail.v2alpha.GetControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetControlRequest.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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_GetControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetControlRequest build() { + com.google.cloud.retail.v2alpha.GetControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetControlRequest result = + new com.google.cloud.retail.v2alpha.GetControlRequest(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.v2alpha.GetControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetControlRequest.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.v2alpha.GetControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.v2alpha.GetControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetControlRequest) + private static final com.google.cloud.retail.v2alpha.GetControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetControlRequest(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.v2alpha.GetControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequestOrBuilder.java new file mode 100644 index 00000000..531f9b34 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetControlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequest.java new file mode 100644 index 00000000..c0bc9502 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequest.java @@ -0,0 +1,646 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message to show which branch is currently the default branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetDefaultBranchRequest} + */ +public final class GetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetDefaultBranchRequest) + GetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchRequest.newBuilder() to construct. + private GetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchRequest() { + catalog_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchRequest( + 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(); + + catalog_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + 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.v2alpha.GetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest other = + (com.google.cloud.retail.v2alpha.GetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to show which branch is currently the default branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetDefaultBranchRequest) + com.google.cloud.retail.v2alpha.GetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.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(); + catalog_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchRequest build() { + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetDefaultBranchRequest result = + new com.google.cloud.retail.v2alpha.GetDefaultBranchRequest(this); + result.catalog_ = catalog_; + 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.v2alpha.GetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + 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.v2alpha.GetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.GetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetDefaultBranchRequest) + private static final com.google.cloud.retail.v2alpha.GetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchRequest(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.v2alpha.GetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..a043bb3e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponse.java new file mode 100644 index 00000000..31447796 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponse.java @@ -0,0 +1,1102 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response message of
+ * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetDefaultBranchResponse} + */ +public final class GetDefaultBranchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetDefaultBranchResponse) + GetDefaultBranchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchResponse.newBuilder() to construct. + private GetDefaultBranchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchResponse() { + branch_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchResponse( + 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(); + + branch_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.Builder.class); + } + + public static final int BRANCH_FIELD_NUMBER = 1; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + 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(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SET_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + 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(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = 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(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, branch_); + } + if (setTime_ != null) { + output.writeMessage(2, getSetTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + 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(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, branch_); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + 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.v2alpha.GetDefaultBranchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse other = + (com.google.cloud.retail.v2alpha.GetDefaultBranchResponse) obj; + + if (!getBranch().equals(other.getBranch())) return false; + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (!getNote().equals(other.getNote())) 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) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse 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 message of
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetDefaultBranchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetDefaultBranchResponse) + com.google.cloud.retail.v2alpha.GetDefaultBranchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.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(); + branch_ = ""; + + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + note_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchResponse build() { + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetDefaultBranchResponse buildPartial() { + com.google.cloud.retail.v2alpha.GetDefaultBranchResponse result = + new com.google.cloud.retail.v2alpha.GetDefaultBranchResponse(this); + result.branch_ = branch_; + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.note_ = note_; + 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.v2alpha.GetDefaultBranchResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetDefaultBranchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetDefaultBranchResponse other) { + if (other == com.google.cloud.retail.v2alpha.GetDefaultBranchResponse.getDefaultInstance()) + return this; + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + 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.v2alpha.GetDefaultBranchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetDefaultBranchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = 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.v2alpha.GetDefaultBranchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetDefaultBranchResponse) + private static final com.google.cloud.retail.v2alpha.GetDefaultBranchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); + } + + public static com.google.cloud.retail.v2alpha.GetDefaultBranchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchResponse(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.v2alpha.GetDefaultBranchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponseOrBuilder.java new file mode 100644 index 00000000..3df3c0fb --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetDefaultBranchResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetDefaultBranchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetDefaultBranchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequest.java new file mode 100644 index 00000000..af949f2b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequest.java @@ -0,0 +1,701 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [GetProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetProductRequest} + */ +public final class GetProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetProductRequest) + GetProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProductRequest.newBuilder() to construct. + private GetProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProductRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProductRequest( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetProductRequest.class, + com.google.cloud.retail.v2alpha.GetProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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.v2alpha.GetProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetProductRequest other = + (com.google.cloud.retail.v2alpha.GetProductRequest) 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.v2alpha.GetProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.GetProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetProductRequest) + com.google.cloud.retail.v2alpha.GetProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetProductRequest.class, + com.google.cloud.retail.v2alpha.GetProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetProductRequest.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetProductRequest build() { + com.google.cloud.retail.v2alpha.GetProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetProductRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetProductRequest result = + new com.google.cloud.retail.v2alpha.GetProductRequest(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.v2alpha.GetProductRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetProductRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetProductRequest.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.v2alpha.GetProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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.v2alpha.GetProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetProductRequest) + private static final com.google.cloud.retail.v2alpha.GetProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetProductRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProductRequest(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.v2alpha.GetProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequestOrBuilder.java new file mode 100644 index 00000000..446423df --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetProductRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2alpha.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequest.java new file mode 100644 index 00000000..c4274f3f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequest.java @@ -0,0 +1,660 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for GetServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetServingConfigRequest} + */ +public final class GetServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.GetServingConfigRequest) + GetServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServingConfigRequest.newBuilder() to construct. + private GetServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServingConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServingConfigRequest( + 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetServingConfigRequest.class, + com.google.cloud.retail.v2alpha.GetServingConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @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.v2alpha.GetServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.GetServingConfigRequest other = + (com.google.cloud.retail.v2alpha.GetServingConfigRequest) 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.v2alpha.GetServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.GetServingConfigRequest 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 GetServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.GetServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.GetServingConfigRequest) + com.google.cloud.retail.v2alpha.GetServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.GetServingConfigRequest.class, + com.google.cloud.retail.v2alpha.GetServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.GetServingConfigRequest.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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.GetServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetServingConfigRequest build() { + com.google.cloud.retail.v2alpha.GetServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.GetServingConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.GetServingConfigRequest result = + new com.google.cloud.retail.v2alpha.GetServingConfigRequest(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.v2alpha.GetServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.GetServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.GetServingConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.GetServingConfigRequest.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.v2alpha.GetServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.GetServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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.v2alpha.GetServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.GetServingConfigRequest) + private static final com.google.cloud.retail.v2alpha.GetServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.GetServingConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.GetServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServingConfigRequest(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.v2alpha.GetServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..604b7bb2 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/GetServingConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface GetServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.GetServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @return The name. + */ + 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}
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Image.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Image.java new file mode 100644 index 00000000..4bcc0031 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Image.java @@ -0,0 +1,871 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * [Product][google.cloud.retail.v2alpha.Product] image. Recommendations AI and
+ * Retail Search do not use product images to improve prediction and search
+ * results. However, product images can be returned in results, and are shown in
+ * prediction or search previews in the console.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Image} + */ +public final class Image extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Image() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Image(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Image( + 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(); + + uri_ = s; + break; + } + case 16: + { + height_ = input.readInt32(); + break; + } + case 24: + { + width_ = input.readInt32(); + 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Image.class, + com.google.cloud.retail.v2alpha.Image.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private int height_; + /** + * + * + *
+   * Height of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 height = 2; + * + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 3; + private int width_; + /** + * + * + *
+   * Width of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 width = 3; + * + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + + 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(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (height_ != 0) { + output.writeInt32(2, height_); + } + if (width_ != 0) { + output.writeInt32(3, width_); + } + 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(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, height_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, width_); + } + 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.v2alpha.Image)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Image other = (com.google.cloud.retail.v2alpha.Image) obj; + + if (!getUri().equals(other.getUri())) return false; + if (getHeight() != other.getHeight()) return false; + if (getWidth() != other.getWidth()) 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Image parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Image 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; + } + /** + * + * + *
+   * [Product][google.cloud.retail.v2alpha.Product] image. Recommendations AI and
+   * Retail Search do not use product images to improve prediction and search
+   * results. However, product images can be returned in results, and are shown in
+   * prediction or search previews in the console.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Image} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Image) + com.google.cloud.retail.v2alpha.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Image.class, + com.google.cloud.retail.v2alpha.Image.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Image.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(); + uri_ = ""; + + height_ = 0; + + width_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Image_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Image getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Image.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Image build() { + com.google.cloud.retail.v2alpha.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Image buildPartial() { + com.google.cloud.retail.v2alpha.Image result = + new com.google.cloud.retail.v2alpha.Image(this); + result.uri_ = uri_; + result.height_ = height_; + result.width_ = width_; + 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.v2alpha.Image) { + return mergeFrom((com.google.cloud.retail.v2alpha.Image) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Image other) { + if (other == com.google.cloud.retail.v2alpha.Image.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + 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.v2alpha.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int height_; + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + + height_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @return This builder for chaining. + */ + public Builder clearHeight() { + + height_ = 0; + onChanged(); + return this; + } + + private int width_; + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @return This builder for chaining. + */ + public Builder clearWidth() { + + width_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Image) + private static final com.google.cloud.retail.v2alpha.Image DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Image(); + } + + public static com.google.cloud.retail.v2alpha.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(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.v2alpha.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImageOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImageOrBuilder.java new file mode 100644 index 00000000..03a2a1cc --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImageOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Image) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Height of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 height = 2; + * + * @return The height. + */ + int getHeight(); + + /** + * + * + *
+   * Width of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 width = 3; + * + * @return The width. + */ + int getWidth(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequest.java new file mode 100644 index 00000000..fc5408e6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequest.java @@ -0,0 +1,1174 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for ImportCompletionData methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportCompletionDataRequest} + */ +public final class ImportCompletionDataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportCompletionDataRequest) + ImportCompletionDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataRequest.newBuilder() to construct. + private ImportCompletionDataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataRequest() { + parent_ = ""; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataRequest( + 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.v2alpha.CompletionDataInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * 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 INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.CompletionDataInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 3; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, notificationPubsubTopic_); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, notificationPubsubTopic_); + } + 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.v2alpha.ImportCompletionDataRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest other = + (com.google.cloud.retail.v2alpha.ImportCompletionDataRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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 (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ImportCompletionData methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportCompletionDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportCompletionDataRequest) + com.google.cloud.retail.v2alpha.ImportCompletionDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.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 (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataRequest build() { + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataRequest buildPartial() { + com.google.cloud.retail.v2alpha.ImportCompletionDataRequest result = + new com.google.cloud.retail.v2alpha.ImportCompletionDataRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.v2alpha.ImportCompletionDataRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportCompletionDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportCompletionDataRequest other) { + if (other == com.google.cloud.retail.v2alpha.ImportCompletionDataRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.v2alpha.ImportCompletionDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportCompletionDataRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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.v2alpha.CompletionDataInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig( + com.google.cloud.retail.v2alpha.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder + getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder + getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDataInputConfig, + com.google.cloud.retail.v2alpha.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.v2alpha.ImportCompletionDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportCompletionDataRequest) + private static final com.google.cloud.retail.v2alpha.ImportCompletionDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataRequest(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.v2alpha.ImportCompletionDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequestOrBuilder.java new file mode 100644 index 00000000..0583edd1 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportCompletionDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportCompletionDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.CompletionDataInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponse.java new file mode 100644 index 00000000..1cf4975b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponse.java @@ -0,0 +1,948 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the
+ * [ImportCompletionDataRequest][google.cloud.retail.v2alpha.ImportCompletionDataRequest].
+ * If the long running operation is done, this message is returned by the
+ * google.longrunning.Operations.response field if the operation is successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportCompletionDataResponse} + */ +public final class ImportCompletionDataResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportCompletionDataResponse) + ImportCompletionDataResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataResponse.newBuilder() to construct. + private ImportCompletionDataResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.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)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + 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.v2alpha.ImportCompletionDataResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse other = + (com.google.cloud.retail.v2alpha.ImportCompletionDataResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse 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
+   * [ImportCompletionDataRequest][google.cloud.retail.v2alpha.ImportCompletionDataRequest].
+   * If the long running operation is done, this message is returned by the
+   * google.longrunning.Operations.response field if the operation is successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportCompletionDataResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportCompletionDataResponse) + com.google.cloud.retail.v2alpha.ImportCompletionDataResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataResponse build() { + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportCompletionDataResponse buildPartial() { + com.google.cloud.retail.v2alpha.ImportCompletionDataResponse result = + new com.google.cloud.retail.v2alpha.ImportCompletionDataResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.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.v2alpha.ImportCompletionDataResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportCompletionDataResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportCompletionDataResponse other) { + if (other + == com.google.cloud.retail.v2alpha.ImportCompletionDataResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + 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.v2alpha.ImportCompletionDataResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportCompletionDataResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ImportCompletionDataResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportCompletionDataResponse) + private static final com.google.cloud.retail.v2alpha.ImportCompletionDataResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); + } + + public static com.google.cloud.retail.v2alpha.ImportCompletionDataResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataResponse(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.v2alpha.ImportCompletionDataResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponseOrBuilder.java new file mode 100644 index 00000000..4c68bfc3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportCompletionDataResponseOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportCompletionDataResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportCompletionDataResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportConfigProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportConfigProto.java new file mode 100644 index 00000000..2c5b49e7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportConfigProto.java @@ -0,0 +1,365 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public final class ImportConfigProto { + private ImportConfigProto() {} + + 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_v2alpha_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_BigQuerySource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ProductInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ProductInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_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/v2alpha/import_con" + + "fig.proto\022\033google.cloud.retail.v2alpha\032\037" + + "google/api/field_behavior.proto\032\031google/" + + "api/resource.proto\032)google/cloud/retail/" + + "v2alpha/product.proto\032,google/cloud/reta" + + "il/v2alpha/user_event.proto\032 google/prot" + + "obuf/field_mask.proto\032\037google/protobuf/t" + + "imestamp.proto\032\027google/rpc/status.proto\032" + + "\026google/type/date.proto\"9\n\tGcsSource\022\027\n\n" + + "input_uris\030\001 \003(\tB\003\340A\002\022\023\n\013data_schema\030\002 \001" + + "(\t\"\274\001\n\016BigQuerySource\022+\n\016partition_date\030" + + "\006 \001(\0132\021.google.type.DateH\000\022\022\n\nproject_id" + + "\030\005 \001(\t\022\027\n\ndataset_id\030\001 \001(\tB\003\340A\002\022\025\n\010table" + + "_id\030\002 \001(\tB\003\340A\002\022\027\n\017gcs_staging_dir\030\003 \001(\t\022" + + "\023\n\013data_schema\030\004 \001(\tB\013\n\tpartition\"R\n\023Pro" + + "ductInlineSource\022;\n\010products\030\001 \003(\0132$.goo" + + "gle.cloud.retail.v2alpha.ProductB\003\340A\002\"Y\n" + + "\025UserEventInlineSource\022@\n\013user_events\030\001 " + + "\003(\0132&.google.cloud.retail.v2alpha.UserEv" + + "entB\003\340A\002\"9\n\022ImportErrorsConfig\022\024\n\ngcs_pr" + + "efix\030\001 \001(\tH\000B\r\n\013destination\"\207\004\n\025ImportPr" + + "oductsRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034r" + + "etail.googleapis.com/Branch\022\026\n\nrequest_i" + + "d\030\006 \001(\tB\002\030\001\022J\n\014input_config\030\002 \001(\0132/.goog" + + "le.cloud.retail.v2alpha.ProductInputConf" + + "igB\003\340A\002\022F\n\rerrors_config\030\003 \001(\0132/.google." + + "cloud.retail.v2alpha.ImportErrorsConfig\022" + + "/\n\013update_mask\030\004 \001(\0132\032.google.protobuf.F" + + "ieldMask\022b\n\023reconciliation_mode\030\005 \001(\0162E." + + "google.cloud.retail.v2alpha.ImportProduc" + + "tsRequest.ReconciliationMode\022!\n\031notifica" + + "tion_pubsub_topic\030\007 \001(\t\"T\n\022Reconciliatio" + + "nMode\022#\n\037RECONCILIATION_MODE_UNSPECIFIED" + + "\020\000\022\017\n\013INCREMENTAL\020\001\022\010\n\004FULL\020\002\"\346\001\n\027Import" + + "UserEventsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A" + + "\037\n\035retail.googleapis.com/Catalog\022L\n\014inpu" + + "t_config\030\002 \001(\01321.google.cloud.retail.v2a" + + "lpha.UserEventInputConfigB\003\340A\002\022F\n\rerrors" + + "_config\030\003 \001(\0132/.google.cloud.retail.v2al" + + "pha.ImportErrorsConfig\"\312\001\n\033ImportComplet" + + "ionDataRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035" + + "retail.googleapis.com/Catalog\022Q\n\014input_c" + + "onfig\030\002 \001(\01326.google.cloud.retail.v2alph" + + "a.CompletionDataInputConfigB\003\340A\002\022!\n\031noti" + + "fication_pubsub_topic\030\003 \001(\t\"\370\001\n\022ProductI" + + "nputConfig\022Q\n\025product_inline_source\030\001 \001(" + + "\01320.google.cloud.retail.v2alpha.ProductI" + + "nlineSourceH\000\022<\n\ngcs_source\030\002 \001(\0132&.goog" + + "le.cloud.retail.v2alpha.GcsSourceH\000\022G\n\020b" + + "ig_query_source\030\003 \001(\0132+.google.cloud.ret" + + "ail.v2alpha.BigQuerySourceH\000B\010\n\006source\"\216" + + "\002\n\024UserEventInputConfig\022[\n\030user_event_in" + + "line_source\030\001 \001(\01322.google.cloud.retail." + + "v2alpha.UserEventInlineSourceB\003\340A\002H\000\022A\n\n" + + "gcs_source\030\002 \001(\0132&.google.cloud.retail.v" + + "2alpha.GcsSourceB\003\340A\002H\000\022L\n\020big_query_sou" + + "rce\030\003 \001(\0132+.google.cloud.retail.v2alpha." + + "BigQuerySourceB\003\340A\002H\000B\010\n\006source\"s\n\031Compl" + + "etionDataInputConfig\022L\n\020big_query_source" + + "\030\001 \001(\0132+.google.cloud.retail.v2alpha.Big" + + "QuerySourceB\003\340A\002H\000B\010\n\006source\"\333\001\n\016ImportM" + + "etadata\022/\n\013create_time\030\001 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022/\n\013update_time\030\002 \001(\0132\032." + + "google.protobuf.Timestamp\022\025\n\rsuccess_cou" + + "nt\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001(\003\022\026\n\nreque" + + "st_id\030\005 \001(\tB\002\030\001\022!\n\031notification_pubsub_t" + + "opic\030\006 \001(\t\"\213\001\n\026ImportProductsResponse\022)\n" + + "\rerror_samples\030\001 \003(\0132\022.google.rpc.Status" + + "\022F\n\rerrors_config\030\002 \001(\0132/.google.cloud.r" + + "etail.v2alpha.ImportErrorsConfig\"\332\001\n\030Imp" + + "ortUserEventsResponse\022)\n\rerror_samples\030\001" + + " \003(\0132\022.google.rpc.Status\022F\n\rerrors_confi" + + "g\030\002 \001(\0132/.google.cloud.retail.v2alpha.Im" + + "portErrorsConfig\022K\n\016import_summary\030\003 \001(\013" + + "23.google.cloud.retail.v2alpha.UserEvent" + + "ImportSummary\"T\n\026UserEventImportSummary\022" + + "\033\n\023joined_events_count\030\001 \001(\003\022\035\n\025unjoined" + + "_events_count\030\002 \001(\003\"I\n\034ImportCompletionD" + + "ataResponse\022)\n\rerror_samples\030\001 \003(\0132\022.goo" + + "gle.rpc.StatusB\337\001\n\037com.google.cloud.reta" + + "il.v2alphaB\021ImportConfigProtoP\001ZAgoogle." + + "golang.org/genproto/googleapis/cloud/ret" + + "ail/v2alpha;retail\242\002\006RETAIL\252\002\033Google.Clo" + + "ud.Retail.V2Alpha\312\002\033Google\\Cloud\\Retail\\" + + "V2alpha\352\002\036Google::Cloud::Retail::V2alpha" + + "b\006proto3" + }; + 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.v2alpha.ProductProto.getDescriptor(), + com.google.cloud.retail.v2alpha.UserEventProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GcsSource_descriptor, + new java.lang.String[] { + "InputUris", "DataSchema", + }); + internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_BigQuerySource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_BigQuerySource_descriptor, + new java.lang.String[] { + "PartitionDate", + "ProjectId", + "DatasetId", + "TableId", + "GcsStagingDir", + "DataSchema", + "Partition", + }); + internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_ProductInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor, + new java.lang.String[] { + "Products", + }); + internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor, + new java.lang.String[] { + "UserEvents", + }); + internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor, + new java.lang.String[] { + "Parent", + "RequestId", + "InputConfig", + "ErrorsConfig", + "UpdateMask", + "ReconciliationMode", + "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "InputConfig", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataRequest_descriptor, + new java.lang.String[] { + "Parent", "InputConfig", "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2alpha_ProductInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor, + new java.lang.String[] { + "ProductInlineSource", "GcsSource", "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor, + new java.lang.String[] { + "UserEventInlineSource", "GcsSource", "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompletionDataInputConfig_descriptor, + new java.lang.String[] { + "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2alpha_ImportMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "UpdateTime", + "SuccessCount", + "FailureCount", + "RequestId", + "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", "ImportSummary", + }); + internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor, + new java.lang.String[] { + "JoinedEventsCount", "UnjoinedEventsCount", + }); + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ImportCompletionDataResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(); + com.google.cloud.retail.v2alpha.UserEventProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfig.java new file mode 100644 index 00000000..8988ba78 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfig.java @@ -0,0 +1,795 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Configuration of destination for Import related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportErrorsConfig} + */ +public final class ImportErrorsConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportErrorsConfig) + ImportErrorsConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportErrorsConfig.newBuilder() to construct. + private ImportErrorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportErrorsConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportErrorsConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportErrorsConfig( + 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(); + destinationCase_ = 1; + destination_ = 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.class, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + 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(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = 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 (destinationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + 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.v2alpha.ImportErrorsConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportErrorsConfig other = + (com.google.cloud.retail.v2alpha.ImportErrorsConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 0: + default: + } + 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(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ImportErrorsConfig 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; + } + /** + * + * + *
+   * Configuration of destination for Import related errors.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportErrorsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportErrorsConfig) + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.class, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportErrorsConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig build() { + com.google.cloud.retail.v2alpha.ImportErrorsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig buildPartial() { + com.google.cloud.retail.v2alpha.ImportErrorsConfig result = + new com.google.cloud.retail.v2alpha.ImportErrorsConfig(this); + if (destinationCase_ == 1) { + result.destination_ = destination_; + } + result.destinationCase_ = destinationCase_; + 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.v2alpha.ImportErrorsConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportErrorsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportErrorsConfig other) { + if (other == com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + 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.v2alpha.ImportErrorsConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportErrorsConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationCase_ = 1; + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The bytes for gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationCase_ = 1; + destination_ = 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.v2alpha.ImportErrorsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportErrorsConfig) + private static final com.google.cloud.retail.v2alpha.ImportErrorsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportErrorsConfig(); + } + + public static com.google.cloud.retail.v2alpha.ImportErrorsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportErrorsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportErrorsConfig(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.v2alpha.ImportErrorsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfigOrBuilder.java new file mode 100644 index 00000000..e7ac9ef6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportErrorsConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportErrorsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportErrorsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + 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
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + public com.google.cloud.retail.v2alpha.ImportErrorsConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadata.java new file mode 100644 index 00000000..65e03a72 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadata.java @@ -0,0 +1,1602 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the Import operation. This will be
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportMetadata} + */ +public final class ImportMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportMetadata) + ImportMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportMetadata.newBuilder() to construct. + private ImportMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportMetadata() { + requestId_ = ""; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportMetadata( + 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.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 18: + { + 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 24: + { + successCount_ = input.readInt64(); + break; + } + case 32: + { + failureCount_ = input.readInt64(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportMetadata.class, + com.google.cloud.retail.v2alpha.ImportMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_; + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + + public static final int FAILURE_COUNT_FIELD_NUMBER = 4; + private long failureCount_; + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The bytes for requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 6; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(2, getUpdateTime()); + } + if (successCount_ != 0L) { + output.writeInt64(3, successCount_); + } + if (failureCount_ != 0L) { + output.writeInt64(4, failureCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, notificationPubsubTopic_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateTime()); + } + if (successCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, successCount_); + } + if (failureCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, failureCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, notificationPubsubTopic_); + } + 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.v2alpha.ImportMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportMetadata other = + (com.google.cloud.retail.v2alpha.ImportMetadata) obj; + + 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 (getSuccessCount() != other.getSuccessCount()) return false; + if (getFailureCount() != other.getFailureCount()) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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 (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) + SUCCESS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSuccessCount()); + hash = (37 * hash) + FAILURE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailureCount()); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ImportMetadata 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 related to the progress of the Import operation. This will be
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportMetadata) + com.google.cloud.retail.v2alpha.ImportMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportMetadata.class, + com.google.cloud.retail.v2alpha.ImportMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + successCount_ = 0L; + + failureCount_ = 0L; + + requestId_ = ""; + + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportMetadata build() { + com.google.cloud.retail.v2alpha.ImportMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportMetadata buildPartial() { + com.google.cloud.retail.v2alpha.ImportMetadata result = + new com.google.cloud.retail.v2alpha.ImportMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.successCount_ = successCount_; + result.failureCount_ = failureCount_; + result.requestId_ = requestId_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.v2alpha.ImportMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportMetadata other) { + if (other == com.google.cloud.retail.v2alpha.ImportMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getSuccessCount() != 0L) { + setSuccessCount(other.getSuccessCount()); + } + if (other.getFailureCount() != 0L) { + setFailureCount(other.getFailureCount()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.v2alpha.ImportMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.ImportMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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 long successCount_; + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @param value The successCount to set. + * @return This builder for chaining. + */ + public Builder setSuccessCount(long value) { + + successCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + + successCount_ = 0L; + onChanged(); + return this; + } + + private long failureCount_; + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @param value The failureCount to set. + * @return This builder for chaining. + */ + public Builder setFailureCount(long value) { + + failureCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + + failureCount_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The requestId. + */ + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @param value The requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.v2alpha.ImportMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportMetadata) + private static final com.google.cloud.retail.v2alpha.ImportMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportMetadata(); + } + + public static com.google.cloud.retail.v2alpha.ImportMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportMetadata(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.v2alpha.ImportMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadataOrBuilder.java new file mode 100644 index 00000000..f17db456 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportMetadataOrBuilder.java @@ -0,0 +1,188 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + long getSuccessCount(); + + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + long getFailureCount(); + + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The requestId. + */ + @java.lang.Deprecated + java.lang.String getRequestId(); + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * string request_id = 5 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportMetadata.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=341 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequest.java new file mode 100644 index 00000000..4dda3def --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequest.java @@ -0,0 +1,2342 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for Import methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportProductsRequest} + */ +public final class ImportProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportProductsRequest) + ImportProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportProductsRequest.newBuilder() to construct. + private ImportProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportProductsRequest() { + parent_ = ""; + requestId_ = ""; + reconciliationMode_ = 0; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportProductsRequest( + 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.v2alpha.ProductInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ProductInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + 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; + } + case 40: + { + int rawValue = input.readEnum(); + + reconciliationMode_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportProductsRequest.class, + com.google.cloud.retail.v2alpha.ImportProductsRequest.Builder.class); + } + + /** + * + * + *
+   * Indicates how imported products are reconciled with the existing products
+   * created or imported before.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} + */ + public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + RECONCILIATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + INCREMENTAL(1), + /** + * + * + *
+     * 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.v2alpha.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; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + public static final int RECONCILIATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + public static final int INCREMENTAL_VALUE = 1; + /** + * + * + *
+     * 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.v2alpha.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; + */ + public static final int FULL_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 ReconciliationMode 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 ReconciliationMode forNumber(int value) { + switch (value) { + case 0: + return RECONCILIATION_MODE_UNSPECIFIED; + case 1: + return INCREMENTAL; + case 2: + return FULL; + 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 ReconciliationMode findValueByNumber(int number) { + return ReconciliationMode.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.v2alpha.ImportProductsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ReconciliationMode[] VALUES = values(); + + public static ReconciliationMode 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 ReconciliationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode) + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * 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.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * 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 REQUEST_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The bytes for requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ProductInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int RECONCILIATION_MODE_FIELD_NUMBER = 5; + private int reconciliationMode_; + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 7; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(3, getErrorsConfig()); + } + if (updateMask_ != null) { + output.writeMessage(4, getUpdateMask()); + } + if (reconciliationMode_ + != com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, reconciliationMode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, notificationPubsubTopic_); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getErrorsConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + if (reconciliationMode_ + != com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, reconciliationMode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, notificationPubsubTopic_); + } + 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.v2alpha.ImportProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportProductsRequest other = + (com.google.cloud.retail.v2alpha.ImportProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (reconciliationMode_ != other.reconciliationMode_) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + RECONCILIATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + reconciliationMode_; + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Import methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportProductsRequest) + com.google.cloud.retail.v2alpha.ImportProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportProductsRequest.class, + com.google.cloud.retail.v2alpha.ImportProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportProductsRequest.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_ = ""; + + requestId_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + reconciliationMode_ = 0; + + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsRequest build() { + com.google.cloud.retail.v2alpha.ImportProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ImportProductsRequest result = + new com.google.cloud.retail.v2alpha.ImportProductsRequest(this); + result.parent_ = parent_; + result.requestId_ = requestId_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.reconciliationMode_ = reconciliationMode_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.v2alpha.ImportProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportProductsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ImportProductsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.reconciliationMode_ != 0) { + setReconciliationModeValue(other.getReconciliationModeValue()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.v2alpha.ImportProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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 java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The requestId. + */ + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @param value The requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.ProductInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInputConfig, + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder, + com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2alpha.ProductInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2alpha.ProductInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.cloud.retail.v2alpha.ProductInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2alpha.ProductInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInputConfig, + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder, + com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInputConfig, + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder, + com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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_; + } + + private int reconciliationMode_ = 0; + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The enum numeric value on the wire for reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationModeValue(int value) { + + reconciliationMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationMode( + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode value) { + if (value == null) { + throw new NullPointerException(); + } + + reconciliationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearReconciliationMode() { + + reconciliationMode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.v2alpha.ImportProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportProductsRequest) + private static final com.google.cloud.retail.v2alpha.ImportProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportProductsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductsRequest(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.v2alpha.ImportProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequestOrBuilder.java new file mode 100644 index 00000000..fa523086 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsRequestOrBuilder.java @@ -0,0 +1,277 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The requestId. + */ + @java.lang.Deprecated + java.lang.String getRequestId(); + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * string request_id = 6 [deprecated = true]; + * + * @deprecated google.cloud.retail.v2alpha.ImportProductsRequest.request_id is deprecated. See + * google/cloud/retail/v2alpha/import_config.proto;l=202 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2alpha.ProductInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + int getReconciliationModeValue(); + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + com.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode getReconciliationMode(); + + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponse.java new file mode 100644 index 00000000..b72174a3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponse.java @@ -0,0 +1,1224 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the
+ * [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest].
+ * If the long running operation is done, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportProductsResponse} + */ +public final class ImportProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportProductsResponse) + ImportProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportProductsResponse.newBuilder() to construct. + private ImportProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportProductsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportProductsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportProductsResponse.class, + com.google.cloud.retail.v2alpha.ImportProductsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.v2alpha.ImportProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportProductsResponse other = + (com.google.cloud.retail.v2alpha.ImportProductsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportProductsResponse 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
+   * [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest].
+   * If the long running operation is done, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportProductsResponse) + com.google.cloud.retail.v2alpha.ImportProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportProductsResponse.class, + com.google.cloud.retail.v2alpha.ImportProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsResponse build() { + com.google.cloud.retail.v2alpha.ImportProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportProductsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ImportProductsResponse result = + new com.google.cloud.retail.v2alpha.ImportProductsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.v2alpha.ImportProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportProductsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ImportProductsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.v2alpha.ImportProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ImportProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportProductsResponse) + private static final com.google.cloud.retail.v2alpha.ImportProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportProductsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ImportProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductsResponse(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.v2alpha.ImportProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponseOrBuilder.java new file mode 100644 index 00000000..2bb85279 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportProductsResponseOrBuilder.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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequest.java new file mode 100644 index 00000000..de96b884 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequest.java @@ -0,0 +1,1247 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for the ImportUserEvents request.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportUserEventsRequest} + */ +public final class ImportUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportUserEventsRequest) + ImportUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsRequest.newBuilder() to construct. + private ImportUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsRequest( + 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.v2alpha.UserEventInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserEventInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest.class, + com.google.cloud.retail.v2alpha.ImportUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * 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 INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.UserEventInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(3, getErrorsConfig()); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getErrorsConfig()); + } + 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.v2alpha.ImportUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportUserEventsRequest other = + (com.google.cloud.retail.v2alpha.ImportUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the ImportUserEvents request.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportUserEventsRequest) + com.google.cloud.retail.v2alpha.ImportUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportUserEventsRequest.class, + com.google.cloud.retail.v2alpha.ImportUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportUserEventsRequest.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 (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsRequest build() { + com.google.cloud.retail.v2alpha.ImportUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ImportUserEventsRequest result = + new com.google.cloud.retail.v2alpha.ImportUserEventsRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.v2alpha.ImportUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportUserEventsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ImportUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.v2alpha.ImportUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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.v2alpha.UserEventInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInputConfig, + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder, + com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2alpha.UserEventInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2alpha.UserEventInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.cloud.retail.v2alpha.UserEventInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2alpha.UserEventInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2alpha.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInputConfig, + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder, + com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInputConfig, + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder, + com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ImportUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportUserEventsRequest) + private static final com.google.cloud.retail.v2alpha.ImportUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportUserEventsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsRequest(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.v2alpha.ImportUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..d884413a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2alpha.UserEventInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 3; + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponse.java new file mode 100644 index 00000000..8ac31264 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponse.java @@ -0,0 +1,1517 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the ImportUserEventsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportUserEventsResponse} + */ +public final class ImportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ImportUserEventsResponse) + ImportUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsResponse.newBuilder() to construct. + private ImportUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder subBuilder = null; + if (importSummary_ != null) { + subBuilder = importSummary_.toBuilder(); + } + importSummary_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserEventImportSummary.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(importSummary_); + importSummary_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportUserEventsResponse.class, + com.google.cloud.retail.v2alpha.ImportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + public static final int IMPORT_SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2alpha.UserEventImportSummary importSummary_; + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + @java.lang.Override + public boolean hasImportSummary() { + return importSummary_ != null; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventImportSummary getImportSummary() { + return importSummary_ == null + ? com.google.cloud.retail.v2alpha.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + return getImportSummary(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + if (importSummary_ != null) { + output.writeMessage(3, getImportSummary()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + if (importSummary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getImportSummary()); + } + 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.v2alpha.ImportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ImportUserEventsResponse other = + (com.google.cloud.retail.v2alpha.ImportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasImportSummary() != other.hasImportSummary()) return false; + if (hasImportSummary()) { + if (!getImportSummary().equals(other.getImportSummary())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasImportSummary()) { + hash = (37 * hash) + IMPORT_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getImportSummary().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ImportUserEventsResponse 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 ImportUserEventsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ImportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ImportUserEventsResponse) + com.google.cloud.retail.v2alpha.ImportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ImportUserEventsResponse.class, + com.google.cloud.retail.v2alpha.ImportUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ImportUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + if (importSummaryBuilder_ == null) { + importSummary_ = null; + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ImportUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsResponse build() { + com.google.cloud.retail.v2alpha.ImportUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImportUserEventsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ImportUserEventsResponse result = + new com.google.cloud.retail.v2alpha.ImportUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.build(); + } + if (importSummaryBuilder_ == null) { + result.importSummary_ = importSummary_; + } else { + result.importSummary_ = importSummaryBuilder_.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.v2alpha.ImportUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ImportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ImportUserEventsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ImportUserEventsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasImportSummary()) { + mergeImportSummary(other.getImportSummary()); + } + 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.v2alpha.ImportUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ImportUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2alpha.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2alpha.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ImportErrorsConfig, + com.google.cloud.retail.v2alpha.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + private com.google.cloud.retail.v2alpha.UserEventImportSummary importSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventImportSummary, + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder, + com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder> + importSummaryBuilder_; + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + public boolean hasImportSummary() { + return importSummaryBuilder_ != null || importSummary_ != null; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + public com.google.cloud.retail.v2alpha.UserEventImportSummary getImportSummary() { + if (importSummaryBuilder_ == null) { + return importSummary_ == null + ? com.google.cloud.retail.v2alpha.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } else { + return importSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public Builder setImportSummary(com.google.cloud.retail.v2alpha.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importSummary_ = value; + onChanged(); + } else { + importSummaryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public Builder setImportSummary( + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder builderForValue) { + if (importSummaryBuilder_ == null) { + importSummary_ = builderForValue.build(); + onChanged(); + } else { + importSummaryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public Builder mergeImportSummary( + com.google.cloud.retail.v2alpha.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (importSummary_ != null) { + importSummary_ = + com.google.cloud.retail.v2alpha.UserEventImportSummary.newBuilder(importSummary_) + .mergeFrom(value) + .buildPartial(); + } else { + importSummary_ = value; + } + onChanged(); + } else { + importSummaryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public Builder clearImportSummary() { + if (importSummaryBuilder_ == null) { + importSummary_ = null; + onChanged(); + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder + getImportSummaryBuilder() { + + onChanged(); + return getImportSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + public com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + if (importSummaryBuilder_ != null) { + return importSummaryBuilder_.getMessageOrBuilder(); + } else { + return importSummary_ == null + ? com.google.cloud.retail.v2alpha.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventImportSummary, + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder, + com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder> + getImportSummaryFieldBuilder() { + if (importSummaryBuilder_ == null) { + importSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventImportSummary, + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder, + com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder>( + getImportSummary(), getParentForChildren(), isClean()); + importSummary_ = null; + } + return importSummaryBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ImportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ImportUserEventsResponse) + private static final com.google.cloud.retail.v2alpha.ImportUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ImportUserEventsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ImportUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsResponse(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.v2alpha.ImportUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..96ad915e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ImportUserEventsResponseOrBuilder.java @@ -0,0 +1,149 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ImportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ImportUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2alpha.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2alpha.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + boolean hasImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + com.google.cloud.retail.v2alpha.UserEventImportSummary getImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserEventImportSummary import_summary = 3; + */ + com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder getImportSummaryOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Interval.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Interval.java new file mode 100644 index 00000000..74da6b24 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Interval.java @@ -0,0 +1,1161 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * A floating point interval.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Interval} + */ +public final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Interval) + IntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use Interval.newBuilder() to construct. + private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Interval() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Interval(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Interval( + 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 9: + { + min_ = input.readDouble(); + minCase_ = 1; + break; + } + case 17: + { + min_ = input.readDouble(); + minCase_ = 2; + break; + } + case 25: + { + max_ = input.readDouble(); + maxCase_ = 3; + break; + } + case 33: + { + max_ = input.readDouble(); + maxCase_ = 4; + 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Interval.class, + com.google.cloud.retail.v2alpha.Interval.Builder.class); + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public enum MinCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MINIMUM(1), + EXCLUSIVE_MINIMUM(2), + MIN_NOT_SET(0); + private final int value; + + private MinCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MinCase valueOf(int value) { + return forNumber(value); + } + + public static MinCase forNumber(int value) { + switch (value) { + case 1: + return MINIMUM; + case 2: + return EXCLUSIVE_MINIMUM; + case 0: + return MIN_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public enum MaxCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAXIMUM(3), + EXCLUSIVE_MAXIMUM(4), + MAX_NOT_SET(0); + private final int value; + + private MaxCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MaxCase valueOf(int value) { + return forNumber(value); + } + + public static MaxCase forNumber(int value) { + switch (value) { + case 3: + return MAXIMUM; + case 4: + return EXCLUSIVE_MAXIMUM; + case 0: + return MAX_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public static final int MINIMUM_FIELD_NUMBER = 1; + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + @java.lang.Override + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int EXCLUSIVE_MINIMUM_FIELD_NUMBER = 2; + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + @java.lang.Override + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int MAXIMUM_FIELD_NUMBER = 3; + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + @java.lang.Override + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + + public static final int EXCLUSIVE_MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + @java.lang.Override + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + + 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 (minCase_ == 1) { + output.writeDouble(1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + output.writeDouble(2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + output.writeDouble(3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + output.writeDouble(4, (double) ((java.lang.Double) max_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 4, (double) ((java.lang.Double) max_)); + } + 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.v2alpha.Interval)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Interval other = (com.google.cloud.retail.v2alpha.Interval) obj; + + if (!getMinCase().equals(other.getMinCase())) return false; + switch (minCase_) { + case 1: + if (java.lang.Double.doubleToLongBits(getMinimum()) + != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; + break; + case 2: + if (java.lang.Double.doubleToLongBits(getExclusiveMinimum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMinimum())) return false; + break; + case 0: + default: + } + if (!getMaxCase().equals(other.getMaxCase())) return false; + switch (maxCase_) { + case 3: + if (java.lang.Double.doubleToLongBits(getMaximum()) + != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; + break; + case 4: + if (java.lang.Double.doubleToLongBits(getExclusiveMaximum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMaximum())) return false; + break; + case 0: + default: + } + 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(); + switch (minCase_) { + case 1: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMinimum())); + break; + case 2: + hash = (37 * hash) + EXCLUSIVE_MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMinimum())); + break; + case 0: + default: + } + switch (maxCase_) { + case 3: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMaximum())); + break; + case 4: + hash = (37 * hash) + EXCLUSIVE_MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMaximum())); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Interval parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Interval parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Interval parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Interval 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; + } + /** + * + * + *
+   * A floating point interval.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Interval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Interval) + com.google.cloud.retail.v2alpha.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Interval.class, + com.google.cloud.retail.v2alpha.Interval.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Interval.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(); + minCase_ = 0; + min_ = null; + maxCase_ = 0; + max_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Interval_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval build() { + com.google.cloud.retail.v2alpha.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval buildPartial() { + com.google.cloud.retail.v2alpha.Interval result = + new com.google.cloud.retail.v2alpha.Interval(this); + if (minCase_ == 1) { + result.min_ = min_; + } + if (minCase_ == 2) { + result.min_ = min_; + } + if (maxCase_ == 3) { + result.max_ = max_; + } + if (maxCase_ == 4) { + result.max_ = max_; + } + result.minCase_ = minCase_; + result.maxCase_ = maxCase_; + 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.v2alpha.Interval) { + return mergeFrom((com.google.cloud.retail.v2alpha.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Interval other) { + if (other == com.google.cloud.retail.v2alpha.Interval.getDefaultInstance()) return this; + switch (other.getMinCase()) { + case MINIMUM: + { + setMinimum(other.getMinimum()); + break; + } + case EXCLUSIVE_MINIMUM: + { + setExclusiveMinimum(other.getExclusiveMinimum()); + break; + } + case MIN_NOT_SET: + { + break; + } + } + switch (other.getMaxCase()) { + case MAXIMUM: + { + setMaximum(other.getMaximum()); + break; + } + case EXCLUSIVE_MAXIMUM: + { + setExclusiveMaximum(other.getExclusiveMaximum()); + break; + } + case MAX_NOT_SET: + { + break; + } + } + 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.v2alpha.Interval parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Interval) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + public Builder clearMin() { + minCase_ = 0; + min_ = null; + onChanged(); + return this; + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public Builder clearMax() { + maxCase_ = 0; + max_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(double value) { + minCase_ = 1; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinimum() { + if (minCase_ == 1) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @param value The exclusiveMinimum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMinimum(double value) { + minCase_ = 2; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMinimum() { + if (minCase_ == 2) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @param value The maximum to set. + * @return This builder for chaining. + */ + public Builder setMaximum(double value) { + maxCase_ = 3; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaximum() { + if (maxCase_ == 3) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @param value The exclusiveMaximum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMaximum(double value) { + maxCase_ = 4; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMaximum() { + if (maxCase_ == 4) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Interval) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Interval) + private static final com.google.cloud.retail.v2alpha.Interval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Interval(); + } + + public static com.google.cloud.retail.v2alpha.Interval getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interval parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Interval(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.v2alpha.Interval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/IntervalOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/IntervalOrBuilder.java new file mode 100644 index 00000000..f58a8638 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/IntervalOrBuilder.java @@ -0,0 +1,129 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Interval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + boolean hasMinimum(); + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + double getMinimum(); + + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + boolean hasExclusiveMinimum(); + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + double getExclusiveMinimum(); + + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + boolean hasMaximum(); + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + double getMaximum(); + + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + boolean hasExclusiveMaximum(); + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + double getExclusiveMaximum(); + + public com.google.cloud.retail.v2alpha.Interval.MinCase getMinCase(); + + public com.google.cloud.retail.v2alpha.Interval.MaxCase getMaxCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequest.java new file mode 100644 index 00000000..ad36d891 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequest.java @@ -0,0 +1,1021 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListCatalogsRequest} + */ +public final class ListCatalogsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListCatalogsRequest) + ListCatalogsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogsRequest.newBuilder() to construct. + private ListCatalogsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogsRequest( + 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListCatalogsRequest.class, + com.google.cloud.retail.v2alpha.ListCatalogsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * 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 account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to
+   * return. If unspecified, defaults to 50. The maximum allowed value is 1000.
+   * Values above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @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_; + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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.v2alpha.ListCatalogsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListCatalogsRequest other = + (com.google.cloud.retail.v2alpha.ListCatalogsRequest) 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.v2alpha.ListCatalogsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListCatalogsRequest 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.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListCatalogsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListCatalogsRequest) + com.google.cloud.retail.v2alpha.ListCatalogsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListCatalogsRequest.class, + com.google.cloud.retail.v2alpha.ListCatalogsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListCatalogsRequest.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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListCatalogsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsRequest build() { + com.google.cloud.retail.v2alpha.ListCatalogsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ListCatalogsRequest result = + new com.google.cloud.retail.v2alpha.ListCatalogsRequest(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.v2alpha.ListCatalogsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListCatalogsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListCatalogsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ListCatalogsRequest.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.v2alpha.ListCatalogsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListCatalogsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to
+     * return. If unspecified, defaults to 50. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to
+     * return. If unspecified, defaults to 50. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to
+     * return. If unspecified, defaults to 50. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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.v2alpha.ListCatalogsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListCatalogsRequest) + private static final com.google.cloud.retail.v2alpha.ListCatalogsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListCatalogsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogsRequest(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.v2alpha.ListCatalogsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequestOrBuilder.java new file mode 100644 index 00000000..bb9ded9e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListCatalogsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListCatalogsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to
+   * return. If unspecified, defaults to 50. The maximum allowed value is 1000.
+   * Values above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponse.java new file mode 100644 index 00000000..7e4cf32f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponse.java @@ -0,0 +1,1155 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response for
+ * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListCatalogsResponse} + */ +public final class ListCatalogsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListCatalogsResponse) + ListCatalogsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogsResponse.newBuilder() to construct. + private ListCatalogsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogsResponse() { + catalogs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogsResponse( + 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)) { + catalogs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + catalogs_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Catalog.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)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListCatalogsResponse.class, + com.google.cloud.retail.v2alpha.ListCatalogsResponse.Builder.class); + } + + public static final int CATALOGS_FIELD_NUMBER = 1; + private java.util.List catalogs_; + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List getCatalogsList() { + return catalogs_; + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List + getCatalogsOrBuilderList() { + return catalogs_; + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + @java.lang.Override + public int getCatalogsCount() { + return catalogs_.size(); + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Catalog getCatalogs(int index) { + return catalogs_.get(index); + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogsOrBuilder(int index) { + return catalogs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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 < catalogs_.size(); i++) { + output.writeMessage(1, catalogs_.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 < catalogs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, catalogs_.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.v2alpha.ListCatalogsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListCatalogsResponse other = + (com.google.cloud.retail.v2alpha.ListCatalogsResponse) obj; + + if (!getCatalogsList().equals(other.getCatalogsList())) 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 (getCatalogsCount() > 0) { + hash = (37 * hash) + CATALOGS_FIELD_NUMBER; + hash = (53 * hash) + getCatalogsList().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.v2alpha.ListCatalogsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListCatalogsResponse 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 for
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListCatalogsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListCatalogsResponse) + com.google.cloud.retail.v2alpha.ListCatalogsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListCatalogsResponse.class, + com.google.cloud.retail.v2alpha.ListCatalogsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListCatalogsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCatalogsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + catalogsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListCatalogsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsResponse build() { + com.google.cloud.retail.v2alpha.ListCatalogsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListCatalogsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ListCatalogsResponse result = + new com.google.cloud.retail.v2alpha.ListCatalogsResponse(this); + int from_bitField0_ = bitField0_; + if (catalogsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.catalogs_ = catalogs_; + } else { + result.catalogs_ = catalogsBuilder_.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.v2alpha.ListCatalogsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListCatalogsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListCatalogsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ListCatalogsResponse.getDefaultInstance()) + return this; + if (catalogsBuilder_ == null) { + if (!other.catalogs_.isEmpty()) { + if (catalogs_.isEmpty()) { + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCatalogsIsMutable(); + catalogs_.addAll(other.catalogs_); + } + onChanged(); + } + } else { + if (!other.catalogs_.isEmpty()) { + if (catalogsBuilder_.isEmpty()) { + catalogsBuilder_.dispose(); + catalogsBuilder_ = null; + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + catalogsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCatalogsFieldBuilder() + : null; + } else { + catalogsBuilder_.addAllMessages(other.catalogs_); + } + } + } + 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.v2alpha.ListCatalogsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListCatalogsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List catalogs_ = + java.util.Collections.emptyList(); + + private void ensureCatalogsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + catalogs_ = new java.util.ArrayList(catalogs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder> + catalogsBuilder_; + + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public java.util.List getCatalogsList() { + if (catalogsBuilder_ == null) { + return java.util.Collections.unmodifiableList(catalogs_); + } else { + return catalogsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public int getCatalogsCount() { + if (catalogsBuilder_ == null) { + return catalogs_.size(); + } else { + return catalogsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2alpha.Catalog getCatalogs(int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder setCatalogs(int index, com.google.cloud.retail.v2alpha.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.set(index, value); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder setCatalogs( + int index, com.google.cloud.retail.v2alpha.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.set(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder addCatalogs(com.google.cloud.retail.v2alpha.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(value); + onChanged(); + } else { + catalogsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder addCatalogs(int index, com.google.cloud.retail.v2alpha.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(index, value); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder addCatalogs(com.google.cloud.retail.v2alpha.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder addCatalogs( + int index, com.google.cloud.retail.v2alpha.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder addAllCatalogs( + java.lang.Iterable values) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, catalogs_); + onChanged(); + } else { + catalogsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder clearCatalogs() { + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + catalogsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public Builder removeCatalogs(int index) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.remove(index); + onChanged(); + } else { + catalogsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2alpha.Catalog.Builder getCatalogsBuilder(int index) { + return getCatalogsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogsOrBuilder(int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public java.util.List + getCatalogsOrBuilderList() { + if (catalogsBuilder_ != null) { + return catalogsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(catalogs_); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2alpha.Catalog.Builder addCatalogsBuilder() { + return getCatalogsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2alpha.Catalog.Builder addCatalogsBuilder(int index) { + return getCatalogsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + public java.util.List + getCatalogsBuilderList() { + return getCatalogsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder> + getCatalogsFieldBuilder() { + if (catalogsBuilder_ == null) { + catalogsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder>( + catalogs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + catalogs_ = null; + } + return catalogsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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.v2alpha.ListCatalogsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListCatalogsResponse) + private static final com.google.cloud.retail.v2alpha.ListCatalogsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListCatalogsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ListCatalogsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogsResponse(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.v2alpha.ListCatalogsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponseOrBuilder.java new file mode 100644 index 00000000..5559c610 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListCatalogsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListCatalogsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListCatalogsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + java.util.List getCatalogsList(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + com.google.cloud.retail.v2alpha.Catalog getCatalogs(int index); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + int getCatalogsCount(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + java.util.List + getCatalogsOrBuilderList(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Catalog catalogs = 1; + */ + com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequest.java new file mode 100644 index 00000000..7f5a393a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequest.java @@ -0,0 +1,1146 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for ListControls method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListControlsRequest} + */ +public final class ListControlsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListControlsRequest) + ListControlsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListControlsRequest.newBuilder() to construct. + private ListControlsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListControlsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListControlsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListControlsRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListControlsRequest.class, + com.google.cloud.retail.v2alpha.ListControlsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.v2alpha.ListControlsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListControlsRequest other = + (com.google.cloud.retail.v2alpha.ListControlsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListControlsRequest 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 ListControls method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListControlsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListControlsRequest) + com.google.cloud.retail.v2alpha.ListControlsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListControlsRequest.class, + com.google.cloud.retail.v2alpha.ListControlsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListControlsRequest.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_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListControlsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsRequest build() { + com.google.cloud.retail.v2alpha.ListControlsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ListControlsRequest result = + new com.google.cloud.retail.v2alpha.ListControlsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.v2alpha.ListControlsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListControlsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListControlsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ListControlsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.v2alpha.ListControlsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListControlsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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 `ListControls` 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 `ListControls` 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 `ListControls` 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ListControlsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListControlsRequest) + private static final com.google.cloud.retail.v2alpha.ListControlsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListControlsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ListControlsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListControlsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListControlsRequest(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.v2alpha.ListControlsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequestOrBuilder.java new file mode 100644 index 00000000..c0914de8 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListControlsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListControlsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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(); + + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponse.java new file mode 100644 index 00000000..81bf6440 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponse.java @@ -0,0 +1,1130 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response for ListControls method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListControlsResponse} + */ +public final class ListControlsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListControlsResponse) + ListControlsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListControlsResponse.newBuilder() to construct. + private ListControlsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListControlsResponse() { + controls_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListControlsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListControlsResponse( + 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)) { + controls_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + controls_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Control.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)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListControlsResponse.class, + com.google.cloud.retail.v2alpha.ListControlsResponse.Builder.class); + } + + public static final int CONTROLS_FIELD_NUMBER = 1; + private java.util.List controls_; + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + @java.lang.Override + public java.util.List getControlsList() { + return controls_; + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + @java.lang.Override + public java.util.List + getControlsOrBuilderList() { + return controls_; + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + @java.lang.Override + public int getControlsCount() { + return controls_.size(); + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control getControls(int index) { + return controls_.get(index); + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlsOrBuilder(int index) { + return controls_.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 < controls_.size(); i++) { + output.writeMessage(1, controls_.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 < controls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, controls_.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.v2alpha.ListControlsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListControlsResponse other = + (com.google.cloud.retail.v2alpha.ListControlsResponse) obj; + + if (!getControlsList().equals(other.getControlsList())) 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 (getControlsCount() > 0) { + hash = (37 * hash) + CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getControlsList().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.v2alpha.ListControlsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListControlsResponse 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 for ListControls method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListControlsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListControlsResponse) + com.google.cloud.retail.v2alpha.ListControlsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListControlsResponse.class, + com.google.cloud.retail.v2alpha.ListControlsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListControlsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getControlsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + controlsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_ListControlsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListControlsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsResponse build() { + com.google.cloud.retail.v2alpha.ListControlsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListControlsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ListControlsResponse result = + new com.google.cloud.retail.v2alpha.ListControlsResponse(this); + int from_bitField0_ = bitField0_; + if (controlsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.controls_ = controls_; + } else { + result.controls_ = controlsBuilder_.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.v2alpha.ListControlsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListControlsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListControlsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ListControlsResponse.getDefaultInstance()) + return this; + if (controlsBuilder_ == null) { + if (!other.controls_.isEmpty()) { + if (controls_.isEmpty()) { + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureControlsIsMutable(); + controls_.addAll(other.controls_); + } + onChanged(); + } + } else { + if (!other.controls_.isEmpty()) { + if (controlsBuilder_.isEmpty()) { + controlsBuilder_.dispose(); + controlsBuilder_ = null; + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000001); + controlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getControlsFieldBuilder() + : null; + } else { + controlsBuilder_.addAllMessages(other.controls_); + } + } + } + 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.v2alpha.ListControlsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListControlsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List controls_ = + java.util.Collections.emptyList(); + + private void ensureControlsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + controls_ = new java.util.ArrayList(controls_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + controlsBuilder_; + + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public java.util.List getControlsList() { + if (controlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(controls_); + } else { + return controlsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public int getControlsCount() { + if (controlsBuilder_ == null) { + return controls_.size(); + } else { + return controlsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public com.google.cloud.retail.v2alpha.Control getControls(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder setControls(int index, com.google.cloud.retail.v2alpha.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.set(index, value); + onChanged(); + } else { + controlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder setControls( + int index, com.google.cloud.retail.v2alpha.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.set(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder addControls(com.google.cloud.retail.v2alpha.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(value); + onChanged(); + } else { + controlsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder addControls(int index, com.google.cloud.retail.v2alpha.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(index, value); + onChanged(); + } else { + controlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder addControls(com.google.cloud.retail.v2alpha.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder addControls( + int index, com.google.cloud.retail.v2alpha.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder addAllControls( + java.lang.Iterable values) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, controls_); + onChanged(); + } else { + controlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder clearControls() { + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + controlsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public Builder removeControls(int index) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.remove(index); + onChanged(); + } else { + controlsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public com.google.cloud.retail.v2alpha.Control.Builder getControlsBuilder(int index) { + return getControlsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlsOrBuilder(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public java.util.List + getControlsOrBuilderList() { + if (controlsBuilder_ != null) { + return controlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(controls_); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public com.google.cloud.retail.v2alpha.Control.Builder addControlsBuilder() { + return getControlsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Control.getDefaultInstance()); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public com.google.cloud.retail.v2alpha.Control.Builder addControlsBuilder(int index) { + return getControlsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Control.getDefaultInstance()); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + public java.util.List + getControlsBuilderList() { + return getControlsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + getControlsFieldBuilder() { + if (controlsBuilder_ == null) { + controlsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder>( + controls_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + controls_ = null; + } + return controlsBuilder_; + } + + 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.v2alpha.ListControlsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListControlsResponse) + private static final com.google.cloud.retail.v2alpha.ListControlsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListControlsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ListControlsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListControlsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListControlsResponse(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.v2alpha.ListControlsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponseOrBuilder.java new file mode 100644 index 00000000..55d5cce7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListControlsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListControlsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListControlsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + java.util.List getControlsList(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + com.google.cloud.retail.v2alpha.Control getControls(int index); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + int getControlsCount(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + java.util.List + getControlsOrBuilderList(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Control controls = 1; + */ + com.google.cloud.retail.v2alpha.ControlOrBuilder getControlsOrBuilder(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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequest.java new file mode 100644 index 00000000..3549b3f5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequest.java @@ -0,0 +1,1930 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for
+ * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListProductsRequest} + */ +public final class ListProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListProductsRequest) + ListProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsRequest.newBuilder() to construct. + private ListProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (readMask_ != null) { + subBuilder = readMask_.toBuilder(); + } + readMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readMask_); + readMask_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + requireTotalSize_ = 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListProductsRequest.class, + com.google.cloud.retail.v2alpha.ListProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * 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 branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+   * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
+   * Values above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @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_; + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_MASK_FIELD_NUMBER = 5; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + @java.lang.Override + public boolean hasReadMask() { + return readMask_ != null; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return getReadMask(); + } + + public static final int REQUIRE_TOTAL_SIZE_FIELD_NUMBER = 6; + private boolean requireTotalSize_; + /** + * + * + *
+   * If true and
+   * [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
+   * empty,
+   * [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+   * is set to the total count of matched items irrespective of pagination.
+   * Notice that setting this field to true affects the performance.
+   * 
+ * + * bool require_total_size = 6; + * + * @return The requireTotalSize. + */ + @java.lang.Override + public boolean getRequireTotalSize() { + return requireTotalSize_; + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (readMask_ != null) { + output.writeMessage(5, getReadMask()); + } + if (requireTotalSize_ != false) { + output.writeBool(6, requireTotalSize_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (readMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); + } + if (requireTotalSize_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requireTotalSize_); + } + 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.v2alpha.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListProductsRequest other = + (com.google.cloud.retail.v2alpha.ListProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) return false; + } + if (getRequireTotalSize() != other.getRequireTotalSize()) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + hash = (37 * hash) + REQUIRE_TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireTotalSize()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListProductsRequest) + com.google.cloud.retail.v2alpha.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListProductsRequest.class, + com.google.cloud.retail.v2alpha.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListProductsRequest.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_ = ""; + + filter_ = ""; + + if (readMaskBuilder_ == null) { + readMask_ = null; + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + requireTotalSize_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsRequest build() { + com.google.cloud.retail.v2alpha.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ListProductsRequest result = + new com.google.cloud.retail.v2alpha.ListProductsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + if (readMaskBuilder_ == null) { + result.readMask_ = readMask_; + } else { + result.readMask_ = readMaskBuilder_.build(); + } + result.requireTotalSize_ = requireTotalSize_; + 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.v2alpha.ListProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListProductsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ListProductsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + if (other.getRequireTotalSize() != false) { + setRequireTotalSize(other.getRequireTotalSize()); + } + 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.v2alpha.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
+     * Values above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + public boolean hasReadMask() { + return readMaskBuilder_ != null || readMask_ != null; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + onChanged(); + } else { + readMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + onChanged(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (readMask_ != null) { + readMask_ = + com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); + } else { + readMask_ = value; + } + onChanged(); + } else { + readMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder clearReadMask() { + if (readMaskBuilder_ == null) { + readMask_ = null; + onChanged(); + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+     * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+     * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + private boolean requireTotalSize_; + /** + * + * + *
+     * If true and
+     * [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
+     * empty,
+     * [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * is set to the total count of matched items irrespective of pagination.
+     * Notice that setting this field to true affects the performance.
+     * 
+ * + * bool require_total_size = 6; + * + * @return The requireTotalSize. + */ + @java.lang.Override + public boolean getRequireTotalSize() { + return requireTotalSize_; + } + /** + * + * + *
+     * If true and
+     * [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
+     * empty,
+     * [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * is set to the total count of matched items irrespective of pagination.
+     * Notice that setting this field to true affects the performance.
+     * 
+ * + * bool require_total_size = 6; + * + * @param value The requireTotalSize to set. + * @return This builder for chaining. + */ + public Builder setRequireTotalSize(boolean value) { + + requireTotalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true and
+     * [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
+     * empty,
+     * [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * is set to the total count of matched items irrespective of pagination.
+     * Notice that setting this field to true affects the performance.
+     * 
+ * + * bool require_total_size = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequireTotalSize() { + + requireTotalSize_ = 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.v2alpha.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListProductsRequest) + private static final com.google.cloud.retail.v2alpha.ListProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListProductsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ListProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsRequest(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.v2alpha.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequestOrBuilder.java new file mode 100644 index 00000000..790b353b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsRequestOrBuilder.java @@ -0,0 +1,292 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2alpha.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+   * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
+   * Values above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2alpha.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + boolean hasReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2alpha.Product.name]
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * * [Product.title][google.cloud.retail.v2alpha.Product.title]
+   * * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
+   * * [Product.images][google.cloud.retail.v2alpha.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2alpha.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); + + /** + * + * + *
+   * If true and
+   * [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
+   * empty,
+   * [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+   * is set to the total count of matched items irrespective of pagination.
+   * Notice that setting this field to true affects the performance.
+   * 
+ * + * bool require_total_size = 6; + * + * @return The requireTotalSize. + */ + boolean getRequireTotalSize(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponse.java new file mode 100644 index 00000000..79d624d5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponse.java @@ -0,0 +1,1285 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response message for
+ * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListProductsResponse} + */ +public final class ListProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListProductsResponse) + ListProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsResponse.newBuilder() to construct. + private ListProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsResponse( + 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)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 24: + { + totalSize_ = input.readInt32(); + 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)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListProductsResponse.class, + com.google.cloud.retail.v2alpha.ListProductsResponse.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_; + /** + * + * + *
+   * The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
+   * irrespective of pagination. The total number of
+   * [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
+   * be less than the
+   * [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+   * that matches.
+   * This field is ignored if
+   * [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
+   * is not set or
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * is not empty.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + 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 < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(3, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); + } + 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.v2alpha.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListProductsResponse other = + (com.google.cloud.retail.v2alpha.ListProductsResponse) obj; + + if (!getProductsList().equals(other.getProductsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) 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 (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ListProductsResponse 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 message for
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListProductsResponse) + com.google.cloud.retail.v2alpha.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListProductsResponse.class, + com.google.cloud.retail.v2alpha.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsResponse build() { + com.google.cloud.retail.v2alpha.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListProductsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ListProductsResponse result = + new com.google.cloud.retail.v2alpha.ListProductsResponse(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + 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.v2alpha.ListProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListProductsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ListProductsResponse.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + 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.v2alpha.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public com.google.cloud.retail.v2alpha.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public com.google.cloud.retail.v2alpha.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public com.google.cloud.retail.v2alpha.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + + private int totalSize_; + /** + * + * + *
+     * The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
+     * irrespective of pagination. The total number of
+     * [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
+     * be less than the
+     * [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * that matches.
+     * This field is ignored if
+     * [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
+     * is not set or
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * is not empty.
+     * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
+     * irrespective of pagination. The total number of
+     * [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
+     * be less than the
+     * [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * that matches.
+     * This field is ignored if
+     * [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
+     * is not set or
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * is not empty.
+     * 
+ * + * int32 total_size = 3; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
+     * irrespective of pagination. The total number of
+     * [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
+     * be less than the
+     * [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+     * that matches.
+     * This field is ignored if
+     * [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
+     * is not set or
+     * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+     * is not empty.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListProductsResponse) + private static final com.google.cloud.retail.v2alpha.ListProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListProductsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ListProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsResponse(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.v2alpha.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponseOrBuilder.java new file mode 100644 index 00000000..ef4e4690 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListProductsResponseOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + com.google.cloud.retail.v2alpha.Product getProducts(int index); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2alpha.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Product products = 1; + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
+   * irrespective of pagination. The total number of
+   * [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
+   * be less than the
+   * [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
+   * that matches.
+   * This field is ignored if
+   * [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
+   * is not set or
+   * [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
+   * is not empty.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequest.java new file mode 100644 index 00000000..b2c1f100 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequest.java @@ -0,0 +1,944 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for ListServingConfigs method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListServingConfigsRequest} + */ +public final class ListServingConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListServingConfigsRequest) + ListServingConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServingConfigsRequest.newBuilder() to construct. + private ListServingConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServingConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServingConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServingConfigsRequest( + 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest.class, + com.google.cloud.retail.v2alpha.ListServingConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+   * returned.
+   * 
+ * + * 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 `ListServingConfigs` 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 `ListServingConfigs` 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.v2alpha.ListServingConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListServingConfigsRequest other = + (com.google.cloud.retail.v2alpha.ListServingConfigsRequest) 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.v2alpha.ListServingConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest 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 ListServingConfigs method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListServingConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListServingConfigsRequest) + com.google.cloud.retail.v2alpha.ListServingConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListServingConfigsRequest.class, + com.google.cloud.retail.v2alpha.ListServingConfigsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListServingConfigsRequest.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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListServingConfigsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsRequest build() { + com.google.cloud.retail.v2alpha.ListServingConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ListServingConfigsRequest result = + new com.google.cloud.retail.v2alpha.ListServingConfigsRequest(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.v2alpha.ListServingConfigsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListServingConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListServingConfigsRequest other) { + if (other == com.google.cloud.retail.v2alpha.ListServingConfigsRequest.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.v2alpha.ListServingConfigsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListServingConfigsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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.v2alpha.ListServingConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListServingConfigsRequest) + private static final com.google.cloud.retail.v2alpha.ListServingConfigsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListServingConfigsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServingConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServingConfigsRequest(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.v2alpha.ListServingConfigsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequestOrBuilder.java new file mode 100644 index 00000000..2b6f0150 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListServingConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListServingConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListServingConfigs` 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 `ListServingConfigs` 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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponse.java new file mode 100644 index 00000000..b0912ad3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponse.java @@ -0,0 +1,1143 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response for ListServingConfigs method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListServingConfigsResponse} + */ +public final class ListServingConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ListServingConfigsResponse) + ListServingConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServingConfigsResponse.newBuilder() to construct. + private ListServingConfigsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServingConfigsResponse() { + servingConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServingConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServingConfigsResponse( + 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)) { + servingConfigs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + servingConfigs_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.ServingConfig.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)) { + servingConfigs_ = java.util.Collections.unmodifiableList(servingConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListServingConfigsResponse.class, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse.Builder.class); + } + + public static final int SERVING_CONFIGS_FIELD_NUMBER = 1; + private java.util.List servingConfigs_; + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public java.util.List getServingConfigsList() { + return servingConfigs_; + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public java.util.List + getServingConfigsOrBuilderList() { + return servingConfigs_; + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public int getServingConfigsCount() { + return servingConfigs_.size(); + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfigs(int index) { + return servingConfigs_.get(index); + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigsOrBuilder( + int index) { + return servingConfigs_.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 < servingConfigs_.size(); i++) { + output.writeMessage(1, servingConfigs_.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 < servingConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, servingConfigs_.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.v2alpha.ListServingConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ListServingConfigsResponse other = + (com.google.cloud.retail.v2alpha.ListServingConfigsResponse) obj; + + if (!getServingConfigsList().equals(other.getServingConfigsList())) 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 (getServingConfigsCount() > 0) { + hash = (37 * hash) + SERVING_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigsList().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.v2alpha.ListServingConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ListServingConfigsResponse 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 for ListServingConfigs method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ListServingConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ListServingConfigsResponse) + com.google.cloud.retail.v2alpha.ListServingConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ListServingConfigsResponse.class, + com.google.cloud.retail.v2alpha.ListServingConfigsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ListServingConfigsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServingConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (servingConfigsBuilder_ == null) { + servingConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servingConfigsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ListServingConfigsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsResponse build() { + com.google.cloud.retail.v2alpha.ListServingConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ListServingConfigsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ListServingConfigsResponse result = + new com.google.cloud.retail.v2alpha.ListServingConfigsResponse(this); + int from_bitField0_ = bitField0_; + if (servingConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + servingConfigs_ = java.util.Collections.unmodifiableList(servingConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.servingConfigs_ = servingConfigs_; + } else { + result.servingConfigs_ = servingConfigsBuilder_.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.v2alpha.ListServingConfigsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ListServingConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ListServingConfigsResponse other) { + if (other == com.google.cloud.retail.v2alpha.ListServingConfigsResponse.getDefaultInstance()) + return this; + if (servingConfigsBuilder_ == null) { + if (!other.servingConfigs_.isEmpty()) { + if (servingConfigs_.isEmpty()) { + servingConfigs_ = other.servingConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServingConfigsIsMutable(); + servingConfigs_.addAll(other.servingConfigs_); + } + onChanged(); + } + } else { + if (!other.servingConfigs_.isEmpty()) { + if (servingConfigsBuilder_.isEmpty()) { + servingConfigsBuilder_.dispose(); + servingConfigsBuilder_ = null; + servingConfigs_ = other.servingConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + servingConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServingConfigsFieldBuilder() + : null; + } else { + servingConfigsBuilder_.addAllMessages(other.servingConfigs_); + } + } + } + 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.v2alpha.ListServingConfigsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ListServingConfigsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List servingConfigs_ = + java.util.Collections.emptyList(); + + private void ensureServingConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + servingConfigs_ = + new java.util.ArrayList(servingConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + servingConfigsBuilder_; + + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public java.util.List getServingConfigsList() { + if (servingConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(servingConfigs_); + } else { + return servingConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public int getServingConfigsCount() { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.size(); + } else { + return servingConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfigs(int index) { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.get(index); + } else { + return servingConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder setServingConfigs( + int index, com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.set(index, value); + onChanged(); + } else { + servingConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder setServingConfigs( + int index, com.google.cloud.retail.v2alpha.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs(com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.add(value); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + int index, com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.add(index, value); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + com.google.cloud.retail.v2alpha.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.add(builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + int index, com.google.cloud.retail.v2alpha.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder addAllServingConfigs( + java.lang.Iterable values) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, servingConfigs_); + onChanged(); + } else { + servingConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder clearServingConfigs() { + if (servingConfigsBuilder_ == null) { + servingConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + servingConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public Builder removeServingConfigs(int index) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.remove(index); + onChanged(); + } else { + servingConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2alpha.ServingConfig.Builder getServingConfigsBuilder( + int index) { + return getServingConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigsOrBuilder( + int index) { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.get(index); + } else { + return servingConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public java.util.List + getServingConfigsOrBuilderList() { + if (servingConfigsBuilder_ != null) { + return servingConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(servingConfigs_); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2alpha.ServingConfig.Builder addServingConfigsBuilder() { + return getServingConfigsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance()); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2alpha.ServingConfig.Builder addServingConfigsBuilder( + int index) { + return getServingConfigsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance()); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + public java.util.List + getServingConfigsBuilderList() { + return getServingConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + getServingConfigsFieldBuilder() { + if (servingConfigsBuilder_ == null) { + servingConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder>( + servingConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + servingConfigs_ = null; + } + return servingConfigsBuilder_; + } + + 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.v2alpha.ListServingConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ListServingConfigsResponse) + private static final com.google.cloud.retail.v2alpha.ListServingConfigsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ListServingConfigsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ListServingConfigsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServingConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServingConfigsResponse(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.v2alpha.ListServingConfigsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponseOrBuilder.java new file mode 100644 index 00000000..2fd71e7d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ListServingConfigsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ListServingConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ListServingConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + java.util.List getServingConfigsList(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + com.google.cloud.retail.v2alpha.ServingConfig getServingConfigs(int index); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + int getServingConfigsCount(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + java.util.List + getServingConfigsOrBuilderList(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ServingConfig serving_configs = 1; + */ + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigsOrBuilder(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/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventory.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventory.java new file mode 100644 index 00000000..e60ebd3b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventory.java @@ -0,0 +1,1970 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The inventory information at a place (e.g. a store) identified
+ * by a place ID.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.LocalInventory} + */ +public final class LocalInventory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.LocalInventory) + LocalInventoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocalInventory.newBuilder() to construct. + private LocalInventory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalInventory() { + placeId_ = ""; + fulfillmentTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalInventory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocalInventory( + 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(); + + placeId_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.PriceInfo.Builder subBuilder = null; + if (priceInfo_ != null) { + subBuilder = priceInfo_.toBuilder(); + } + priceInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.PriceInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceInfo_); + priceInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + fulfillmentTypes_.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_ & 0x00000002) != 0)) { + fulfillmentTypes_ = fulfillmentTypes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.LocalInventory.class, + com.google.cloud.retail.v2alpha.LocalInventory.Builder.class); + } + + public static final int PLACE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object placeId_; + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + @java.lang.Override + public java.lang.String getPlaceId() { + java.lang.Object ref = placeId_; + 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(); + placeId_ = s; + return s; + } + } + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = placeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_INFO_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.PriceInfo priceInfo_; + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + @java.lang.Override + public boolean hasPriceInfo() { + return priceInfo_ != null; + } + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo() { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder() { + return getPriceInfo(); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 3; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FULFILLMENT_TYPES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList fulfillmentTypes_; + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return A list containing the fulfillmentTypes. + */ + public com.google.protobuf.ProtocolStringList getFulfillmentTypesList() { + return fulfillmentTypes_; + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The count of fulfillmentTypes. + */ + public int getFulfillmentTypesCount() { + return fulfillmentTypes_.size(); + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + public java.lang.String getFulfillmentTypes(int index) { + return fulfillmentTypes_.get(index); + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + public com.google.protobuf.ByteString getFulfillmentTypesBytes(int index) { + return fulfillmentTypes_.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(placeId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placeId_); + } + if (priceInfo_ != null) { + output.writeMessage(2, getPriceInfo()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < fulfillmentTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fulfillmentTypes_.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(placeId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placeId_); + } + if (priceInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPriceInfo()); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, attributes__); + } + { + int dataSize = 0; + for (int i = 0; i < fulfillmentTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(fulfillmentTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getFulfillmentTypesList().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.v2alpha.LocalInventory)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.LocalInventory other = + (com.google.cloud.retail.v2alpha.LocalInventory) obj; + + if (!getPlaceId().equals(other.getPlaceId())) return false; + if (hasPriceInfo() != other.hasPriceInfo()) return false; + if (hasPriceInfo()) { + if (!getPriceInfo().equals(other.getPriceInfo())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getFulfillmentTypesList().equals(other.getFulfillmentTypesList())) 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) + PLACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPlaceId().hashCode(); + if (hasPriceInfo()) { + hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPriceInfo().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (getFulfillmentTypesCount() > 0) { + hash = (37 * hash) + FULFILLMENT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentTypesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.LocalInventory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inventory information at a place (e.g. a store) identified
+   * by a place ID.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.LocalInventory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.LocalInventory) + com.google.cloud.retail.v2alpha.LocalInventoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.LocalInventory.class, + com.google.cloud.retail.v2alpha.LocalInventory.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.LocalInventory.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(); + placeId_ = ""; + + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + internalGetMutableAttributes().clear(); + fulfillmentTypes_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_LocalInventory_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.LocalInventory getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.LocalInventory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.LocalInventory build() { + com.google.cloud.retail.v2alpha.LocalInventory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.LocalInventory buildPartial() { + com.google.cloud.retail.v2alpha.LocalInventory result = + new com.google.cloud.retail.v2alpha.LocalInventory(this); + int from_bitField0_ = bitField0_; + result.placeId_ = placeId_; + if (priceInfoBuilder_ == null) { + result.priceInfo_ = priceInfo_; + } else { + result.priceInfo_ = priceInfoBuilder_.build(); + } + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + if (((bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = fulfillmentTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fulfillmentTypes_ = fulfillmentTypes_; + 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.v2alpha.LocalInventory) { + return mergeFrom((com.google.cloud.retail.v2alpha.LocalInventory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.LocalInventory other) { + if (other == com.google.cloud.retail.v2alpha.LocalInventory.getDefaultInstance()) return this; + if (!other.getPlaceId().isEmpty()) { + placeId_ = other.placeId_; + onChanged(); + } + if (other.hasPriceInfo()) { + mergePriceInfo(other.getPriceInfo()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.fulfillmentTypes_.isEmpty()) { + if (fulfillmentTypes_.isEmpty()) { + fulfillmentTypes_ = other.fulfillmentTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.addAll(other.fulfillmentTypes_); + } + 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.v2alpha.LocalInventory parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.LocalInventory) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placeId_ = ""; + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + public java.lang.String getPlaceId() { + java.lang.Object ref = placeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = placeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @param value The placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPlaceId() { + + placeId_ = getDefaultInstance().getPlaceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @param value The bytes for placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.PriceInfo priceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder> + priceInfoBuilder_; + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + public boolean hasPriceInfo() { + return priceInfoBuilder_ != null || priceInfo_ != null; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + public com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo() { + if (priceInfoBuilder_ == null) { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } else { + return priceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2alpha.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceInfo_ = value; + onChanged(); + } else { + priceInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2alpha.PriceInfo.Builder builderForValue) { + if (priceInfoBuilder_ == null) { + priceInfo_ = builderForValue.build(); + onChanged(); + } else { + priceInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public Builder mergePriceInfo(com.google.cloud.retail.v2alpha.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (priceInfo_ != null) { + priceInfo_ = + com.google.cloud.retail.v2alpha.PriceInfo.newBuilder(priceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + priceInfo_ = value; + } + onChanged(); + } else { + priceInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public Builder clearPriceInfo() { + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + onChanged(); + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public com.google.cloud.retail.v2alpha.PriceInfo.Builder getPriceInfoBuilder() { + + onChanged(); + return getPriceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + public com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder() { + if (priceInfoBuilder_ != null) { + return priceInfoBuilder_.getMessageOrBuilder(); + } else { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder> + getPriceInfoFieldBuilder() { + if (priceInfoBuilder_ == null) { + priceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder>( + getPriceInfo(), getParentForChildren(), isClean()); + priceInfo_ = null; + } + return priceInfoBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList fulfillmentTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFulfillmentTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = new com.google.protobuf.LazyStringArrayList(fulfillmentTypes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return A list containing the fulfillmentTypes. + */ + public com.google.protobuf.ProtocolStringList getFulfillmentTypesList() { + return fulfillmentTypes_.getUnmodifiableView(); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The count of fulfillmentTypes. + */ + public int getFulfillmentTypesCount() { + return fulfillmentTypes_.size(); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + public java.lang.String getFulfillmentTypes(int index) { + return fulfillmentTypes_.get(index); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + public com.google.protobuf.ByteString getFulfillmentTypesBytes(int index) { + return fulfillmentTypes_.getByteString(index); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The fulfillmentTypes to set. + * @return This builder for chaining. + */ + public Builder setFulfillmentTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addFulfillmentTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param values The fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addAllFulfillmentTypes(java.lang.Iterable values) { + ensureFulfillmentTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fulfillmentTypes_); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFulfillmentTypes() { + fulfillmentTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The bytes of the fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addFulfillmentTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.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.v2alpha.LocalInventory) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.LocalInventory) + private static final com.google.cloud.retail.v2alpha.LocalInventory DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.LocalInventory(); + } + + public static com.google.cloud.retail.v2alpha.LocalInventory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalInventory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocalInventory(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.v2alpha.LocalInventory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventoryOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventoryOrBuilder.java new file mode 100644 index 00000000..58648c3b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocalInventoryOrBuilder.java @@ -0,0 +1,345 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface LocalInventoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.LocalInventory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + java.lang.String getPlaceId(); + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + com.google.protobuf.ByteString getPlaceIdBytes(); + + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + boolean hasPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 2; + */ + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder(); + + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + int getAttributesCount(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute defaultValue); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 3; + */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return A list containing the fulfillmentTypes. + */ + java.util.List getFulfillmentTypesList(); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The count of fulfillmentTypes. + */ + int getFulfillmentTypesCount(); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + java.lang.String getFulfillmentTypes(int index); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + com.google.protobuf.ByteString getFulfillmentTypesBytes(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocationName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocationName.java new file mode 100644 index 00000000..eedc09e3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.v2alpha; + +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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLink.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLink.java new file mode 100644 index 00000000..f72b49ca --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLink.java @@ -0,0 +1,1554 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Represents a link between a Merchant Center account and a branch.
+ * Once a link is established, products from the linked merchant center account
+ * will be streamed to the linked branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.MerchantCenterLink} + */ +public final class MerchantCenterLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.MerchantCenterLink) + MerchantCenterLinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use MerchantCenterLink.newBuilder() to construct. + private MerchantCenterLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantCenterLink() { + branchId_ = ""; + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + regionCode_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantCenterLink(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MerchantCenterLink( + 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 8: + { + merchantCenterAccountId_ = input.readInt64(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branchId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + destinations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + destinations_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + regionCode_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = 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)) { + destinations_ = destinations_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.MerchantCenterLink.class, + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder.class); + } + + public static final int MERCHANT_CENTER_ACCOUNT_ID_FIELD_NUMBER = 1; + private long merchantCenterAccountId_; + /** + * + * + *
+   * Required. The linked [Merchant center account
+   * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+   * The account must be a standalone account or a sub-account of a MCA.
+   * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + @java.lang.Override + public long getMerchantCenterAccountId() { + return merchantCenterAccountId_; + } + + public static final int BRANCH_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object branchId_; + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + @java.lang.Override + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + 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(); + branchId_ = s; + return s; + } + } + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATIONS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList destinations_; + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + public com.google.protobuf.ProtocolStringList getDestinationsList() { + return destinations_; + } + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + public java.lang.String getDestinations(int index) { + return destinations_.get(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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + public com.google.protobuf.ByteString getDestinationsBytes(int index) { + return destinations_.getByteString(index); + } + + public static final int REGION_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object regionCode_; + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + @java.lang.Override + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + 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(); + regionCode_ = s; + return s; + } + } + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = 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 (merchantCenterAccountId_ != 0L) { + output.writeInt64(1, merchantCenterAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branchId_); + } + for (int i = 0; i < destinations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destinations_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, regionCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (merchantCenterAccountId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, merchantCenterAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branchId_); + } + { + int dataSize = 0; + for (int i = 0; i < destinations_.size(); i++) { + dataSize += computeStringSizeNoTag(destinations_.getRaw(i)); + } + size += dataSize; + size += 1 * getDestinationsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, regionCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); + } + 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.v2alpha.MerchantCenterLink)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.MerchantCenterLink other = + (com.google.cloud.retail.v2alpha.MerchantCenterLink) obj; + + if (getMerchantCenterAccountId() != other.getMerchantCenterAccountId()) return false; + if (!getBranchId().equals(other.getBranchId())) return false; + if (!getDestinationsList().equals(other.getDestinationsList())) return false; + if (!getRegionCode().equals(other.getRegionCode())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + MERCHANT_CENTER_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMerchantCenterAccountId()); + hash = (37 * hash) + BRANCH_ID_FIELD_NUMBER; + hash = (53 * hash) + getBranchId().hashCode(); + if (getDestinationsCount() > 0) { + hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDestinationsList().hashCode(); + } + hash = (37 * hash) + REGION_CODE_FIELD_NUMBER; + hash = (53 * hash) + getRegionCode().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.MerchantCenterLink 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 a link between a Merchant Center account and a branch.
+   * Once a link is established, products from the linked merchant center account
+   * will be streamed to the linked branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.MerchantCenterLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.MerchantCenterLink) + com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.MerchantCenterLink.class, + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.MerchantCenterLink.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(); + merchantCenterAccountId_ = 0L; + + branchId_ = ""; + + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + regionCode_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLink_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLink getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.MerchantCenterLink.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLink build() { + com.google.cloud.retail.v2alpha.MerchantCenterLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLink buildPartial() { + com.google.cloud.retail.v2alpha.MerchantCenterLink result = + new com.google.cloud.retail.v2alpha.MerchantCenterLink(this); + int from_bitField0_ = bitField0_; + result.merchantCenterAccountId_ = merchantCenterAccountId_; + result.branchId_ = branchId_; + if (((bitField0_ & 0x00000001) != 0)) { + destinations_ = destinations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.destinations_ = destinations_; + result.regionCode_ = regionCode_; + result.languageCode_ = languageCode_; + 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.v2alpha.MerchantCenterLink) { + return mergeFrom((com.google.cloud.retail.v2alpha.MerchantCenterLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.MerchantCenterLink other) { + if (other == com.google.cloud.retail.v2alpha.MerchantCenterLink.getDefaultInstance()) + return this; + if (other.getMerchantCenterAccountId() != 0L) { + setMerchantCenterAccountId(other.getMerchantCenterAccountId()); + } + if (!other.getBranchId().isEmpty()) { + branchId_ = other.branchId_; + onChanged(); + } + if (!other.destinations_.isEmpty()) { + if (destinations_.isEmpty()) { + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDestinationsIsMutable(); + destinations_.addAll(other.destinations_); + } + onChanged(); + } + if (!other.getRegionCode().isEmpty()) { + regionCode_ = other.regionCode_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + 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.v2alpha.MerchantCenterLink parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.MerchantCenterLink) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long merchantCenterAccountId_; + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + @java.lang.Override + public long getMerchantCenterAccountId() { + return merchantCenterAccountId_; + } + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The merchantCenterAccountId to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterAccountId(long value) { + + merchantCenterAccountId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMerchantCenterAccountId() { + + merchantCenterAccountId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object branchId_ = ""; + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @param value The branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branchId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearBranchId() { + + branchId_ = getDefaultInstance().getBranchId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @param value The bytes for branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branchId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList destinations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDestinationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + destinations_ = new com.google.protobuf.LazyStringArrayList(destinations_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + public com.google.protobuf.ProtocolStringList getDestinationsList() { + return destinations_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + public java.lang.String getDestinations(int index) { + return destinations_.get(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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + public com.google.protobuf.ByteString getDestinationsBytes(int index) { + return destinations_.getByteString(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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index to set the value at. + * @param value The destinations to set. + * @return This builder for chaining. + */ + public Builder setDestinations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param value The destinations to add. + * @return This builder for chaining. + */ + public Builder addDestinations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param values The destinations to add. + * @return This builder for chaining. + */ + public Builder addAllDestinations(java.lang.Iterable values) { + ensureDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinations_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinations() { + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param value The bytes of the destinations to add. + * @return This builder for chaining. + */ + public Builder addDestinationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + return this; + } + + private java.lang.Object regionCode_ = ""; + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + regionCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @param value The regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + regionCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return This builder for chaining. + */ + public Builder clearRegionCode() { + + regionCode_ = getDefaultInstance().getRegionCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @param value The bytes for regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + regionCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = 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.v2alpha.MerchantCenterLink) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.MerchantCenterLink) + private static final com.google.cloud.retail.v2alpha.MerchantCenterLink DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.MerchantCenterLink(); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantCenterLink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MerchantCenterLink(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.v2alpha.MerchantCenterLink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkOrBuilder.java new file mode 100644 index 00000000..79b5015c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface MerchantCenterLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.MerchantCenterLink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The linked [Merchant center account
+   * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+   * The account must be a standalone account or a sub-account of a MCA.
+   * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + long getMerchantCenterAccountId(); + + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + java.lang.String getBranchId(); + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + java.util.List 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + com.google.protobuf.ByteString getDestinationsBytes(int index); + + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + java.lang.String getRegionCode(); + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + com.google.protobuf.ByteString getRegionCodeBytes(); + + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfig.java new file mode 100644 index 00000000..be5dc561 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfig.java @@ -0,0 +1,962 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Configures Merchant Center linking.
+ * Links contained in the config will be used to sync data from a Merchant
+ * Center account to a Cloud Retail branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} + */ +public final class MerchantCenterLinkingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + MerchantCenterLinkingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use MerchantCenterLinkingConfig.newBuilder() to construct. + private MerchantCenterLinkingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantCenterLinkingConfig() { + links_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantCenterLinkingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MerchantCenterLinkingConfig( + 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)) { + links_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + links_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.MerchantCenterLink.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)) { + links_ = java.util.Collections.unmodifiableList(links_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.class, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder.class); + } + + public static final int LINKS_FIELD_NUMBER = 1; + private java.util.List links_; + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + @java.lang.Override + public java.util.List + getLinksOrBuilderList() { + return links_; + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLink getLinks(int index) { + return links_.get(index); + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder getLinksOrBuilder(int index) { + return links_.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 { + for (int i = 0; i < links_.size(); i++) { + output.writeMessage(1, links_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, links_.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.v2alpha.MerchantCenterLinkingConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig other = + (com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) obj; + + if (!getLinksList().equals(other.getLinksList())) 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 (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig 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; + } + /** + * + * + *
+   * Configures Merchant Center linking.
+   * Links contained in the config will be used to sync data from a Merchant
+   * Center account to a Cloud Retail branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.class, + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linksBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig build() { + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig buildPartial() { + com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig result = + new com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(this); + int from_bitField0_ = bitField0_; + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.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.v2alpha.MerchantCenterLinkingConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig other) { + if (other == com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.getDefaultInstance()) + return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLinksFieldBuilder() + : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + 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.v2alpha.MerchantCenterLinkingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List links_ = + java.util.Collections.emptyList(); + + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = + new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLink, + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder> + linksBuilder_; + + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLink getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder setLinks(int index, com.google.cloud.retail.v2alpha.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder setLinks( + int index, com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder addLinks(com.google.cloud.retail.v2alpha.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder addLinks(int index, com.google.cloud.retail.v2alpha.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder addLinks( + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder addLinks( + int index, com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder addAllLinks( + java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder getLinksBuilder(int index) { + return getLinksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder getLinksOrBuilder( + int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public java.util.List + getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder addLinksBuilder() { + return getLinksFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.MerchantCenterLink.getDefaultInstance()); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder addLinksBuilder(int index) { + return getLinksFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2alpha.MerchantCenterLink.getDefaultInstance()); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + public java.util.List + getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLink, + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.MerchantCenterLink, + com.google.cloud.retail.v2alpha.MerchantCenterLink.Builder, + com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder>( + links_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + links_ = null; + } + return linksBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + private static final com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); + } + + public static com.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantCenterLinkingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MerchantCenterLinkingConfig(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.v2alpha.MerchantCenterLinkingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfigOrBuilder.java new file mode 100644 index 00000000..f5840218 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterLinkingConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface MerchantCenterLinkingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + java.util.List getLinksList(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + com.google.cloud.retail.v2alpha.MerchantCenterLink getLinks(int index); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + int getLinksCount(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + java.util.List + getLinksOrBuilderList(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.MerchantCenterLink links = 1; + */ + com.google.cloud.retail.v2alpha.MerchantCenterLinkOrBuilder getLinksOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequest.java new file mode 100644 index 00000000..b4516184 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequest.java @@ -0,0 +1,2760 @@ +/* + * 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/v2alpha/prediction_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for Predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictRequest} + */ +public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PredictRequest) + PredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequest.newBuilder() to construct. + private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequest() { + placement_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictRequest( + 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(); + + placement_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserEvent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 48: + { + validateOnly_ = input.readBool(); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + params_.getMutableMap().put(params__.getKey(), params__.getValue()); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + 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.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetParams(); + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictRequest.class, + com.google.cloud.retail.v2alpha.PredictRequest.Builder.class); + } + + public static final int PLACEMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object placement_; + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + @java.lang.Override + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + 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(); + placement_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.UserEvent userEvent_; + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + @java.lang.Override + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_; + /** + * + * + *
+   * Use validate only mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary products.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int PARAMS_FIELD_NUMBER = 7; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(placement_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_); + } + if (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 7); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + 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(placement_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_); + } + if (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, params__); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + 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.v2alpha.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PredictRequest other = + (com.google.cloud.retail.v2alpha.PredictRequest) obj; + + if (!getPlacement().equals(other.getPlacement())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) 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) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + if (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PredictRequest) + com.google.cloud.retail.v2alpha.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetParams(); + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableParams(); + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictRequest.class, + com.google.cloud.retail.v2alpha.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PredictRequest.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(); + placement_ = ""; + + if (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + validateOnly_ = false; + + internalGetMutableParams().clear(); + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictRequest build() { + com.google.cloud.retail.v2alpha.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictRequest buildPartial() { + com.google.cloud.retail.v2alpha.PredictRequest result = + new com.google.cloud.retail.v2alpha.PredictRequest(this); + int from_bitField0_ = bitField0_; + result.placement_ = placement_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.validateOnly_ = validateOnly_; + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + 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.v2alpha.PredictRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.PredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PredictRequest other) { + if (other == com.google.cloud.retail.v2alpha.PredictRequest.getDefaultInstance()) return this; + if (!other.getPlacement().isEmpty()) { + placement_ = other.placement_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + 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.v2alpha.PredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.PredictRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placement_ = ""; + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placement to set. + * @return This builder for chaining. + */ + public Builder setPlacement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placement_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlacement() { + + placement_ = getDefaultInstance().getPlacement(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for placement to set. + * @return This builder for chaining. + */ + public Builder setPlacementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placement_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.retail.v2alpha.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2alpha.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.retail.v2alpha.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + private com.google.protobuf.MapField + internalGetMutableParams() { + onChanged(); + ; + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParams() { + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableParams().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder putParams(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableParams().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PredictRequest) + private static final com.google.cloud.retail.v2alpha.PredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PredictRequest(); + } + + public static com.google.cloud.retail.v2alpha.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictRequest(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.v2alpha.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequestOrBuilder.java new file mode 100644 index 00000000..f3423fbc --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictRequestOrBuilder.java @@ -0,0 +1,538 @@ +/* + * 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/v2alpha/prediction_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface PredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + java.lang.String getPlacement(); + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + com.google.protobuf.ByteString getPlacementBytes(); + + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.retail.v2alpha.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.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.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Use validate only mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary products.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + + /* nullable */ + com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + com.google.protobuf.Value getParamsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponse.java new file mode 100644 index 00000000..52e570d5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponse.java @@ -0,0 +1,2734 @@ +/* + * 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/v2alpha/prediction_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response message for predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictResponse} + */ +public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PredictResponse) + PredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictResponse.newBuilder() to construct. + private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictResponse() { + results_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictResponse( + 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)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + missingIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + missingIds_.add(s); + break; + } + case 32: + { + validateOnly_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + missingIds_ = missingIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictResponse.class, + com.google.cloud.retail.v2alpha.PredictResponse.Builder.class); + } + + public interface PredictionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + int getMetadataCount(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + + /* nullable */ + com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + com.google.protobuf.Value getMetadataOrThrow(java.lang.String key); + } + /** + * + * + *
+   * PredictionResult represents the recommendation prediction results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictResponse.PredictionResult} + */ + public static final class PredictionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + PredictionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictionResult.newBuilder() to construct. + private PredictionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictionResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictionResult( + 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(); + + id_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + 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.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.class, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 2; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__); + } + 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.v2alpha.PredictResponse.PredictionResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult other = + (com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) obj; + + if (!getId().equals(other.getId())) return false; + if (!internalGetMetadata().equals(other.internalGetMetadata())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult 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; + } + /** + * + * + *
+     * PredictionResult represents the recommendation prediction results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictResponse.PredictionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.class, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.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(); + id_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult build() { + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult buildPartial() { + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult result = + new com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + 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.v2alpha.PredictResponse.PredictionResult) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult other) { + if (other + == com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + 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.v2alpha.PredictResponse.PredictionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder putMetadata(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + private static final com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictionResult(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.v2alpha.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List results_; + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MISSING_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList missingIds_; + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + return missingIds_; + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + public java.lang.String getMissingIds(int index) { + return missingIds_.get(index); + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + public com.google.protobuf.ByteString getMissingIdsBytes(int index) { + return missingIds_.getByteString(index); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_; + /** + * + * + *
+   * True if the validateOnly property was set in the request.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributionToken_); + } + for (int i = 0; i < missingIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, missingIds_.getRaw(i)); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributionToken_); + } + { + int dataSize = 0; + for (int i = 0; i < missingIds_.size(); i++) { + dataSize += computeStringSizeNoTag(missingIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getMissingIdsList().size(); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.v2alpha.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PredictResponse other = + (com.google.cloud.retail.v2alpha.PredictResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getMissingIdsList().equals(other.getMissingIdsList())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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 (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getMissingIdsCount() > 0) { + hash = (37 * hash) + MISSING_IDS_FIELD_NUMBER; + hash = (53 * hash) + getMissingIdsList().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PredictResponse 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 message for predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PredictResponse) + com.google.cloud.retail.v2alpha.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PredictResponse.class, + com.google.cloud.retail.v2alpha.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PredictResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + attributionToken_ = ""; + + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PredictionServiceProto + .internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse build() { + com.google.cloud.retail.v2alpha.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PredictResponse buildPartial() { + com.google.cloud.retail.v2alpha.PredictResponse result = + new com.google.cloud.retail.v2alpha.PredictResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.attributionToken_ = attributionToken_; + if (((bitField0_ & 0x00000002) != 0)) { + missingIds_ = missingIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.missingIds_ = missingIds_; + result.validateOnly_ = validateOnly_; + 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.v2alpha.PredictResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.PredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PredictResponse other) { + if (other == com.google.cloud.retail.v2alpha.PredictResponse.getDefaultInstance()) + return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (!other.missingIds_.isEmpty()) { + if (missingIds_.isEmpty()) { + missingIds_ = other.missingIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMissingIdsIsMutable(); + missingIds_.addAll(other.missingIds_); + } + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.v2alpha.PredictResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.PredictResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult>(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList missingIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMissingIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + missingIds_ = new com.google.protobuf.LazyStringArrayList(missingIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + return missingIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + public java.lang.String getMissingIds(int index) { + return missingIds_.get(index); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + public com.google.protobuf.ByteString getMissingIdsBytes(int index) { + return missingIds_.getByteString(index); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index to set the value at. + * @param value The missingIds to set. + * @return This builder for chaining. + */ + public Builder setMissingIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingIdsIsMutable(); + missingIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param value The missingIds to add. + * @return This builder for chaining. + */ + public Builder addMissingIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingIdsIsMutable(); + missingIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param values The missingIds to add. + * @return This builder for chaining. + */ + public Builder addAllMissingIds(java.lang.Iterable values) { + ensureMissingIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, missingIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearMissingIds() { + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param value The bytes of the missingIds to add. + * @return This builder for chaining. + */ + public Builder addMissingIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMissingIdsIsMutable(); + missingIds_.add(value); + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = 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.v2alpha.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PredictResponse) + private static final com.google.cloud.retail.v2alpha.PredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PredictResponse(); + } + + public static com.google.cloud.retail.v2alpha.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictResponse(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.v2alpha.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponseOrBuilder.java new file mode 100644 index 00000000..20c60d55 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictResponseOrBuilder.java @@ -0,0 +1,184 @@ +/* + * 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/v2alpha/prediction_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface PredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + java.util.List getResultsList(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResult getResults(int index); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + int getResultsCount(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder> + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.PredictResponse.PredictionResult results = 1; + * + */ + com.google.cloud.retail.v2alpha.PredictResponse.PredictionResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + java.util.List getMissingIdsList(); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + int getMissingIdsCount(); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + java.lang.String getMissingIds(int index); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + com.google.protobuf.ByteString getMissingIdsBytes(int index); + + /** + * + * + *
+   * True if the validateOnly property was set in the request.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceProto.java new file mode 100644 index 00000000..d5a84b10 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceProto.java @@ -0,0 +1,193 @@ +/* + * 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/v2alpha/prediction_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class PredictionServiceProto { + private PredictionServiceProto() {} + + 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_v2alpha_PredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/retail/v2alpha/prediction" + + "_service.proto\022\033google.cloud.retail.v2al" + + "pha\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032,google/cloud/retail/v2alpha" + + "/user_event.proto\032\034google/protobuf/struc" + + "t.proto\"\277\003\n\016PredictRequest\022\026\n\tplacement\030" + + "\001 \001(\tB\003\340A\002\022?\n\nuser_event\030\002 \001(\0132&.google." + + "cloud.retail.v2alpha.UserEventB\003\340A\002\022\021\n\tp" + + "age_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\022\016\n\006fi" + + "lter\030\005 \001(\t\022\025\n\rvalidate_only\030\006 \001(\010\022G\n\006par" + + "ams\030\007 \003(\01327.google.cloud.retail.v2alpha." + + "PredictRequest.ParamsEntry\022G\n\006labels\030\010 \003" + + "(\01327.google.cloud.retail.v2alpha.Predict" + + "Request.LabelsEntry\032E\n\013ParamsEntry\022\013\n\003ke" + + "y\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\005value\030\002 \001(\t:\0028\001\"\361\002\n\017PredictResponse\022N\n" + + "\007results\030\001 \003(\0132=.google.cloud.retail.v2a" + + "lpha.PredictResponse.PredictionResult\022\031\n" + + "\021attribution_token\030\002 \001(\t\022\023\n\013missing_ids\030" + + "\003 \003(\t\022\025\n\rvalidate_only\030\004 \001(\010\032\306\001\n\020Predict" + + "ionResult\022\n\n\002id\030\001 \001(\t\022]\n\010metadata\030\002 \003(\0132" + + "K.google.cloud.retail.v2alpha.PredictRes" + + "ponse.PredictionResult.MetadataEntry\032G\n\r" + + "MetadataEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(" + + "\0132\026.google.protobuf.Value:\0028\0012\235\002\n\021Predic" + + "tionService\022\274\001\n\007Predict\022+.google.cloud.r" + + "etail.v2alpha.PredictRequest\032,.google.cl" + + "oud.retail.v2alpha.PredictResponse\"V\202\323\344\223" + + "\002P\"K/v2alpha/{placement=projects/*/locat" + + "ions/*/catalogs/*/placements/*}:predict:" + + "\001*\032I\312A\025retail.googleapis.com\322A.https://w" + + "ww.googleapis.com/auth/cloud-platformB\344\001" + + "\n\037com.google.cloud.retail.v2alphaB\026Predi" + + "ctionServiceProtoP\001ZAgoogle.golang.org/g" + + "enproto/googleapis/cloud/retail/v2alpha;" + + "retail\242\002\006RETAIL\252\002\033Google.Cloud.Retail.V2" + + "Alpha\312\002\033Google\\Cloud\\Retail\\V2alpha\352\002\036Go" + + "ogle::Cloud::Retail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.retail.v2alpha.UserEventProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_PredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor, + new java.lang.String[] { + "Placement", + "UserEvent", + "PageSize", + "PageToken", + "Filter", + "ValidateOnly", + "Params", + "Labels", + }); + internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_PredictRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_PredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor, + new java.lang.String[] { + "Results", "AttributionToken", "MissingIds", "ValidateOnly", + }); + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor = + internal_static_google_cloud_retail_v2alpha_PredictResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor, + new java.lang.String[] { + "Id", "Metadata", + }); + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PredictResponse_PredictionResult_MetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + 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.oauthScopes); + 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.cloud.retail.v2alpha.UserEventProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfo.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfo.java new file mode 100644 index 00000000..0e118ccf --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfo.java @@ -0,0 +1,3497 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The price information of a [Product][google.cloud.retail.v2alpha.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PriceInfo} + */ +public final class PriceInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PriceInfo) + PriceInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceInfo.newBuilder() to construct. + private PriceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PriceInfo() { + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PriceInfo( + 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(); + + currencyCode_ = s; + break; + } + case 21: + { + price_ = input.readFloat(); + break; + } + case 29: + { + originalPrice_ = input.readFloat(); + break; + } + case 37: + { + cost_ = input.readFloat(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceEffectiveTime_ != null) { + subBuilder = priceEffectiveTime_.toBuilder(); + } + priceEffectiveTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceEffectiveTime_); + priceEffectiveTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceExpireTime_ != null) { + subBuilder = priceExpireTime_.toBuilder(); + } + priceExpireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceExpireTime_); + priceExpireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder subBuilder = null; + if (priceRange_ != null) { + subBuilder = priceRange_.toBuilder(); + } + priceRange_ = + input.readMessage( + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceRange_); + priceRange_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PriceInfo.class, + com.google.cloud.retail.v2alpha.PriceInfo.Builder.class); + } + + public interface PriceRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PriceInfo.PriceRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return Whether the price field is set. + */ + boolean hasPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return The price. + */ + com.google.cloud.retail.v2alpha.Interval getPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + com.google.cloud.retail.v2alpha.IntervalOrBuilder getPriceOrBuilder(); + + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + boolean hasOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return The originalPrice. + */ + com.google.cloud.retail.v2alpha.Interval getOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + com.google.cloud.retail.v2alpha.IntervalOrBuilder getOriginalPriceOrBuilder(); + } + /** + * + * + *
+   * The price range of all
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product] having the same
+   * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PriceInfo.PriceRange} + */ + public static final class PriceRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PriceInfo.PriceRange) + PriceRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceRange.newBuilder() to construct. + private PriceRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PriceRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PriceRange( + 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.v2alpha.Interval.Builder subBuilder = null; + if (price_ != null) { + subBuilder = price_.toBuilder(); + } + price_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(price_); + price_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.Interval.Builder subBuilder = null; + if (originalPrice_ != null) { + subBuilder = originalPrice_.toBuilder(); + } + originalPrice_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(originalPrice_); + originalPrice_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder.class); + } + + public static final int PRICE_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Interval price_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return Whether the price field is set. + */ + @java.lang.Override + public boolean hasPrice() { + return price_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return The price. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getPrice() { + return price_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : price_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getPriceOrBuilder() { + return getPrice(); + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.Interval originalPrice_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + @java.lang.Override + public boolean hasOriginalPrice() { + return originalPrice_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return The originalPrice. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getOriginalPrice() { + return originalPrice_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : originalPrice_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getOriginalPriceOrBuilder() { + return getOriginalPrice(); + } + + 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 (price_ != null) { + output.writeMessage(1, getPrice()); + } + if (originalPrice_ != null) { + output.writeMessage(2, getOriginalPrice()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (price_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPrice()); + } + if (originalPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOriginalPrice()); + } + 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.v2alpha.PriceInfo.PriceRange)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange other = + (com.google.cloud.retail.v2alpha.PriceInfo.PriceRange) obj; + + if (hasPrice() != other.hasPrice()) return false; + if (hasPrice()) { + if (!getPrice().equals(other.getPrice())) return false; + } + if (hasOriginalPrice() != other.hasOriginalPrice()) return false; + if (hasOriginalPrice()) { + if (!getOriginalPrice().equals(other.getOriginalPrice())) 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 (hasPrice()) { + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + getPrice().hashCode(); + } + if (hasOriginalPrice()) { + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalPrice().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The price range of all
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PriceInfo.PriceRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PriceInfo.PriceRange) + com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.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 (priceBuilder_ == null) { + price_ = null; + } else { + price_ = null; + priceBuilder_ = null; + } + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange build() { + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange buildPartial() { + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange result = + new com.google.cloud.retail.v2alpha.PriceInfo.PriceRange(this); + if (priceBuilder_ == null) { + result.price_ = price_; + } else { + result.price_ = priceBuilder_.build(); + } + if (originalPriceBuilder_ == null) { + result.originalPrice_ = originalPrice_; + } else { + result.originalPrice_ = originalPriceBuilder_.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.v2alpha.PriceInfo.PriceRange) { + return mergeFrom((com.google.cloud.retail.v2alpha.PriceInfo.PriceRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PriceInfo.PriceRange other) { + if (other == com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.getDefaultInstance()) + return this; + if (other.hasPrice()) { + mergePrice(other.getPrice()); + } + if (other.hasOriginalPrice()) { + mergeOriginalPrice(other.getOriginalPrice()); + } + 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.v2alpha.PriceInfo.PriceRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PriceInfo.PriceRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Interval price_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + priceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return Whether the price field is set. + */ + public boolean hasPrice() { + return priceBuilder_ != null || price_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + * + * @return The price. + */ + public com.google.cloud.retail.v2alpha.Interval getPrice() { + if (priceBuilder_ == null) { + return price_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : price_; + } else { + return priceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2alpha.Interval value) { + if (priceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + onChanged(); + } else { + priceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (priceBuilder_ == null) { + price_ = builderForValue.build(); + onChanged(); + } else { + priceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public Builder mergePrice(com.google.cloud.retail.v2alpha.Interval value) { + if (priceBuilder_ == null) { + if (price_ != null) { + price_ = + com.google.cloud.retail.v2alpha.Interval.newBuilder(price_) + .mergeFrom(value) + .buildPartial(); + } else { + price_ = value; + } + onChanged(); + } else { + priceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public Builder clearPrice() { + if (priceBuilder_ == null) { + price_ = null; + onChanged(); + } else { + price_ = null; + priceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder getPriceBuilder() { + + onChanged(); + return getPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getPriceOrBuilder() { + if (priceBuilder_ != null) { + return priceBuilder_.getMessageOrBuilder(); + } else { + return price_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : price_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval price = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + getPriceFieldBuilder() { + if (priceBuilder_ == null) { + priceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder>( + getPrice(), getParentForChildren(), isClean()); + price_ = null; + } + return priceBuilder_; + } + + private com.google.cloud.retail.v2alpha.Interval originalPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + originalPriceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + public boolean hasOriginalPrice() { + return originalPriceBuilder_ != null || originalPrice_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + * + * @return The originalPrice. + */ + public com.google.cloud.retail.v2alpha.Interval getOriginalPrice() { + if (originalPriceBuilder_ == null) { + return originalPrice_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : originalPrice_; + } else { + return originalPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public Builder setOriginalPrice(com.google.cloud.retail.v2alpha.Interval value) { + if (originalPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalPrice_ = value; + onChanged(); + } else { + originalPriceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public Builder setOriginalPrice( + com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (originalPriceBuilder_ == null) { + originalPrice_ = builderForValue.build(); + onChanged(); + } else { + originalPriceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public Builder mergeOriginalPrice(com.google.cloud.retail.v2alpha.Interval value) { + if (originalPriceBuilder_ == null) { + if (originalPrice_ != null) { + originalPrice_ = + com.google.cloud.retail.v2alpha.Interval.newBuilder(originalPrice_) + .mergeFrom(value) + .buildPartial(); + } else { + originalPrice_ = value; + } + onChanged(); + } else { + originalPriceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public Builder clearOriginalPrice() { + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + onChanged(); + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder getOriginalPriceBuilder() { + + onChanged(); + return getOriginalPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getOriginalPriceOrBuilder() { + if (originalPriceBuilder_ != null) { + return originalPriceBuilder_.getMessageOrBuilder(); + } else { + return originalPrice_ == null + ? com.google.cloud.retail.v2alpha.Interval.getDefaultInstance() + : originalPrice_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval original_price = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + getOriginalPriceFieldBuilder() { + if (originalPriceBuilder_ == null) { + originalPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder>( + getOriginalPrice(), getParentForChildren(), isClean()); + originalPrice_ = null; + } + return originalPriceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PriceInfo.PriceRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PriceInfo.PriceRange) + private static final com.google.cloud.retail.v2alpha.PriceInfo.PriceRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PriceInfo.PriceRange(); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo.PriceRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceRange(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.v2alpha.PriceInfo.PriceRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_FIELD_NUMBER = 2; + private float price_; + /** + * + * + *
+   * Price of the product.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+   * property [Offer.price](https://schema.org/price).
+   * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 3; + private float originalPrice_; + /** + * + * + *
+   * Price of the product without any discount. If zero, by default set to be
+   * the [price][google.cloud.retail.v2alpha.PriceInfo.price].
+   * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + @java.lang.Override + public float getOriginalPrice() { + return originalPrice_; + } + + public static final int COST_FIELD_NUMBER = 4; + private float cost_; + /** + * + * + *
+   * The costs associated with the sale of a particular product. Used for gross
+   * profit reporting.
+   * * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] -
+   * [cost][google.cloud.retail.v2alpha.PriceInfo.cost]
+   * Google Merchant Center property
+   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int PRICE_EFFECTIVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp priceEffectiveTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + @java.lang.Override + public boolean hasPriceEffectiveTime() { + return priceEffectiveTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + return getPriceEffectiveTime(); + } + + public static final int PRICE_EXPIRE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp priceExpireTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + @java.lang.Override + public boolean hasPriceExpireTime() { + return priceExpireTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceExpireTime() { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + return getPriceExpireTime(); + } + + public static final int PRICE_RANGE_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2alpha.PriceInfo.PriceRange priceRange_; + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + @java.lang.Override + public boolean hasPriceRange() { + return priceRange_ != null; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange getPriceRange() { + return priceRange_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + return getPriceRange(); + } + + 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(currencyCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currencyCode_); + } + if (java.lang.Float.floatToRawIntBits(price_) != 0) { + output.writeFloat(2, price_); + } + if (java.lang.Float.floatToRawIntBits(originalPrice_) != 0) { + output.writeFloat(3, originalPrice_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + output.writeFloat(4, cost_); + } + if (priceEffectiveTime_ != null) { + output.writeMessage(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + output.writeMessage(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + output.writeMessage(7, getPriceRange()); + } + 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(currencyCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currencyCode_); + } + if (java.lang.Float.floatToRawIntBits(price_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, price_); + } + if (java.lang.Float.floatToRawIntBits(originalPrice_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalPrice_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + } + if (priceEffectiveTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPriceRange()); + } + 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.v2alpha.PriceInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PriceInfo other = + (com.google.cloud.retail.v2alpha.PriceInfo) obj; + + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + if (java.lang.Float.floatToIntBits(getPrice()) + != java.lang.Float.floatToIntBits(other.getPrice())) return false; + if (java.lang.Float.floatToIntBits(getOriginalPrice()) + != java.lang.Float.floatToIntBits(other.getOriginalPrice())) return false; + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + if (hasPriceEffectiveTime() != other.hasPriceEffectiveTime()) return false; + if (hasPriceEffectiveTime()) { + if (!getPriceEffectiveTime().equals(other.getPriceEffectiveTime())) return false; + } + if (hasPriceExpireTime() != other.hasPriceExpireTime()) return false; + if (hasPriceExpireTime()) { + if (!getPriceExpireTime().equals(other.getPriceExpireTime())) return false; + } + if (hasPriceRange() != other.hasPriceRange()) return false; + if (hasPriceRange()) { + if (!getPriceRange().equals(other.getPriceRange())) 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) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrice()); + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + if (hasPriceEffectiveTime()) { + hash = (37 * hash) + PRICE_EFFECTIVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceEffectiveTime().hashCode(); + } + if (hasPriceExpireTime()) { + hash = (37 * hash) + PRICE_EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceExpireTime().hashCode(); + } + if (hasPriceRange()) { + hash = (37 * hash) + PRICE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getPriceRange().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PriceInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The price information of a [Product][google.cloud.retail.v2alpha.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PriceInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PriceInfo) + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PriceInfo.class, + com.google.cloud.retail.v2alpha.PriceInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PriceInfo.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(); + currencyCode_ = ""; + + price_ = 0F; + + originalPrice_ = 0F; + + cost_ = 0F; + + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + if (priceRangeBuilder_ == null) { + priceRange_ = null; + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_PriceInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo build() { + com.google.cloud.retail.v2alpha.PriceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo buildPartial() { + com.google.cloud.retail.v2alpha.PriceInfo result = + new com.google.cloud.retail.v2alpha.PriceInfo(this); + result.currencyCode_ = currencyCode_; + result.price_ = price_; + result.originalPrice_ = originalPrice_; + result.cost_ = cost_; + if (priceEffectiveTimeBuilder_ == null) { + result.priceEffectiveTime_ = priceEffectiveTime_; + } else { + result.priceEffectiveTime_ = priceEffectiveTimeBuilder_.build(); + } + if (priceExpireTimeBuilder_ == null) { + result.priceExpireTime_ = priceExpireTime_; + } else { + result.priceExpireTime_ = priceExpireTimeBuilder_.build(); + } + if (priceRangeBuilder_ == null) { + result.priceRange_ = priceRange_; + } else { + result.priceRange_ = priceRangeBuilder_.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.v2alpha.PriceInfo) { + return mergeFrom((com.google.cloud.retail.v2alpha.PriceInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PriceInfo other) { + if (other == com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance()) return this; + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + if (other.getPrice() != 0F) { + setPrice(other.getPrice()); + } + if (other.getOriginalPrice() != 0F) { + setOriginalPrice(other.getOriginalPrice()); + } + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (other.hasPriceEffectiveTime()) { + mergePriceEffectiveTime(other.getPriceEffectiveTime()); + } + if (other.hasPriceExpireTime()) { + mergePriceExpireTime(other.getPriceExpireTime()); + } + if (other.hasPriceRange()) { + mergePriceRange(other.getPriceRange()); + } + 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.v2alpha.PriceInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.PriceInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = value; + onChanged(); + return this; + } + + private float price_; + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @param value The price to set. + * @return This builder for chaining. + */ + public Builder setPrice(float value) { + + price_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrice() { + + price_ = 0F; + onChanged(); + return this; + } + + private float originalPrice_; + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2alpha.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + @java.lang.Override + public float getOriginalPrice() { + return originalPrice_; + } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2alpha.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @param value The originalPrice to set. + * @return This builder for chaining. + */ + public Builder setOriginalPrice(float value) { + + originalPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2alpha.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return This builder for chaining. + */ + public Builder clearOriginalPrice() { + + originalPrice_ = 0F; + onChanged(); + return this; + } + + private float cost_; + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2alpha.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2alpha.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2alpha.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + + cost_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp priceEffectiveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceEffectiveTimeBuilder_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + public boolean hasPriceEffectiveTime() { + return priceEffectiveTimeBuilder_ != null || priceEffectiveTime_ != null; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } else { + return priceEffectiveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceEffectiveTime_ = value; + onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = builderForValue.build(); + onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder mergePriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (priceEffectiveTime_ != null) { + priceEffectiveTime_ = + com.google.protobuf.Timestamp.newBuilder(priceEffectiveTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceEffectiveTime_ = value; + } + onChanged(); + } else { + priceEffectiveTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder clearPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + onChanged(); + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getPriceEffectiveTimeBuilder() { + + onChanged(); + return getPriceEffectiveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + if (priceEffectiveTimeBuilder_ != null) { + return priceEffectiveTimeBuilder_.getMessageOrBuilder(); + } else { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+     * search after
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceEffectiveTimeFieldBuilder() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceEffectiveTime(), getParentForChildren(), isClean()); + priceEffectiveTime_ = null; + } + return priceEffectiveTimeBuilder_; + } + + private com.google.protobuf.Timestamp priceExpireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceExpireTimeBuilder_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + public boolean hasPriceExpireTime() { + return priceExpireTimeBuilder_ != null || priceExpireTime_ != null; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + public com.google.protobuf.Timestamp getPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } else { + return priceExpireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder setPriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceExpireTime_ = value; + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder setPriceExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = builderForValue.build(); + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder mergePriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (priceExpireTime_ != null) { + priceExpireTime_ = + com.google.protobuf.Timestamp.newBuilder(priceExpireTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceExpireTime_ = value; + } + onChanged(); + } else { + priceExpireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder clearPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + onChanged(); + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getPriceExpireTimeBuilder() { + + onChanged(); + return getPriceExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + if (priceExpireTimeBuilder_ != null) { + return priceExpireTimeBuilder_.getMessageOrBuilder(); + } else { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+     * always effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceExpireTimeFieldBuilder() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceExpireTime(), getParentForChildren(), isClean()); + priceExpireTime_ = null; + } + return priceExpireTimeBuilder_; + } + + private com.google.cloud.retail.v2alpha.PriceInfo.PriceRange priceRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder> + priceRangeBuilder_; + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + public boolean hasPriceRange() { + return priceRangeBuilder_ != null || priceRange_ != null; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange getPriceRange() { + if (priceRangeBuilder_ == null) { + return priceRange_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } else { + return priceRangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPriceRange(com.google.cloud.retail.v2alpha.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceRange_ = value; + onChanged(); + } else { + priceRangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPriceRange( + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder builderForValue) { + if (priceRangeBuilder_ == null) { + priceRange_ = builderForValue.build(); + onChanged(); + } else { + priceRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePriceRange(com.google.cloud.retail.v2alpha.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (priceRange_ != null) { + priceRange_ = + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.newBuilder(priceRange_) + .mergeFrom(value) + .buildPartial(); + } else { + priceRange_ = value; + } + onChanged(); + } else { + priceRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPriceRange() { + if (priceRangeBuilder_ == null) { + priceRange_ = null; + onChanged(); + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder getPriceRangeBuilder() { + + onChanged(); + return getPriceRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + if (priceRangeBuilder_ != null) { + return priceRangeBuilder_.getMessageOrBuilder(); + } else { + return priceRange_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder> + getPriceRangeFieldBuilder() { + if (priceRangeBuilder_ == null) { + priceRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder>( + getPriceRange(), getParentForChildren(), isClean()); + priceRange_ = null; + } + return priceRangeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PriceInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PriceInfo) + private static final com.google.cloud.retail.v2alpha.PriceInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PriceInfo(); + } + + public static com.google.cloud.retail.v2alpha.PriceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceInfo(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.v2alpha.PriceInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfoOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfoOrBuilder.java new file mode 100644 index 00000000..b60e35f3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PriceInfoOrBuilder.java @@ -0,0 +1,328 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface PriceInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PriceInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); + + /** + * + * + *
+   * Price of the product.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+   * property [Offer.price](https://schema.org/price).
+   * 
+ * + * float price = 2; + * + * @return The price. + */ + float getPrice(); + + /** + * + * + *
+   * Price of the product without any discount. If zero, by default set to be
+   * the [price][google.cloud.retail.v2alpha.PriceInfo.price].
+   * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + float getOriginalPrice(); + + /** + * + * + *
+   * The costs associated with the sale of a particular product. Used for gross
+   * profit reporting.
+   * * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] -
+   * [cost][google.cloud.retail.v2alpha.PriceInfo.cost]
+   * Google Merchant Center property
+   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + float getCost(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + boolean hasPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + com.google.protobuf.Timestamp getPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
+   * search after
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + boolean hasPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + com.google.protobuf.Timestamp getPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
+   * always effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + boolean hasPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + com.google.cloud.retail.v2alpha.PriceInfo.PriceRange getPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Product.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Product.java new file mode 100644 index 00000000..0ed408fe --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Product.java @@ -0,0 +1,13510 @@ +/* + * 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/v2alpha/product.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Product captures all metadata information of items to be recommended or
+ * searched.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Product) + ProductOrBuilder { + private static final long serialVersionUID = 0L; + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Product() { + name_ = ""; + id_ = ""; + type_ = 0; + primaryProductId_ = ""; + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + gtin_ = ""; + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + title_ = ""; + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + description_ = ""; + languageCode_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + availability_ = 0; + fulfillmentInfo_ = java.util.Collections.emptyList(); + uri_ = ""; + images_ = java.util.Collections.emptyList(); + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + promotions_ = java.util.Collections.emptyList(); + variants_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Product(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Product( + 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(); + + id_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + primaryProductId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + collectionMemberIds_.add(s); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + gtin_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + categories_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + brands_.add(s); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + tags_.add(s); + break; + } + case 114: + { + com.google.cloud.retail.v2alpha.PriceInfo.Builder subBuilder = null; + if (priceInfo_ != null) { + subBuilder = priceInfo_.toBuilder(); + } + priceInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.PriceInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceInfo_); + priceInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + com.google.cloud.retail.v2alpha.Rating.Builder subBuilder = null; + if (rating_ != null) { + subBuilder = rating_.toBuilder(); + } + rating_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rating.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rating_); + rating_ = subBuilder.buildPartial(); + } + + break; + } + case 130: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expirationCase_ == 16) { + subBuilder = ((com.google.protobuf.Timestamp) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 16; + break; + } + case 138: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (expirationCase_ == 17) { + subBuilder = ((com.google.protobuf.Duration) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 17; + break; + } + case 146: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (availableTime_ != null) { + subBuilder = availableTime_.toBuilder(); + } + availableTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(availableTime_); + availableTime_ = subBuilder.buildPartial(); + } + + break; + } + case 152: + { + int rawValue = input.readEnum(); + + availability_ = rawValue; + break; + } + case 162: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (availableQuantity_ != null) { + subBuilder = availableQuantity_.toBuilder(); + } + availableQuantity_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(availableQuantity_); + availableQuantity_ = subBuilder.buildPartial(); + } + + break; + } + case 170: + { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + fulfillmentInfo_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.FulfillmentInfo.parser(), extensionRegistry)); + break; + } + case 178: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 186: + { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + images_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + images_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Image.parser(), extensionRegistry)); + break; + } + case 194: + { + com.google.cloud.retail.v2alpha.Audience.Builder subBuilder = null; + if (audience_ != null) { + subBuilder = audience_.toBuilder(); + } + audience_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Audience.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audience_); + audience_ = subBuilder.buildPartial(); + } + + break; + } + case 202: + { + com.google.cloud.retail.v2alpha.ColorInfo.Builder subBuilder = null; + if (colorInfo_ != null) { + subBuilder = colorInfo_.toBuilder(); + } + colorInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ColorInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(colorInfo_); + colorInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 210: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + sizes_.add(s); + break; + } + case 218: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + materials_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000200; + } + patterns_.add(s); + break; + } + case 234: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000400; + } + conditions_.add(s); + break; + } + case 242: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (retrievableFields_ != null) { + subBuilder = retrievableFields_.toBuilder(); + } + retrievableFields_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retrievableFields_); + retrievableFields_ = subBuilder.buildPartial(); + } + + break; + } + case 250: + { + if (!((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + variants_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry)); + break; + } + case 266: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (publishTime_ != null) { + subBuilder = publishTime_.toBuilder(); + } + publishTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(publishTime_); + publishTime_ = subBuilder.buildPartial(); + } + + break; + } + case 274: + { + if (!((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + promotions_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Promotion.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)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + categories_ = categories_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + tags_ = tags_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + } + if (((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Product.class, + com.google.cloud.retail.v2alpha.Product.Builder.class); + } + + /** + * + * + *
+   * The type of this product.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.Product.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The primary type.
+     * As the primary unit for predicting, indexing and search serving, a
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] is grouped with multiple
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * The variant type.
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s usually share some common
+     * attributes on the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, but they have variant
+     * attributes like different colors, sizes and prices, etc.
+     * 
+ * + * VARIANT = 2; + */ + VARIANT(2), + /** + * + * + *
+     * The collection type. Collection products are bundled
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s that are sold together,
+     * such as a jewelry set with necklaces, earrings and rings, etc.
+     * 
+ * + * COLLECTION = 3; + */ + COLLECTION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The primary type.
+     * As the primary unit for predicting, indexing and search serving, a
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] is grouped with multiple
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * The variant type.
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s usually share some common
+     * attributes on the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, but they have variant
+     * attributes like different colors, sizes and prices, etc.
+     * 
+ * + * VARIANT = 2; + */ + public static final int VARIANT_VALUE = 2; + /** + * + * + *
+     * The collection type. Collection products are bundled
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s that are sold together,
+     * such as a jewelry set with necklaces, earrings and rings, etc.
+     * 
+ * + * COLLECTION = 3; + */ + public static final int COLLECTION_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return VARIANT; + case 3: + return COLLECTION; + 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 Type findValueByNumber(int number) { + return Type.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.v2alpha.Product.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.Product.Type) + } + + /** + * + * + *
+   * Product availability. If this field is unspecified, the product is
+   * assumed to be in stock.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.Product.Availability} + */ + public enum Availability implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default product availability. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK]
+     * if unset.
+     * 
+ * + * AVAILABILITY_UNSPECIFIED = 0; + */ + AVAILABILITY_UNSPECIFIED(0), + /** + * + * + *
+     * Product in stock.
+     * 
+ * + * IN_STOCK = 1; + */ + IN_STOCK(1), + /** + * + * + *
+     * Product out of stock.
+     * 
+ * + * OUT_OF_STOCK = 2; + */ + OUT_OF_STOCK(2), + /** + * + * + *
+     * Product that is in pre-order state.
+     * 
+ * + * PREORDER = 3; + */ + PREORDER(3), + /** + * + * + *
+     * Product that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 4; + */ + BACKORDER(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default product availability. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK]
+     * if unset.
+     * 
+ * + * AVAILABILITY_UNSPECIFIED = 0; + */ + public static final int AVAILABILITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Product in stock.
+     * 
+ * + * IN_STOCK = 1; + */ + public static final int IN_STOCK_VALUE = 1; + /** + * + * + *
+     * Product out of stock.
+     * 
+ * + * OUT_OF_STOCK = 2; + */ + public static final int OUT_OF_STOCK_VALUE = 2; + /** + * + * + *
+     * Product that is in pre-order state.
+     * 
+ * + * PREORDER = 3; + */ + public static final int PREORDER_VALUE = 3; + /** + * + * + *
+     * Product that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 4; + */ + public static final int BACKORDER_VALUE = 4; + + 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 Availability 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 Availability forNumber(int value) { + switch (value) { + case 0: + return AVAILABILITY_UNSPECIFIED; + case 1: + return IN_STOCK; + case 2: + return OUT_OF_STOCK; + case 3: + return PREORDER; + case 4: + return BACKORDER; + 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 Availability findValueByNumber(int number) { + return Availability.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.v2alpha.Product.getDescriptor().getEnumTypes().get(1); + } + + private static final Availability[] VALUES = values(); + + public static Availability 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 Availability(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.Product.Availability) + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(16), + TTL(17), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 16: + return EXPIRE_TIME; + case 17: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 16; + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 17; + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2alpha.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2alpha.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.Product.Type result = + com.google.cloud.retail.v2alpha.Product.Type.valueOf(type_); + return result == null ? com.google.cloud.retail.v2alpha.Product.Type.UNRECOGNIZED : result; + } + + public static final int PRIMARY_PRODUCT_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object primaryProductId_; + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2alpha.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + @java.lang.Override + public java.lang.String getPrimaryProductId() { + java.lang.Object ref = primaryProductId_; + 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(); + primaryProductId_ = s; + return s; + } + } + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2alpha.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryProductIdBytes() { + java.lang.Object ref = primaryProductId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryProductId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLLECTION_MEMBER_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList collectionMemberIds_; + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_; + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + + public static final int GTIN_FIELD_NUMBER = 6; + private volatile java.lang.Object gtin_; + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + @java.lang.Override + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + 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(); + gtin_ = s; + return s; + } + } + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORIES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList categories_; + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + + public static final int TITLE_FIELD_NUMBER = 8; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANDS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList brands_; + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_; + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 10; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 11; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2alpha.Product] can include text in
+   * different languages, but duplicating
+   * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2alpha.Product] can include text in
+   * different languages, but duplicating
+   * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 12; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TAGS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int PRICE_INFO_FIELD_NUMBER = 14; + private com.google.cloud.retail.v2alpha.PriceInfo priceInfo_; + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + @java.lang.Override + public boolean hasPriceInfo() { + return priceInfo_ != null; + } + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo() { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder() { + return getPriceInfo(); + } + + public static final int RATING_FIELD_NUMBER = 15; + private com.google.cloud.retail.v2alpha.Rating rating_; + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + @java.lang.Override + public boolean hasRating() { + return rating_ != null; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return The rating. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rating getRating() { + return rating_ == null ? com.google.cloud.retail.v2alpha.Rating.getDefaultInstance() : rating_; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.RatingOrBuilder getRatingOrBuilder() { + return getRating(); + } + + public static final int AVAILABLE_TIME_FIELD_NUMBER = 18; + private com.google.protobuf.Timestamp availableTime_; + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + @java.lang.Override + public boolean hasAvailableTime() { + return availableTime_ != null; + } + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAvailableTime() { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { + return getAvailableTime(); + } + + public static final int AVAILABILITY_FIELD_NUMBER = 19; + private int availability_; + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2alpha.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + @java.lang.Override + public int getAvailabilityValue() { + return availability_; + } + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2alpha.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The availability. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product.Availability getAvailability() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.Product.Availability result = + com.google.cloud.retail.v2alpha.Product.Availability.valueOf(availability_); + return result == null + ? com.google.cloud.retail.v2alpha.Product.Availability.UNRECOGNIZED + : result; + } + + public static final int AVAILABLE_QUANTITY_FIELD_NUMBER = 20; + private com.google.protobuf.Int32Value availableQuantity_; + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + @java.lang.Override + public boolean hasAvailableQuantity() { + return availableQuantity_ != null; + } + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getAvailableQuantity() { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { + return getAvailableQuantity(); + } + + public static final int FULFILLMENT_INFO_FIELD_NUMBER = 21; + private java.util.List fulfillmentInfo_; + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public java.util.List getFulfillmentInfoList() { + return fulfillmentInfo_; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public java.util.List + getFulfillmentInfoOrBuilderList() { + return fulfillmentInfo_; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public int getFulfillmentInfoCount() { + return fulfillmentInfo_.size(); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.FulfillmentInfo getFulfillmentInfo(int index) { + return fulfillmentInfo_.get(index); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + return fulfillmentInfo_.get(index); + } + + public static final int URI_FIELD_NUMBER = 22; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGES_FIELD_NUMBER = 23; + private java.util.List images_; + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + @java.lang.Override + public java.util.List getImagesList() { + return images_; + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + @java.lang.Override + public java.util.List + getImagesOrBuilderList() { + return images_; + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + @java.lang.Override + public int getImagesCount() { + return images_.size(); + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Image getImages(int index) { + return images_.get(index); + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ImageOrBuilder getImagesOrBuilder(int index) { + return images_.get(index); + } + + public static final int AUDIENCE_FIELD_NUMBER = 24; + private com.google.cloud.retail.v2alpha.Audience audience_; + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + @java.lang.Override + public boolean hasAudience() { + return audience_ != null; + } + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return The audience. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Audience getAudience() { + return audience_ == null + ? com.google.cloud.retail.v2alpha.Audience.getDefaultInstance() + : audience_; + } + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.AudienceOrBuilder getAudienceOrBuilder() { + return getAudience(); + } + + public static final int COLOR_INFO_FIELD_NUMBER = 25; + private com.google.cloud.retail.v2alpha.ColorInfo colorInfo_; + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + @java.lang.Override + public boolean hasColorInfo() { + return colorInfo_ != null; + } + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ColorInfo getColorInfo() { + return colorInfo_ == null + ? com.google.cloud.retail.v2alpha.ColorInfo.getDefaultInstance() + : colorInfo_; + } + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ColorInfoOrBuilder getColorInfoOrBuilder() { + return getColorInfo(); + } + + public static final int SIZES_FIELD_NUMBER = 26; + private com.google.protobuf.LazyStringList sizes_; + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_; + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + public int getSizesCount() { + return sizes_.size(); + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + public java.lang.String getSizes(int index) { + return sizes_.get(index); + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); + } + + public static final int MATERIALS_FIELD_NUMBER = 27; + private com.google.protobuf.LazyStringList materials_; + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_; + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + + public static final int PATTERNS_FIELD_NUMBER = 28; + private com.google.protobuf.LazyStringList patterns_; + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_; + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + public int getPatternsCount() { + return patterns_.size(); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + public java.lang.String getPatterns(int index) { + return patterns_.get(index); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); + } + + public static final int CONDITIONS_FIELD_NUMBER = 29; + private com.google.protobuf.LazyStringList conditions_; + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + + public static final int PROMOTIONS_FIELD_NUMBER = 34; + private java.util.List promotions_; + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List getPromotionsList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List + getPromotionsOrBuilderList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + @java.lang.Override + public int getPromotionsCount() { + return promotions_.size(); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Promotion getPromotions(int index) { + return promotions_.get(index); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PromotionOrBuilder getPromotionsOrBuilder(int index) { + return promotions_.get(index); + } + + public static final int PUBLISH_TIME_FIELD_NUMBER = 33; + private com.google.protobuf.Timestamp publishTime_; + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + @java.lang.Override + public boolean hasPublishTime() { + return publishTime_ != null; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPublishTime() { + return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + return getPublishTime(); + } + + public static final int RETRIEVABLE_FIELDS_FIELD_NUMBER = 30; + private com.google.protobuf.FieldMask retrievableFields_; + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + @java.lang.Override + public boolean hasRetrievableFields() { + return retrievableFields_ != null; + } + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getRetrievableFields() { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + return getRetrievableFields(); + } + + public static final int VARIANTS_FIELD_NUMBER = 31; + private java.util.List variants_; + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getVariantsList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getVariantsOrBuilderList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getVariantsCount() { + return variants_.size(); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getVariants(int index) { + return variants_.get(index); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getVariantsOrBuilder(int index) { + return variants_.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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (type_ != com.google.cloud.retail.v2alpha.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryProductId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryProductId_); + } + for (int i = 0; i < collectionMemberIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, collectionMemberIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gtin_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, gtin_); + } + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, categories_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, title_); + } + for (int i = 0; i < brands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, brands_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, languageCode_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 12); + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, tags_.getRaw(i)); + } + if (priceInfo_ != null) { + output.writeMessage(14, getPriceInfo()); + } + if (rating_ != null) { + output.writeMessage(15, getRating()); + } + if (expirationCase_ == 16) { + output.writeMessage(16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + output.writeMessage(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2alpha.Product.Availability.AVAILABILITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(19, availability_); + } + if (availableQuantity_ != null) { + output.writeMessage(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + output.writeMessage(21, fulfillmentInfo_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + output.writeMessage(23, images_.get(i)); + } + if (audience_ != null) { + output.writeMessage(24, getAudience()); + } + if (colorInfo_ != null) { + output.writeMessage(25, getColorInfo()); + } + for (int i = 0; i < sizes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, sizes_.getRaw(i)); + } + for (int i = 0; i < materials_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, materials_.getRaw(i)); + } + for (int i = 0; i < patterns_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, patterns_.getRaw(i)); + } + for (int i = 0; i < conditions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 29, conditions_.getRaw(i)); + } + if (retrievableFields_ != null) { + output.writeMessage(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + output.writeMessage(31, variants_.get(i)); + } + if (publishTime_ != null) { + output.writeMessage(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + output.writeMessage(34, promotions_.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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (type_ != com.google.cloud.retail.v2alpha.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryProductId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryProductId_); + } + { + int dataSize = 0; + for (int i = 0; i < collectionMemberIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionMemberIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionMemberIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gtin_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, gtin_); + } + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, title_); + } + { + int dataSize = 0; + for (int i = 0; i < brands_.size(); i++) { + dataSize += computeStringSizeNoTag(brands_.getRaw(i)); + } + size += dataSize; + size += 1 * getBrandsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, languageCode_); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, attributes__); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (priceInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPriceInfo()); + } + if (rating_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getRating()); + } + if (expirationCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2alpha.Product.Availability.AVAILABILITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, availability_); + } + if (availableQuantity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, fulfillmentInfo_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, images_.get(i)); + } + if (audience_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getAudience()); + } + if (colorInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getColorInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < sizes_.size(); i++) { + dataSize += computeStringSizeNoTag(sizes_.getRaw(i)); + } + size += dataSize; + size += 2 * getSizesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < materials_.size(); i++) { + dataSize += computeStringSizeNoTag(materials_.getRaw(i)); + } + size += dataSize; + size += 2 * getMaterialsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < patterns_.size(); i++) { + dataSize += computeStringSizeNoTag(patterns_.getRaw(i)); + } + size += dataSize; + size += 2 * getPatternsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < conditions_.size(); i++) { + dataSize += computeStringSizeNoTag(conditions_.getRaw(i)); + } + size += dataSize; + size += 2 * getConditionsList().size(); + } + if (retrievableFields_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(31, variants_.get(i)); + } + if (publishTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, promotions_.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.v2alpha.Product)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Product other = (com.google.cloud.retail.v2alpha.Product) obj; + + if (!getName().equals(other.getName())) return false; + if (!getId().equals(other.getId())) return false; + if (type_ != other.type_) return false; + if (!getPrimaryProductId().equals(other.getPrimaryProductId())) return false; + if (!getCollectionMemberIdsList().equals(other.getCollectionMemberIdsList())) return false; + if (!getGtin().equals(other.getGtin())) return false; + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getBrandsList().equals(other.getBrandsList())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (hasPriceInfo() != other.hasPriceInfo()) return false; + if (hasPriceInfo()) { + if (!getPriceInfo().equals(other.getPriceInfo())) return false; + } + if (hasRating() != other.hasRating()) return false; + if (hasRating()) { + if (!getRating().equals(other.getRating())) return false; + } + if (hasAvailableTime() != other.hasAvailableTime()) return false; + if (hasAvailableTime()) { + if (!getAvailableTime().equals(other.getAvailableTime())) return false; + } + if (availability_ != other.availability_) return false; + if (hasAvailableQuantity() != other.hasAvailableQuantity()) return false; + if (hasAvailableQuantity()) { + if (!getAvailableQuantity().equals(other.getAvailableQuantity())) return false; + } + if (!getFulfillmentInfoList().equals(other.getFulfillmentInfoList())) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getImagesList().equals(other.getImagesList())) return false; + if (hasAudience() != other.hasAudience()) return false; + if (hasAudience()) { + if (!getAudience().equals(other.getAudience())) return false; + } + if (hasColorInfo() != other.hasColorInfo()) return false; + if (hasColorInfo()) { + if (!getColorInfo().equals(other.getColorInfo())) return false; + } + if (!getSizesList().equals(other.getSizesList())) return false; + if (!getMaterialsList().equals(other.getMaterialsList())) return false; + if (!getPatternsList().equals(other.getPatternsList())) return false; + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (!getPromotionsList().equals(other.getPromotionsList())) return false; + if (hasPublishTime() != other.hasPublishTime()) return false; + if (hasPublishTime()) { + if (!getPublishTime().equals(other.getPublishTime())) return false; + } + if (hasRetrievableFields() != other.hasRetrievableFields()) return false; + if (hasRetrievableFields()) { + if (!getRetrievableFields().equals(other.getRetrievableFields())) return false; + } + if (!getVariantsList().equals(other.getVariantsList())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 16: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 17: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + PRIMARY_PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryProductId().hashCode(); + if (getCollectionMemberIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_MEMBER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionMemberIdsList().hashCode(); + } + hash = (37 * hash) + GTIN_FIELD_NUMBER; + hash = (53 * hash) + getGtin().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + if (getBrandsCount() > 0) { + hash = (37 * hash) + BRANDS_FIELD_NUMBER; + hash = (53 * hash) + getBrandsList().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + if (hasPriceInfo()) { + hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPriceInfo().hashCode(); + } + if (hasRating()) { + hash = (37 * hash) + RATING_FIELD_NUMBER; + hash = (53 * hash) + getRating().hashCode(); + } + if (hasAvailableTime()) { + hash = (37 * hash) + AVAILABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAvailableTime().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + availability_; + if (hasAvailableQuantity()) { + hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableQuantity().hashCode(); + } + if (getFulfillmentInfoCount() > 0) { + hash = (37 * hash) + FULFILLMENT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentInfoList().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getImagesCount() > 0) { + hash = (37 * hash) + IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getImagesList().hashCode(); + } + if (hasAudience()) { + hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; + hash = (53 * hash) + getAudience().hashCode(); + } + if (hasColorInfo()) { + hash = (37 * hash) + COLOR_INFO_FIELD_NUMBER; + hash = (53 * hash) + getColorInfo().hashCode(); + } + if (getSizesCount() > 0) { + hash = (37 * hash) + SIZES_FIELD_NUMBER; + hash = (53 * hash) + getSizesList().hashCode(); + } + if (getMaterialsCount() > 0) { + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + getMaterialsList().hashCode(); + } + if (getPatternsCount() > 0) { + hash = (37 * hash) + PATTERNS_FIELD_NUMBER; + hash = (53 * hash) + getPatternsList().hashCode(); + } + if (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + if (getPromotionsCount() > 0) { + hash = (37 * hash) + PROMOTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPromotionsList().hashCode(); + } + if (hasPublishTime()) { + hash = (37 * hash) + PUBLISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPublishTime().hashCode(); + } + if (hasRetrievableFields()) { + hash = (37 * hash) + RETRIEVABLE_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getRetrievableFields().hashCode(); + } + if (getVariantsCount() > 0) { + hash = (37 * hash) + VARIANTS_FIELD_NUMBER; + hash = (53 * hash) + getVariantsList().hashCode(); + } + switch (expirationCase_) { + case 16: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 17: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Product parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Product parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Product parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Product 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; + } + /** + * + * + *
+   * Product captures all metadata information of items to be recommended or
+   * searched.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Product) + com.google.cloud.retail.v2alpha.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 12: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Product.class, + com.google.cloud.retail.v2alpha.Product.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Product.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFulfillmentInfoFieldBuilder(); + getImagesFieldBuilder(); + getPromotionsFieldBuilder(); + getVariantsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + id_ = ""; + + type_ = 0; + + primaryProductId_ = ""; + + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + gtin_ = ""; + + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + title_ = ""; + + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + description_ = ""; + + languageCode_ = ""; + + internalGetMutableAttributes().clear(); + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + if (ratingBuilder_ == null) { + rating_ = null; + } else { + rating_ = null; + ratingBuilder_ = null; + } + if (availableTimeBuilder_ == null) { + availableTime_ = null; + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + availability_ = 0; + + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; + } + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + fulfillmentInfoBuilder_.clear(); + } + uri_ = ""; + + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + imagesBuilder_.clear(); + } + if (audienceBuilder_ == null) { + audience_ = null; + } else { + audience_ = null; + audienceBuilder_ = null; + } + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; + } + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + } else { + promotionsBuilder_.clear(); + } + if (publishTimeBuilder_ == null) { + publishTime_ = null; + } else { + publishTime_ = null; + publishTimeBuilder_ = null; + } + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + } else { + variantsBuilder_.clear(); + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductProto + .internal_static_google_cloud_retail_v2alpha_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product build() { + com.google.cloud.retail.v2alpha.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product buildPartial() { + com.google.cloud.retail.v2alpha.Product result = + new com.google.cloud.retail.v2alpha.Product(this); + int from_bitField0_ = bitField0_; + if (expirationCase_ == 16) { + if (expireTimeBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = expireTimeBuilder_.build(); + } + } + if (expirationCase_ == 17) { + if (ttlBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = ttlBuilder_.build(); + } + } + result.name_ = name_; + result.id_ = id_; + result.type_ = type_; + result.primaryProductId_ = primaryProductId_; + if (((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.collectionMemberIds_ = collectionMemberIds_; + result.gtin_ = gtin_; + if (((bitField0_ & 0x00000002) != 0)) { + categories_ = categories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.categories_ = categories_; + result.title_ = title_; + if (((bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.brands_ = brands_; + result.description_ = description_; + result.languageCode_ = languageCode_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + if (((bitField0_ & 0x00000010) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.tags_ = tags_; + if (priceInfoBuilder_ == null) { + result.priceInfo_ = priceInfo_; + } else { + result.priceInfo_ = priceInfoBuilder_.build(); + } + if (ratingBuilder_ == null) { + result.rating_ = rating_; + } else { + result.rating_ = ratingBuilder_.build(); + } + if (availableTimeBuilder_ == null) { + result.availableTime_ = availableTime_; + } else { + result.availableTime_ = availableTimeBuilder_.build(); + } + result.availability_ = availability_; + if (availableQuantityBuilder_ == null) { + result.availableQuantity_ = availableQuantity_; + } else { + result.availableQuantity_ = availableQuantityBuilder_.build(); + } + if (fulfillmentInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.fulfillmentInfo_ = fulfillmentInfo_; + } else { + result.fulfillmentInfo_ = fulfillmentInfoBuilder_.build(); + } + result.uri_ = uri_; + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.images_ = images_; + } else { + result.images_ = imagesBuilder_.build(); + } + if (audienceBuilder_ == null) { + result.audience_ = audience_; + } else { + result.audience_ = audienceBuilder_.build(); + } + if (colorInfoBuilder_ == null) { + result.colorInfo_ = colorInfo_; + } else { + result.colorInfo_ = colorInfoBuilder_.build(); + } + if (((bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.sizes_ = sizes_; + if (((bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.materials_ = materials_; + if (((bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.patterns_ = patterns_; + if (((bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.conditions_ = conditions_; + if (promotionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.promotions_ = promotions_; + } else { + result.promotions_ = promotionsBuilder_.build(); + } + if (publishTimeBuilder_ == null) { + result.publishTime_ = publishTime_; + } else { + result.publishTime_ = publishTimeBuilder_.build(); + } + if (retrievableFieldsBuilder_ == null) { + result.retrievableFields_ = retrievableFields_; + } else { + result.retrievableFields_ = retrievableFieldsBuilder_.build(); + } + if (variantsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.variants_ = variants_; + } else { + result.variants_ = variantsBuilder_.build(); + } + result.expirationCase_ = expirationCase_; + 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.v2alpha.Product) { + return mergeFrom((com.google.cloud.retail.v2alpha.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Product other) { + if (other == com.google.cloud.retail.v2alpha.Product.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getPrimaryProductId().isEmpty()) { + primaryProductId_ = other.primaryProductId_; + onChanged(); + } + if (!other.collectionMemberIds_.isEmpty()) { + if (collectionMemberIds_.isEmpty()) { + collectionMemberIds_ = other.collectionMemberIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.addAll(other.collectionMemberIds_); + } + onChanged(); + } + if (!other.getGtin().isEmpty()) { + gtin_ = other.gtin_; + onChanged(); + } + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.brands_.isEmpty()) { + if (brands_.isEmpty()) { + brands_ = other.brands_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureBrandsIsMutable(); + brands_.addAll(other.brands_); + } + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.hasPriceInfo()) { + mergePriceInfo(other.getPriceInfo()); + } + if (other.hasRating()) { + mergeRating(other.getRating()); + } + if (other.hasAvailableTime()) { + mergeAvailableTime(other.getAvailableTime()); + } + if (other.availability_ != 0) { + setAvailabilityValue(other.getAvailabilityValue()); + } + if (other.hasAvailableQuantity()) { + mergeAvailableQuantity(other.getAvailableQuantity()); + } + if (fulfillmentInfoBuilder_ == null) { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfo_.isEmpty()) { + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.addAll(other.fulfillmentInfo_); + } + onChanged(); + } + } else { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfoBuilder_.isEmpty()) { + fulfillmentInfoBuilder_.dispose(); + fulfillmentInfoBuilder_ = null; + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + fulfillmentInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFulfillmentInfoFieldBuilder() + : null; + } else { + fulfillmentInfoBuilder_.addAllMessages(other.fulfillmentInfo_); + } + } + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (imagesBuilder_ == null) { + if (!other.images_.isEmpty()) { + if (images_.isEmpty()) { + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureImagesIsMutable(); + images_.addAll(other.images_); + } + onChanged(); + } + } else { + if (!other.images_.isEmpty()) { + if (imagesBuilder_.isEmpty()) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + imagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getImagesFieldBuilder() + : null; + } else { + imagesBuilder_.addAllMessages(other.images_); + } + } + } + if (other.hasAudience()) { + mergeAudience(other.getAudience()); + } + if (other.hasColorInfo()) { + mergeColorInfo(other.getColorInfo()); + } + if (!other.sizes_.isEmpty()) { + if (sizes_.isEmpty()) { + sizes_ = other.sizes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureSizesIsMutable(); + sizes_.addAll(other.sizes_); + } + onChanged(); + } + if (!other.materials_.isEmpty()) { + if (materials_.isEmpty()) { + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureMaterialsIsMutable(); + materials_.addAll(other.materials_); + } + onChanged(); + } + if (!other.patterns_.isEmpty()) { + if (patterns_.isEmpty()) { + patterns_ = other.patterns_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePatternsIsMutable(); + patterns_.addAll(other.patterns_); + } + onChanged(); + } + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + if (promotionsBuilder_ == null) { + if (!other.promotions_.isEmpty()) { + if (promotions_.isEmpty()) { + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePromotionsIsMutable(); + promotions_.addAll(other.promotions_); + } + onChanged(); + } + } else { + if (!other.promotions_.isEmpty()) { + if (promotionsBuilder_.isEmpty()) { + promotionsBuilder_.dispose(); + promotionsBuilder_ = null; + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + promotionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPromotionsFieldBuilder() + : null; + } else { + promotionsBuilder_.addAllMessages(other.promotions_); + } + } + } + if (other.hasPublishTime()) { + mergePublishTime(other.getPublishTime()); + } + if (other.hasRetrievableFields()) { + mergeRetrievableFields(other.getRetrievableFields()); + } + if (variantsBuilder_ == null) { + if (!other.variants_.isEmpty()) { + if (variants_.isEmpty()) { + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureVariantsIsMutable(); + variants_.addAll(other.variants_); + } + onChanged(); + } + } else { + if (!other.variants_.isEmpty()) { + if (variantsBuilder_.isEmpty()) { + variantsBuilder_.dispose(); + variantsBuilder_ = null; + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + variantsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVariantsFieldBuilder() + : null; + } else { + variantsBuilder_.addAllMessages(other.variants_); + } + } + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + 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.v2alpha.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Product) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 16) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 16) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 16) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 16)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 16; + onChanged(); + ; + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 17) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 17) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 17) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+     * The derived
+     * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 17)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 17; + onChanged(); + ; + return ttlBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 id_ = ""; + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2alpha.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2alpha.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2alpha.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2alpha.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2alpha.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.Product.Type result = + com.google.cloud.retail.v2alpha.Product.Type.valueOf(type_); + return result == null ? com.google.cloud.retail.v2alpha.Product.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.retail.v2alpha.Product.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object primaryProductId_ = ""; + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2alpha.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + public java.lang.String getPrimaryProductId() { + java.lang.Object ref = primaryProductId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryProductId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2alpha.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + public com.google.protobuf.ByteString getPrimaryProductIdBytes() { + java.lang.Object ref = primaryProductId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryProductId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2alpha.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @param value The primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryProductId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2alpha.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryProductId() { + + primaryProductId_ = getDefaultInstance().getPrimaryProductId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2alpha.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @param value The bytes for primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryProductId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList collectionMemberIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionMemberIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(collectionMemberIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param index The index to set the value at. + * @param value The collectionMemberIds to set. + * @return This builder for chaining. + */ + public Builder setCollectionMemberIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param value The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param values The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addAllCollectionMemberIds(java.lang.Iterable values) { + ensureCollectionMemberIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionMemberIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @return This builder for chaining. + */ + public Builder clearCollectionMemberIds() { + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2alpha.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+     * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+     * and 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; + * + * @param value The bytes of the collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object gtin_ = ""; + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gtin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The gtin to set. + * @return This builder for chaining. + */ + public Builder setGtin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gtin_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return This builder for chaining. + */ + public Builder clearGtin() { + + gtin_ = getDefaultInstance().getGtin(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The bytes for gtin to set. + * @return This builder for chaining. + */ + public Builder setGtinBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gtin_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList categories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_.getUnmodifiableView(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+     * INVALID_ARGUMENT error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList brands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBrandsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(brands_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_.getUnmodifiableView(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index to set the value at. + * @param value The brands to set. + * @return This builder for chaining. + */ + public Builder setBrands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The brands to add. + * @return This builder for chaining. + */ + public Builder addBrands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param values The brands to add. + * @return This builder for chaining. + */ + public Builder addAllBrands(java.lang.Iterable values) { + ensureBrandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, brands_); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return This builder for chaining. + */ + public Builder clearBrands() { + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The bytes of the brands to add. + * @return This builder for chaining. + */ + public Builder addBrandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2alpha.Product] can include text in
+     * different languages, but duplicating
+     * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2alpha.Product] can include text in
+     * different languages, but duplicating
+     * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2alpha.Product] can include text in
+     * different languages, but duplicating
+     * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2alpha.Product] can include text in
+     * different languages, but duplicating
+     * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2alpha.Product] can include text in
+     * different languages, but duplicating
+     * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+     * languages can result in degraded model performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.PriceInfo priceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder> + priceInfoBuilder_; + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + public boolean hasPriceInfo() { + return priceInfoBuilder_ != null || priceInfo_ != null; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + public com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo() { + if (priceInfoBuilder_ == null) { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } else { + return priceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2alpha.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceInfo_ = value; + onChanged(); + } else { + priceInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2alpha.PriceInfo.Builder builderForValue) { + if (priceInfoBuilder_ == null) { + priceInfo_ = builderForValue.build(); + onChanged(); + } else { + priceInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public Builder mergePriceInfo(com.google.cloud.retail.v2alpha.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (priceInfo_ != null) { + priceInfo_ = + com.google.cloud.retail.v2alpha.PriceInfo.newBuilder(priceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + priceInfo_ = value; + } + onChanged(); + } else { + priceInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public Builder clearPriceInfo() { + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + onChanged(); + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2alpha.PriceInfo.Builder getPriceInfoBuilder() { + + onChanged(); + return getPriceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder() { + if (priceInfoBuilder_ != null) { + return priceInfoBuilder_.getMessageOrBuilder(); + } else { + return priceInfo_ == null + ? com.google.cloud.retail.v2alpha.PriceInfo.getDefaultInstance() + : priceInfo_; + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder> + getPriceInfoFieldBuilder() { + if (priceInfoBuilder_ == null) { + priceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PriceInfo, + com.google.cloud.retail.v2alpha.PriceInfo.Builder, + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder>( + getPriceInfo(), getParentForChildren(), isClean()); + priceInfo_ = null; + } + return priceInfoBuilder_; + } + + private com.google.cloud.retail.v2alpha.Rating rating_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rating, + com.google.cloud.retail.v2alpha.Rating.Builder, + com.google.cloud.retail.v2alpha.RatingOrBuilder> + ratingBuilder_; + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + public boolean hasRating() { + return ratingBuilder_ != null || rating_ != null; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return The rating. + */ + public com.google.cloud.retail.v2alpha.Rating getRating() { + if (ratingBuilder_ == null) { + return rating_ == null + ? com.google.cloud.retail.v2alpha.Rating.getDefaultInstance() + : rating_; + } else { + return ratingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2alpha.Rating value) { + if (ratingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rating_ = value; + onChanged(); + } else { + ratingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2alpha.Rating.Builder builderForValue) { + if (ratingBuilder_ == null) { + rating_ = builderForValue.build(); + onChanged(); + } else { + ratingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public Builder mergeRating(com.google.cloud.retail.v2alpha.Rating value) { + if (ratingBuilder_ == null) { + if (rating_ != null) { + rating_ = + com.google.cloud.retail.v2alpha.Rating.newBuilder(rating_) + .mergeFrom(value) + .buildPartial(); + } else { + rating_ = value; + } + onChanged(); + } else { + ratingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public Builder clearRating() { + if (ratingBuilder_ == null) { + rating_ = null; + onChanged(); + } else { + rating_ = null; + ratingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public com.google.cloud.retail.v2alpha.Rating.Builder getRatingBuilder() { + + onChanged(); + return getRatingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + public com.google.cloud.retail.v2alpha.RatingOrBuilder getRatingOrBuilder() { + if (ratingBuilder_ != null) { + return ratingBuilder_.getMessageOrBuilder(); + } else { + return rating_ == null + ? com.google.cloud.retail.v2alpha.Rating.getDefaultInstance() + : rating_; + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rating, + com.google.cloud.retail.v2alpha.Rating.Builder, + com.google.cloud.retail.v2alpha.RatingOrBuilder> + getRatingFieldBuilder() { + if (ratingBuilder_ == null) { + ratingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rating, + com.google.cloud.retail.v2alpha.Rating.Builder, + com.google.cloud.retail.v2alpha.RatingOrBuilder>( + getRating(), getParentForChildren(), isClean()); + rating_ = null; + } + return ratingBuilder_; + } + + private com.google.protobuf.Timestamp availableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + availableTimeBuilder_; + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + public boolean hasAvailableTime() { + return availableTimeBuilder_ != null || availableTime_ != null; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + public com.google.protobuf.Timestamp getAvailableTime() { + if (availableTimeBuilder_ == null) { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } else { + return availableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableTime_ = value; + onChanged(); + } else { + availableTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (availableTimeBuilder_ == null) { + availableTime_ = builderForValue.build(); + onChanged(); + } else { + availableTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder mergeAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (availableTime_ != null) { + availableTime_ = + com.google.protobuf.Timestamp.newBuilder(availableTime_) + .mergeFrom(value) + .buildPartial(); + } else { + availableTime_ = value; + } + onChanged(); + } else { + availableTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder clearAvailableTime() { + if (availableTimeBuilder_ == null) { + availableTime_ = null; + onChanged(); + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.Timestamp.Builder getAvailableTimeBuilder() { + + onChanged(); + return getAvailableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { + if (availableTimeBuilder_ != null) { + return availableTimeBuilder_.getMessageOrBuilder(); + } else { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAvailableTimeFieldBuilder() { + if (availableTimeBuilder_ == null) { + availableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAvailableTime(), getParentForChildren(), isClean()); + availableTime_ = null; + } + return availableTimeBuilder_; + } + + private int availability_ = 0; + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2alpha.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + @java.lang.Override + public int getAvailabilityValue() { + return availability_; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2alpha.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @param value The enum numeric value on the wire for availability to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityValue(int value) { + + availability_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2alpha.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The availability. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product.Availability getAvailability() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.Product.Availability result = + com.google.cloud.retail.v2alpha.Product.Availability.valueOf(availability_); + return result == null + ? com.google.cloud.retail.v2alpha.Product.Availability.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2alpha.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @param value The availability to set. + * @return This builder for chaining. + */ + public Builder setAvailability(com.google.cloud.retail.v2alpha.Product.Availability value) { + if (value == null) { + throw new NullPointerException(); + } + + availability_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2alpha.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return This builder for chaining. + */ + public Builder clearAvailability() { + + availability_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value availableQuantity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + availableQuantityBuilder_; + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + public boolean hasAvailableQuantity() { + return availableQuantityBuilder_ != null || availableQuantity_ != null; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + public com.google.protobuf.Int32Value getAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } else { + return availableQuantityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableQuantity_ = value; + onChanged(); + } else { + availableQuantityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = builderForValue.build(); + onChanged(); + } else { + availableQuantityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder mergeAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (availableQuantity_ != null) { + availableQuantity_ = + com.google.protobuf.Int32Value.newBuilder(availableQuantity_) + .mergeFrom(value) + .buildPartial(); + } else { + availableQuantity_ = value; + } + onChanged(); + } else { + availableQuantityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder clearAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + onChanged(); + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32Value.Builder getAvailableQuantityBuilder() { + + onChanged(); + return getAvailableQuantityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { + if (availableQuantityBuilder_ != null) { + return availableQuantityBuilder_.getMessageOrBuilder(); + } else { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getAvailableQuantityFieldBuilder() { + if (availableQuantityBuilder_ == null) { + availableQuantityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getAvailableQuantity(), getParentForChildren(), isClean()); + availableQuantity_ = null; + } + return availableQuantityBuilder_; + } + + private java.util.List fulfillmentInfo_ = + java.util.Collections.emptyList(); + + private void ensureFulfillmentInfoIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList( + fulfillmentInfo_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.FulfillmentInfo, + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder, + com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder> + fulfillmentInfoBuilder_; + + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoList() { + if (fulfillmentInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(fulfillmentInfo_); + } else { + return fulfillmentInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public int getFulfillmentInfoCount() { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.size(); + } else { + return fulfillmentInfoBuilder_.getCount(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2alpha.FulfillmentInfo getFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); + } else { + return fulfillmentInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo( + int index, com.google.cloud.retail.v2alpha.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo( + int index, com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo(com.google.cloud.retail.v2alpha.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + int index, com.google.cloud.retail.v2alpha.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + int index, com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addAllFulfillmentInfo( + java.lang.Iterable values) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fulfillmentInfo_); + onChanged(); + } else { + fulfillmentInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder clearFulfillmentInfo() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + fulfillmentInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public Builder removeFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.remove(index); + onChanged(); + } else { + fulfillmentInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder getFulfillmentInfoBuilder( + int index) { + return getFulfillmentInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); + } else { + return fulfillmentInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoOrBuilderList() { + if (fulfillmentInfoBuilder_ != null) { + return fulfillmentInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fulfillmentInfo_); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder addFulfillmentInfoBuilder() { + return getFulfillmentInfoFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.FulfillmentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder addFulfillmentInfoBuilder( + int index) { + return getFulfillmentInfoFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.FulfillmentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoBuilderList() { + return getFulfillmentInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.FulfillmentInfo, + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder, + com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder> + getFulfillmentInfoFieldBuilder() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.FulfillmentInfo, + com.google.cloud.retail.v2alpha.FulfillmentInfo.Builder, + com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder>( + fulfillmentInfo_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + fulfillmentInfo_ = null; + } + return fulfillmentInfoBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.util.List images_ = + java.util.Collections.emptyList(); + + private void ensureImagesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + images_ = new java.util.ArrayList(images_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Image, + com.google.cloud.retail.v2alpha.Image.Builder, + com.google.cloud.retail.v2alpha.ImageOrBuilder> + imagesBuilder_; + + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public java.util.List getImagesList() { + if (imagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(images_); + } else { + return imagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public int getImagesCount() { + if (imagesBuilder_ == null) { + return images_.size(); + } else { + return imagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public com.google.cloud.retail.v2alpha.Image getImages(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder setImages(int index, com.google.cloud.retail.v2alpha.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.set(index, value); + onChanged(); + } else { + imagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder setImages( + int index, com.google.cloud.retail.v2alpha.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.set(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder addImages(com.google.cloud.retail.v2alpha.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(value); + onChanged(); + } else { + imagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder addImages(int index, com.google.cloud.retail.v2alpha.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(index, value); + onChanged(); + } else { + imagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder addImages(com.google.cloud.retail.v2alpha.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder addImages( + int index, com.google.cloud.retail.v2alpha.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder addAllImages( + java.lang.Iterable values) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); + onChanged(); + } else { + imagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder clearImages() { + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + imagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public Builder removeImages(int index) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.remove(index); + onChanged(); + } else { + imagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public com.google.cloud.retail.v2alpha.Image.Builder getImagesBuilder(int index) { + return getImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public com.google.cloud.retail.v2alpha.ImageOrBuilder getImagesOrBuilder(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public java.util.List + getImagesOrBuilderList() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(images_); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public com.google.cloud.retail.v2alpha.Image.Builder addImagesBuilder() { + return getImagesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public com.google.cloud.retail.v2alpha.Image.Builder addImagesBuilder(int index) { + return getImagesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + public java.util.List getImagesBuilderList() { + return getImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Image, + com.google.cloud.retail.v2alpha.Image.Builder, + com.google.cloud.retail.v2alpha.ImageOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Image, + com.google.cloud.retail.v2alpha.Image.Builder, + com.google.cloud.retail.v2alpha.ImageOrBuilder>( + images_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + images_ = null; + } + return imagesBuilder_; + } + + private com.google.cloud.retail.v2alpha.Audience audience_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Audience, + com.google.cloud.retail.v2alpha.Audience.Builder, + com.google.cloud.retail.v2alpha.AudienceOrBuilder> + audienceBuilder_; + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + public boolean hasAudience() { + return audienceBuilder_ != null || audience_ != null; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return The audience. + */ + public com.google.cloud.retail.v2alpha.Audience getAudience() { + if (audienceBuilder_ == null) { + return audience_ == null + ? com.google.cloud.retail.v2alpha.Audience.getDefaultInstance() + : audience_; + } else { + return audienceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public Builder setAudience(com.google.cloud.retail.v2alpha.Audience value) { + if (audienceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audience_ = value; + onChanged(); + } else { + audienceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public Builder setAudience(com.google.cloud.retail.v2alpha.Audience.Builder builderForValue) { + if (audienceBuilder_ == null) { + audience_ = builderForValue.build(); + onChanged(); + } else { + audienceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public Builder mergeAudience(com.google.cloud.retail.v2alpha.Audience value) { + if (audienceBuilder_ == null) { + if (audience_ != null) { + audience_ = + com.google.cloud.retail.v2alpha.Audience.newBuilder(audience_) + .mergeFrom(value) + .buildPartial(); + } else { + audience_ = value; + } + onChanged(); + } else { + audienceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public Builder clearAudience() { + if (audienceBuilder_ == null) { + audience_ = null; + onChanged(); + } else { + audience_ = null; + audienceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public com.google.cloud.retail.v2alpha.Audience.Builder getAudienceBuilder() { + + onChanged(); + return getAudienceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + public com.google.cloud.retail.v2alpha.AudienceOrBuilder getAudienceOrBuilder() { + if (audienceBuilder_ != null) { + return audienceBuilder_.getMessageOrBuilder(); + } else { + return audience_ == null + ? com.google.cloud.retail.v2alpha.Audience.getDefaultInstance() + : audience_; + } + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Audience, + com.google.cloud.retail.v2alpha.Audience.Builder, + com.google.cloud.retail.v2alpha.AudienceOrBuilder> + getAudienceFieldBuilder() { + if (audienceBuilder_ == null) { + audienceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Audience, + com.google.cloud.retail.v2alpha.Audience.Builder, + com.google.cloud.retail.v2alpha.AudienceOrBuilder>( + getAudience(), getParentForChildren(), isClean()); + audience_ = null; + } + return audienceBuilder_; + } + + private com.google.cloud.retail.v2alpha.ColorInfo colorInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ColorInfo, + com.google.cloud.retail.v2alpha.ColorInfo.Builder, + com.google.cloud.retail.v2alpha.ColorInfoOrBuilder> + colorInfoBuilder_; + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + public boolean hasColorInfo() { + return colorInfoBuilder_ != null || colorInfo_ != null; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + public com.google.cloud.retail.v2alpha.ColorInfo getColorInfo() { + if (colorInfoBuilder_ == null) { + return colorInfo_ == null + ? com.google.cloud.retail.v2alpha.ColorInfo.getDefaultInstance() + : colorInfo_; + } else { + return colorInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public Builder setColorInfo(com.google.cloud.retail.v2alpha.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + colorInfo_ = value; + onChanged(); + } else { + colorInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public Builder setColorInfo(com.google.cloud.retail.v2alpha.ColorInfo.Builder builderForValue) { + if (colorInfoBuilder_ == null) { + colorInfo_ = builderForValue.build(); + onChanged(); + } else { + colorInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public Builder mergeColorInfo(com.google.cloud.retail.v2alpha.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (colorInfo_ != null) { + colorInfo_ = + com.google.cloud.retail.v2alpha.ColorInfo.newBuilder(colorInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + colorInfo_ = value; + } + onChanged(); + } else { + colorInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public Builder clearColorInfo() { + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + onChanged(); + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public com.google.cloud.retail.v2alpha.ColorInfo.Builder getColorInfoBuilder() { + + onChanged(); + return getColorInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + public com.google.cloud.retail.v2alpha.ColorInfoOrBuilder getColorInfoOrBuilder() { + if (colorInfoBuilder_ != null) { + return colorInfoBuilder_.getMessageOrBuilder(); + } else { + return colorInfo_ == null + ? com.google.cloud.retail.v2alpha.ColorInfo.getDefaultInstance() + : colorInfo_; + } + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ColorInfo, + com.google.cloud.retail.v2alpha.ColorInfo.Builder, + com.google.cloud.retail.v2alpha.ColorInfoOrBuilder> + getColorInfoFieldBuilder() { + if (colorInfoBuilder_ == null) { + colorInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ColorInfo, + com.google.cloud.retail.v2alpha.ColorInfo.Builder, + com.google.cloud.retail.v2alpha.ColorInfoOrBuilder>( + getColorInfo(), getParentForChildren(), isClean()); + colorInfo_ = null; + } + return colorInfoBuilder_; + } + + private com.google.protobuf.LazyStringList sizes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSizesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(sizes_); + bitField0_ |= 0x00000080; + } + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_.getUnmodifiableView(); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + public int getSizesCount() { + return sizes_.size(); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + public java.lang.String getSizes(int index) { + return sizes_.get(index); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index to set the value at. + * @param value The sizes to set. + * @return This builder for chaining. + */ + public Builder setSizes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizesIsMutable(); + sizes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param value The sizes to add. + * @return This builder for chaining. + */ + public Builder addSizes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizesIsMutable(); + sizes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param values The sizes to add. + * @return This builder for chaining. + */ + public Builder addAllSizes(java.lang.Iterable values) { + ensureSizesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sizes_); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return This builder for chaining. + */ + public Builder clearSizes() { + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param value The bytes of the sizes to add. + * @return This builder for chaining. + */ + public Builder addSizesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSizesIsMutable(); + sizes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList materials_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMaterialsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(materials_); + bitField0_ |= 0x00000100; + } + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_.getUnmodifiableView(); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index to set the value at. + * @param value The materials to set. + * @return This builder for chaining. + */ + public Builder setMaterials(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param value The materials to add. + * @return This builder for chaining. + */ + public Builder addMaterials(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param values The materials to add. + * @return This builder for chaining. + */ + public Builder addAllMaterials(java.lang.Iterable values) { + ensureMaterialsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return This builder for chaining. + */ + public Builder clearMaterials() { + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param value The bytes of the materials to add. + * @return This builder for chaining. + */ + public Builder addMaterialsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList patterns_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePatternsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(patterns_); + bitField0_ |= 0x00000200; + } + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_.getUnmodifiableView(); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + public int getPatternsCount() { + return patterns_.size(); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + public java.lang.String getPatterns(int index) { + return patterns_.get(index); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index to set the value at. + * @param value The patterns to set. + * @return This builder for chaining. + */ + public Builder setPatterns(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePatternsIsMutable(); + patterns_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param value The patterns to add. + * @return This builder for chaining. + */ + public Builder addPatterns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePatternsIsMutable(); + patterns_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param values The patterns to add. + * @return This builder for chaining. + */ + public Builder addAllPatterns(java.lang.Iterable values) { + ensurePatternsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, patterns_); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return This builder for chaining. + */ + public Builder clearPatterns() { + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param value The bytes of the patterns to add. + * @return This builder for chaining. + */ + public Builder addPatternsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePatternsIsMutable(); + patterns_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList conditions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(conditions_); + bitField0_ |= 0x00000400; + } + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_.getUnmodifiableView(); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index to set the value at. + * @param value The conditions to set. + * @return This builder for chaining. + */ + public Builder setConditions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param value The conditions to add. + * @return This builder for chaining. + */ + public Builder addConditions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param values The conditions to add. + * @return This builder for chaining. + */ + public Builder addAllConditions(java.lang.Iterable values) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return This builder for chaining. + */ + public Builder clearConditions() { + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param value The bytes of the conditions to add. + * @return This builder for chaining. + */ + public Builder addConditionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + return this; + } + + private java.util.List promotions_ = + java.util.Collections.emptyList(); + + private void ensurePromotionsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + promotions_ = + new java.util.ArrayList(promotions_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Promotion, + com.google.cloud.retail.v2alpha.Promotion.Builder, + com.google.cloud.retail.v2alpha.PromotionOrBuilder> + promotionsBuilder_; + + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public java.util.List getPromotionsList() { + if (promotionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(promotions_); + } else { + return promotionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public int getPromotionsCount() { + if (promotionsBuilder_ == null) { + return promotions_.size(); + } else { + return promotionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2alpha.Promotion getPromotions(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder setPromotions(int index, com.google.cloud.retail.v2alpha.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.set(index, value); + onChanged(); + } else { + promotionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder setPromotions( + int index, com.google.cloud.retail.v2alpha.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.set(index, builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder addPromotions(com.google.cloud.retail.v2alpha.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.add(value); + onChanged(); + } else { + promotionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder addPromotions(int index, com.google.cloud.retail.v2alpha.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.add(index, value); + onChanged(); + } else { + promotionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder addPromotions( + com.google.cloud.retail.v2alpha.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder addPromotions( + int index, com.google.cloud.retail.v2alpha.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(index, builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder addAllPromotions( + java.lang.Iterable values) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotions_); + onChanged(); + } else { + promotionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder clearPromotions() { + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + promotionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public Builder removePromotions(int index) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.remove(index); + onChanged(); + } else { + promotionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2alpha.Promotion.Builder getPromotionsBuilder(int index) { + return getPromotionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2alpha.PromotionOrBuilder getPromotionsOrBuilder(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public java.util.List + getPromotionsOrBuilderList() { + if (promotionsBuilder_ != null) { + return promotionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(promotions_); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2alpha.Promotion.Builder addPromotionsBuilder() { + return getPromotionsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Promotion.getDefaultInstance()); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2alpha.Promotion.Builder addPromotionsBuilder(int index) { + return getPromotionsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Promotion.getDefaultInstance()); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2alpha.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + public java.util.List + getPromotionsBuilderList() { + return getPromotionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Promotion, + com.google.cloud.retail.v2alpha.Promotion.Builder, + com.google.cloud.retail.v2alpha.PromotionOrBuilder> + getPromotionsFieldBuilder() { + if (promotionsBuilder_ == null) { + promotionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Promotion, + com.google.cloud.retail.v2alpha.Promotion.Builder, + com.google.cloud.retail.v2alpha.PromotionOrBuilder>( + promotions_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); + promotions_ = null; + } + return promotionsBuilder_; + } + + private com.google.protobuf.Timestamp publishTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + publishTimeBuilder_; + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + public boolean hasPublishTime() { + return publishTimeBuilder_ != null || publishTime_ != null; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + public com.google.protobuf.Timestamp getPublishTime() { + if (publishTimeBuilder_ == null) { + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; + } else { + return publishTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder setPublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + publishTime_ = value; + onChanged(); + } else { + publishTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder setPublishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (publishTimeBuilder_ == null) { + publishTime_ = builderForValue.build(); + onChanged(); + } else { + publishTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder mergePublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { + if (publishTime_ != null) { + publishTime_ = + com.google.protobuf.Timestamp.newBuilder(publishTime_) + .mergeFrom(value) + .buildPartial(); + } else { + publishTime_ = value; + } + onChanged(); + } else { + publishTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder clearPublishTime() { + if (publishTimeBuilder_ == null) { + publishTime_ = null; + onChanged(); + } else { + publishTime_ = null; + publishTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public com.google.protobuf.Timestamp.Builder getPublishTimeBuilder() { + + onChanged(); + return getPublishTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + if (publishTimeBuilder_ != null) { + return publishTimeBuilder_.getMessageOrBuilder(); + } else { + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; + } + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPublishTimeFieldBuilder() { + if (publishTimeBuilder_ == null) { + publishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPublishTime(), getParentForChildren(), isClean()); + publishTime_ = null; + } + return publishTimeBuilder_; + } + + private com.google.protobuf.FieldMask retrievableFields_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + retrievableFieldsBuilder_; + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + public boolean hasRetrievableFields() { + return retrievableFieldsBuilder_ != null || retrievableFields_ != null; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + public com.google.protobuf.FieldMask getRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } else { + return retrievableFieldsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retrievableFields_ = value; + onChanged(); + } else { + retrievableFieldsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask.Builder builderForValue) { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = builderForValue.build(); + onChanged(); + } else { + retrievableFieldsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder mergeRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (retrievableFields_ != null) { + retrievableFields_ = + com.google.protobuf.FieldMask.newBuilder(retrievableFields_) + .mergeFrom(value) + .buildPartial(); + } else { + retrievableFields_ = value; + } + onChanged(); + } else { + retrievableFieldsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder clearRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + onChanged(); + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMask.Builder getRetrievableFieldsBuilder() { + + onChanged(); + return getRetrievableFieldsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + if (retrievableFieldsBuilder_ != null) { + return retrievableFieldsBuilder_.getMessageOrBuilder(); + } else { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+     * * [audience][google.cloud.retail.v2alpha.Product.audience]
+     * * [availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [brands][google.cloud.retail.v2alpha.Product.brands]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+     * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+     * * [materials][google.cloud.retail.v2alpha.Product.materials]
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+     * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [rating][google.cloud.retail.v2alpha.Product.rating]
+     * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+     * * [title][google.cloud.retail.v2alpha.Product.title]
+     * * [uri][google.cloud.retail.v2alpha.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2alpha.Product.categories]
+     * * [description][google.cloud.retail.v2alpha.Product.description]
+     * * [images][google.cloud.retail.v2alpha.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2alpha.Product.images]
+     * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2alpha.Product.name]
+     * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getRetrievableFieldsFieldBuilder() { + if (retrievableFieldsBuilder_ == null) { + retrievableFieldsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getRetrievableFields(), getParentForChildren(), isClean()); + retrievableFields_ = null; + } + return retrievableFieldsBuilder_; + } + + private java.util.List variants_ = + java.util.Collections.emptyList(); + + private void ensureVariantsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(variants_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + variantsBuilder_; + + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getVariantsList() { + if (variantsBuilder_ == null) { + return java.util.Collections.unmodifiableList(variants_); + } else { + return variantsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getVariantsCount() { + if (variantsBuilder_ == null) { + return variants_.size(); + } else { + return variantsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.Product getVariants(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); + } else { + return variantsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVariants(int index, com.google.cloud.retail.v2alpha.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.set(index, value); + onChanged(); + } else { + variantsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVariants( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.set(index, builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(com.google.cloud.retail.v2alpha.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.add(value); + onChanged(); + } else { + variantsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(int index, com.google.cloud.retail.v2alpha.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.add(index, value); + onChanged(); + } else { + variantsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(index, builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllVariants( + java.lang.Iterable values) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variants_); + onChanged(); + } else { + variantsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVariants() { + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + variantsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeVariants(int index) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.remove(index); + onChanged(); + } else { + variantsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getVariantsBuilder(int index) { + return getVariantsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getVariantsOrBuilder(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); + } else { + return variantsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getVariantsOrBuilderList() { + if (variantsBuilder_ != null) { + return variantsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(variants_); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder addVariantsBuilder() { + return getVariantsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder addVariantsBuilder(int index) { + return getVariantsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getVariantsBuilderList() { + return getVariantsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getVariantsFieldBuilder() { + if (variantsBuilder_ == null) { + variantsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + variants_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + variants_ = null; + } + return variantsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Product) + private static final com.google.cloud.retail.v2alpha.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Product(); + } + + public static com.google.cloud.retail.v2alpha.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Product parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Product(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.v2alpha.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetail.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetail.java new file mode 100644 index 00000000..db195831 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetail.java @@ -0,0 +1,1181 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Detailed product information associated with a user event.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductDetail} + */ +public final class ProductDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ProductDetail) + ProductDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductDetail.newBuilder() to construct. + private ProductDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductDetail( + 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.v2alpha.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (quantity_ != null) { + subBuilder = quantity_.toBuilder(); + } + quantity_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(quantity_); + quantity_ = 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.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductDetail.class, + com.google.cloud.retail.v2alpha.ProductDetail.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Product product_; + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int QUANTITY_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value quantity_; + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return quantity_ != null; + } + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQuantity() { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder() { + return getQuantity(); + } + + 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 (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (quantity_ != null) { + output.writeMessage(2, getQuantity()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); + } + if (quantity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuantity()); + } + 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.v2alpha.ProductDetail)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ProductDetail other = + (com.google.cloud.retail.v2alpha.ProductDetail) obj; + + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (hasQuantity() != other.hasQuantity()) return false; + if (hasQuantity()) { + if (!getQuantity().equals(other.getQuantity())) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + if (hasQuantity()) { + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getQuantity().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ProductDetail 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; + } + /** + * + * + *
+   * Detailed product information associated with a user event.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ProductDetail) + com.google.cloud.retail.v2alpha.ProductDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductDetail.class, + com.google.cloud.retail.v2alpha.ProductDetail.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ProductDetail.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + if (quantityBuilder_ == null) { + quantity_ = null; + } else { + quantity_ = null; + quantityBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductDetail getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ProductDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductDetail build() { + com.google.cloud.retail.v2alpha.ProductDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductDetail buildPartial() { + com.google.cloud.retail.v2alpha.ProductDetail result = + new com.google.cloud.retail.v2alpha.ProductDetail(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + if (quantityBuilder_ == null) { + result.quantity_ = quantity_; + } else { + result.quantity_ = quantityBuilder_.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.v2alpha.ProductDetail) { + return mergeFrom((com.google.cloud.retail.v2alpha.ProductDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ProductDetail other) { + if (other == com.google.cloud.retail.v2alpha.ProductDetail.getDefaultInstance()) return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasQuantity()) { + mergeQuantity(other.getQuantity()); + } + 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.v2alpha.ProductDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.ProductDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2alpha.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2alpha.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private com.google.protobuf.Int32Value quantity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + quantityBuilder_; + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + public boolean hasQuantity() { + return quantityBuilder_ != null || quantity_ != null; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + public com.google.protobuf.Int32Value getQuantity() { + if (quantityBuilder_ == null) { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } else { + return quantityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder setQuantity(com.google.protobuf.Int32Value value) { + if (quantityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quantity_ = value; + onChanged(); + } else { + quantityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder setQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { + if (quantityBuilder_ == null) { + quantity_ = builderForValue.build(); + onChanged(); + } else { + quantityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder mergeQuantity(com.google.protobuf.Int32Value value) { + if (quantityBuilder_ == null) { + if (quantity_ != null) { + quantity_ = + com.google.protobuf.Int32Value.newBuilder(quantity_).mergeFrom(value).buildPartial(); + } else { + quantity_ = value; + } + onChanged(); + } else { + quantityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder clearQuantity() { + if (quantityBuilder_ == null) { + quantity_ = null; + onChanged(); + } else { + quantity_ = null; + quantityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public com.google.protobuf.Int32Value.Builder getQuantityBuilder() { + + onChanged(); + return getQuantityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder() { + if (quantityBuilder_ != null) { + return quantityBuilder_.getMessageOrBuilder(); + } else { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getQuantityFieldBuilder() { + if (quantityBuilder_ == null) { + quantityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQuantity(), getParentForChildren(), isClean()); + quantity_ = null; + } + return quantityBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ProductDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ProductDetail) + private static final com.google.cloud.retail.v2alpha.ProductDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ProductDetail(); + } + + public static com.google.cloud.retail.v2alpha.ProductDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductDetail(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.v2alpha.ProductDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetailOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetailOrBuilder.java new file mode 100644 index 00000000..28b9a0d7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductDetailOrBuilder.java @@ -0,0 +1,140 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +public interface ProductDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ProductDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2alpha.Product getProduct(); + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2alpha.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2alpha.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + boolean hasQuantity(); + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + com.google.protobuf.Int32Value getQuantity(); + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSource.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSource.java new file mode 100644 index 00000000..54a2de81 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSource.java @@ -0,0 +1,1043 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The inline source for the input config for ImportProducts method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductInlineSource} + */ +public final class ProductInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ProductInlineSource) + ProductInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductInlineSource.newBuilder() to construct. + private ProductInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductInlineSource() { + products_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductInlineSource( + 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)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Product.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)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductInlineSource.class, + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.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 { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.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.v2alpha.ProductInlineSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ProductInlineSource other = + (com.google.cloud.retail.v2alpha.ProductInlineSource) obj; + + if (!getProductsList().equals(other.getProductsList())) 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 (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ProductInlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inline source for the input config for ImportProducts method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ProductInlineSource) + com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductInlineSource.class, + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ProductInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSource build() { + com.google.cloud.retail.v2alpha.ProductInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSource buildPartial() { + com.google.cloud.retail.v2alpha.ProductInlineSource result = + new com.google.cloud.retail.v2alpha.ProductInlineSource(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.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.v2alpha.ProductInlineSource) { + return mergeFrom((com.google.cloud.retail.v2alpha.ProductInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ProductInlineSource other) { + if (other == com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + 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.v2alpha.ProductInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ProductInlineSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProducts(int index, com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProducts( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(int index, com.google.cloud.retail.v2alpha.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts( + int index, com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ProductInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ProductInlineSource) + private static final com.google.cloud.retail.v2alpha.ProductInlineSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ProductInlineSource(); + } + + public static com.google.cloud.retail.v2alpha.ProductInlineSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductInlineSource(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.v2alpha.ProductInlineSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSourceOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSourceOrBuilder.java new file mode 100644 index 00000000..dd8ee418 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInlineSourceOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ProductInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ProductInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getProductsList(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.Product getProducts(int index); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getProductsCount(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfig.java new file mode 100644 index 00000000..4836fe5f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfig.java @@ -0,0 +1,1459 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The input config source for products.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductInputConfig} + */ +public final class ProductInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ProductInputConfig) + ProductInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductInputConfig.newBuilder() to construct. + private ProductInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductInputConfig( + 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.v2alpha.ProductInlineSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.retail.v2alpha.ProductInlineSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ProductInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.ProductInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.retail.v2alpha.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = ((com.google.cloud.retail.v2alpha.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductInputConfig.class, + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRODUCT_INLINE_SOURCE(1), + GCS_SOURCE(2), + BIG_QUERY_SOURCE(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return PRODUCT_INLINE_SOURCE; + case 2: + return GCS_SOURCE; + case 3: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int PRODUCT_INLINE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + @java.lang.Override + public boolean hasProductInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSource getProductInlineSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder + getProductInlineSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2alpha.ProductInlineSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2alpha.GcsSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2alpha.ProductInlineSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2alpha.GcsSource) source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + 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.v2alpha.ProductInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ProductInputConfig other = + (com.google.cloud.retail.v2alpha.ProductInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getProductInlineSource().equals(other.getProductInlineSource())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 3: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + PRODUCT_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getProductInlineSource().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 3: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ProductInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for products.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ProductInputConfig) + com.google.cloud.retail.v2alpha.ProductInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductInputConfig.class, + com.google.cloud.retail.v2alpha.ProductInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ProductInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_ProductInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ProductInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInputConfig build() { + com.google.cloud.retail.v2alpha.ProductInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInputConfig buildPartial() { + com.google.cloud.retail.v2alpha.ProductInputConfig result = + new com.google.cloud.retail.v2alpha.ProductInputConfig(this); + if (sourceCase_ == 1) { + if (productInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = productInlineSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.v2alpha.ProductInputConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.ProductInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ProductInputConfig other) { + if (other == com.google.cloud.retail.v2alpha.ProductInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case PRODUCT_INLINE_SOURCE: + { + mergeProductInlineSource(other.getProductInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.v2alpha.ProductInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ProductInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInlineSource, + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder, + com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder> + productInlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + @java.lang.Override + public boolean hasProductInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSource getProductInlineSource() { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return productInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + public Builder setProductInlineSource( + com.google.cloud.retail.v2alpha.ProductInlineSource value) { + if (productInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + productInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + public Builder setProductInlineSource( + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder builderForValue) { + if (productInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + productInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + public Builder mergeProductInlineSource( + com.google.cloud.retail.v2alpha.ProductInlineSource value) { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.ProductInlineSource.newBuilder( + (com.google.cloud.retail.v2alpha.ProductInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + productInlineSourceBuilder_.mergeFrom(value); + } else { + productInlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + public Builder clearProductInlineSource() { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + productInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + public com.google.cloud.retail.v2alpha.ProductInlineSource.Builder + getProductInlineSourceBuilder() { + return getProductInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder + getProductInlineSourceOrBuilder() { + if ((sourceCase_ == 1) && (productInlineSourceBuilder_ != null)) { + return productInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInlineSource, + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder, + com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder> + getProductInlineSourceFieldBuilder() { + if (productInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2alpha.ProductInlineSource.getDefaultInstance(); + } + productInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductInlineSource, + com.google.cloud.retail.v2alpha.ProductInlineSource.Builder, + com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder>( + (com.google.cloud.retail.v2alpha.ProductInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return productInlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.retail.v2alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.retail.v2alpha.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.retail.v2alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.GcsSource.newBuilder( + (com.google.cloud.retail.v2alpha.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + public com.google.cloud.retail.v2alpha.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder>( + (com.google.cloud.retail.v2alpha.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2alpha.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + public com.google.cloud.retail.v2alpha.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 3) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ProductInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ProductInputConfig) + private static final com.google.cloud.retail.v2alpha.ProductInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ProductInputConfig(); + } + + public static com.google.cloud.retail.v2alpha.ProductInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductInputConfig(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.v2alpha.ProductInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfigOrBuilder.java new file mode 100644 index 00000000..9a4bda02 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductInputConfigOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ProductInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ProductInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + boolean hasProductInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + com.google.cloud.retail.v2alpha.ProductInlineSource getProductInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2alpha.ProductInlineSource product_inline_source = 1; + */ + com.google.cloud.retail.v2alpha.ProductInlineSourceOrBuilder getProductInlineSourceOrBuilder(); + + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.retail.v2alpha.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2; + */ + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3; + */ + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2alpha.ProductInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfig.java new file mode 100644 index 00000000..2010f15e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfig.java @@ -0,0 +1,1074 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Configures what level the product should be uploaded with regards to
+ * how users will be send events and how predictions will be made.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductLevelConfig} + */ +public final class ProductLevelConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ProductLevelConfig) + ProductLevelConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductLevelConfig.newBuilder() to construct. + private ProductLevelConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductLevelConfig() { + ingestionProductType_ = ""; + merchantCenterProductIdField_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductLevelConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductLevelConfig( + 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(); + + ingestionProductType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + merchantCenterProductIdField_ = 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.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductLevelConfig.class, + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder.class); + } + + public static final int INGESTION_PRODUCT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object ingestionProductType_; + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + @java.lang.Override + public java.lang.String getIngestionProductType() { + java.lang.Object ref = ingestionProductType_; + 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(); + ingestionProductType_ = s; + return s; + } + } + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIngestionProductTypeBytes() { + java.lang.Object ref = ingestionProductType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ingestionProductType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER = 2; + private volatile java.lang.Object merchantCenterProductIdField_; + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * Acceptable values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + @java.lang.Override + public java.lang.String getMerchantCenterProductIdField() { + java.lang.Object ref = merchantCenterProductIdField_; + 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(); + merchantCenterProductIdField_ = s; + return s; + } + } + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * Acceptable values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { + java.lang.Object ref = merchantCenterProductIdField_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + merchantCenterProductIdField_ = 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(ingestionProductType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ingestionProductType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, merchantCenterProductIdField_); + } + 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(ingestionProductType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ingestionProductType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, merchantCenterProductIdField_); + } + 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.v2alpha.ProductLevelConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ProductLevelConfig other = + (com.google.cloud.retail.v2alpha.ProductLevelConfig) obj; + + if (!getIngestionProductType().equals(other.getIngestionProductType())) return false; + if (!getMerchantCenterProductIdField().equals(other.getMerchantCenterProductIdField())) + 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) + INGESTION_PRODUCT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getIngestionProductType().hashCode(); + hash = (37 * hash) + MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getMerchantCenterProductIdField().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ProductLevelConfig 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; + } + /** + * + * + *
+   * Configures what level the product should be uploaded with regards to
+   * how users will be send events and how predictions will be made.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ProductLevelConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ProductLevelConfig) + com.google.cloud.retail.v2alpha.ProductLevelConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ProductLevelConfig.class, + com.google.cloud.retail.v2alpha.ProductLevelConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ProductLevelConfig.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(); + ingestionProductType_ = ""; + + merchantCenterProductIdField_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogProto + .internal_static_google_cloud_retail_v2alpha_ProductLevelConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductLevelConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ProductLevelConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductLevelConfig build() { + com.google.cloud.retail.v2alpha.ProductLevelConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductLevelConfig buildPartial() { + com.google.cloud.retail.v2alpha.ProductLevelConfig result = + new com.google.cloud.retail.v2alpha.ProductLevelConfig(this); + result.ingestionProductType_ = ingestionProductType_; + result.merchantCenterProductIdField_ = merchantCenterProductIdField_; + 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.v2alpha.ProductLevelConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.ProductLevelConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ProductLevelConfig other) { + if (other == com.google.cloud.retail.v2alpha.ProductLevelConfig.getDefaultInstance()) + return this; + if (!other.getIngestionProductType().isEmpty()) { + ingestionProductType_ = other.ingestionProductType_; + onChanged(); + } + if (!other.getMerchantCenterProductIdField().isEmpty()) { + merchantCenterProductIdField_ = other.merchantCenterProductIdField_; + 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.v2alpha.ProductLevelConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ProductLevelConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ingestionProductType_ = ""; + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + public java.lang.String getIngestionProductType() { + java.lang.Object ref = ingestionProductType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ingestionProductType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + public com.google.protobuf.ByteString getIngestionProductTypeBytes() { + java.lang.Object ref = ingestionProductType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ingestionProductType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @param value The ingestionProductType to set. + * @return This builder for chaining. + */ + public Builder setIngestionProductType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ingestionProductType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearIngestionProductType() { + + ingestionProductType_ = getDefaultInstance().getIngestionProductType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @param value The bytes for ingestionProductType to set. + * @return This builder for chaining. + */ + public Builder setIngestionProductTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ingestionProductType_ = value; + onChanged(); + return this; + } + + private java.lang.Object merchantCenterProductIdField_ = ""; + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * Acceptable values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + public java.lang.String getMerchantCenterProductIdField() { + java.lang.Object ref = merchantCenterProductIdField_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + merchantCenterProductIdField_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * Acceptable values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { + java.lang.Object ref = merchantCenterProductIdField_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + merchantCenterProductIdField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * Acceptable values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @param value The merchantCenterProductIdField to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterProductIdField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + merchantCenterProductIdField_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * Acceptable values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return This builder for chaining. + */ + public Builder clearMerchantCenterProductIdField() { + + merchantCenterProductIdField_ = getDefaultInstance().getMerchantCenterProductIdField(); + onChanged(); + return this; + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+     * Acceptable values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @param value The bytes for merchantCenterProductIdField to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterProductIdFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + merchantCenterProductIdField_ = 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.v2alpha.ProductLevelConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ProductLevelConfig) + private static final com.google.cloud.retail.v2alpha.ProductLevelConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ProductLevelConfig(); + } + + public static com.google.cloud.retail.v2alpha.ProductLevelConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductLevelConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductLevelConfig(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.v2alpha.ProductLevelConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfigOrBuilder.java new file mode 100644 index 00000000..283a4e13 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductLevelConfigOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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/v2alpha/catalog.proto + +package com.google.cloud.retail.v2alpha; + +public interface ProductLevelConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ProductLevelConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + java.lang.String getIngestionProductType(); + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2alpha.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + com.google.protobuf.ByteString getIngestionProductTypeBytes(); + + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * Acceptable values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + java.lang.String getMerchantCenterProductIdField(); + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
+   * Acceptable values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductName.java new file mode 100644 index 00000000..d9b40dc5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductName.java @@ -0,0 +1,298 @@ +/* + * 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.v2alpha; + +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 ProductName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String branch; + private final String product; + + @Deprecated + protected ProductName() { + project = null; + location = null; + catalog = null; + branch = null; + product = null; + } + + private ProductName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + branch = Preconditions.checkNotNull(builder.getBranch()); + product = Preconditions.checkNotNull(builder.getProduct()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public String getProduct() { + return product; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProductName of( + String project, String location, String catalog, String branch, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .setProduct(product) + .build(); + } + + public static String format( + String project, String location, String catalog, String branch, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .setProduct(product) + .build() + .toString(); + } + + public static ProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.validatedMatch( + formattedString, "ProductName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("branch"), + matchMap.get("product")); + } + + 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 (ProductName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.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 (branch != null) { + fieldMapBuilder.put("branch", branch); + } + if (product != null) { + fieldMapBuilder.put("product", product); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "branch", + branch, + "product", + product); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProductName that = ((ProductName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.branch, that.branch) + && Objects.equals(this.product, that.product); + } + 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(branch); + h *= 1000003; + h ^= Objects.hashCode(product); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}. + */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String branch; + private String product; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public String getProduct() { + return product; + } + + 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 setBranch(String branch) { + this.branch = branch; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + private Builder(ProductName productName) { + this.project = productName.project; + this.location = productName.location; + this.catalog = productName.catalog; + this.branch = productName.branch; + this.product = productName.product; + } + + public ProductName build() { + return new ProductName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductOrBuilder.java new file mode 100644 index 00000000..494811a7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductOrBuilder.java @@ -0,0 +1,2289 @@ +/* + * 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/v2alpha/product.proto + +package com.google.cloud.retail.v2alpha; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Product) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2alpha.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
+   * The derived
+   * [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2alpha.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2alpha.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2alpha.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2alpha.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + com.google.cloud.retail.v2alpha.Product.Type getType(); + + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2alpha.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + java.lang.String getPrimaryProductId(); + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2alpha.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + com.google.protobuf.ByteString getPrimaryProductIdBytes(); + + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @return A list containing the collectionMemberIds. + */ + java.util.List getCollectionMemberIdsList(); + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @return The count of collectionMemberIds. + */ + int getCollectionMemberIdsCount(); + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + java.lang.String getCollectionMemberIds(int index); + /** + * + * + *
+   * The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2alpha.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * The [type][google.cloud.retail.v2alpha.Product.type] of the members must be
+   * either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise
+   * and 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; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index); + + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + java.lang.String getGtin(); + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + com.google.protobuf.ByteString getGtinBytes(); + + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product] otherwise an
+   * INVALID_ARGUMENT error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + com.google.protobuf.ByteString getCategoriesBytes(int index); + + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + java.util.List getBrandsList(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + int getBrandsCount(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + java.lang.String getBrands(int index); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + com.google.protobuf.ByteString getBrandsBytes(int index); + + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2alpha.Product] can include text in
+   * different languages, but duplicating
+   * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2alpha.Product] can include text in
+   * different languages, but duplicating
+   * [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple
+   * languages can result in degraded model performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + int getAttributesCount(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute defaultValue); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 12; + */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + boolean hasPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + com.google.cloud.retail.v2alpha.PriceInfo getPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2alpha.PriceInfo price_info = 14; + */ + com.google.cloud.retail.v2alpha.PriceInfoOrBuilder getPriceInfoOrBuilder(); + + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + boolean hasRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + * + * @return The rating. + */ + com.google.cloud.retail.v2alpha.Rating getRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rating rating = 15; + */ + com.google.cloud.retail.v2alpha.RatingOrBuilder getRatingOrBuilder(); + + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + boolean hasAvailableTime(); + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + com.google.protobuf.Timestamp getAvailableTime(); + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder(); + + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2alpha.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + int getAvailabilityValue(); + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2alpha.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2alpha.Product.Availability availability = 19; + * + * @return The availability. + */ + com.google.cloud.retail.v2alpha.Product.Availability getAvailability(); + + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + boolean hasAvailableQuantity(); + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + com.google.protobuf.Int32Value getAvailableQuantity(); + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder(); + + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List getFulfillmentInfoList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2alpha.FulfillmentInfo getFulfillmentInfo(int index); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + int getFulfillmentInfoCount(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List + getFulfillmentInfoOrBuilderList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2alpha.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder(int index); + + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + java.util.List getImagesList(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + com.google.cloud.retail.v2alpha.Image getImages(int index); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + int getImagesCount(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + java.util.List getImagesOrBuilderList(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Image images = 23; + */ + com.google.cloud.retail.v2alpha.ImageOrBuilder getImagesOrBuilder(int index); + + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + boolean hasAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + * + * @return The audience. + */ + com.google.cloud.retail.v2alpha.Audience getAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2alpha.Audience audience = 24; + */ + com.google.cloud.retail.v2alpha.AudienceOrBuilder getAudienceOrBuilder(); + + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + boolean hasColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + com.google.cloud.retail.v2alpha.ColorInfo getColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2alpha.ColorInfo color_info = 25; + */ + com.google.cloud.retail.v2alpha.ColorInfoOrBuilder getColorInfoOrBuilder(); + + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + java.util.List getSizesList(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + int getSizesCount(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + java.lang.String getSizes(int index); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + com.google.protobuf.ByteString getSizesBytes(int index); + + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + java.util.List getMaterialsList(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + int getMaterialsCount(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + java.lang.String getMaterials(int index); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + com.google.protobuf.ByteString getMaterialsBytes(int index); + + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + java.util.List getPatternsList(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + int getPatternsCount(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + java.lang.String getPatterns(int index); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + com.google.protobuf.ByteString getPatternsBytes(int index); + + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + int getConditionsCount(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + java.lang.String getConditions(int index); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + com.google.protobuf.ByteString getConditionsBytes(int index); + + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + java.util.List getPromotionsList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + com.google.cloud.retail.v2alpha.Promotion getPromotions(int index); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + int getPromotionsCount(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + java.util.List + getPromotionsOrBuilderList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2alpha.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.Promotion promotions = 34; + */ + com.google.cloud.retail.v2alpha.PromotionOrBuilder getPromotionsOrBuilder(int index); + + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + boolean hasPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + com.google.protobuf.Timestamp getPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2alpha.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + boolean hasRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + com.google.protobuf.FieldMask getRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2alpha.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s:
+   * * [audience][google.cloud.retail.v2alpha.Product.audience]
+   * * [availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [brands][google.cloud.retail.v2alpha.Product.brands]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * * [conditions][google.cloud.retail.v2alpha.Product.conditions]
+   * * [gtin][google.cloud.retail.v2alpha.Product.gtin]
+   * * [materials][google.cloud.retail.v2alpha.Product.materials]
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [patterns][google.cloud.retail.v2alpha.Product.patterns]
+   * * [price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [rating][google.cloud.retail.v2alpha.Product.rating]
+   * * [sizes][google.cloud.retail.v2alpha.Product.sizes]
+   * * [title][google.cloud.retail.v2alpha.Product.title]
+   * * [uri][google.cloud.retail.v2alpha.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2alpha.Product.categories]
+   * * [description][google.cloud.retail.v2alpha.Product.description]
+   * * [images][google.cloud.retail.v2alpha.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2alpha.Product.images]
+   * To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2alpha.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2alpha.Product.name]
+   * * [color_info][google.cloud.retail.v2alpha.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder(); + + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getVariantsList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.Product getVariants(int index); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getVariantsCount(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getVariantsOrBuilderList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2alpha.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getVariantsOrBuilder(int index); + + public com.google.cloud.retail.v2alpha.Product.ExpirationCase getExpirationCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductProto.java new file mode 100644 index 00000000..e7bd31eb --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductProto.java @@ -0,0 +1,189 @@ +/* + * 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/v2alpha/product.proto + +package com.google.cloud.retail.v2alpha; + +public final class ProductProto { + private ProductProto() {} + + 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_v2alpha_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_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/v2alpha/product.pr" + + "oto\022\033google.cloud.retail.v2alpha\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032(google/cloud/retail/v2alph" + + "a/common.proto\032+google/cloud/retail/v2al" + + "pha/promotion.proto\032\036google/protobuf/dur" + + "ation.proto\032 google/protobuf/field_mask." + + "proto\032\037google/protobuf/timestamp.proto\032\036" + + "google/protobuf/wrappers.proto\"\313\r\n\007Produ" + + "ct\0221\n\013expire_time\030\020 \001(\0132\032.google.protobu" + + "f.TimestampH\000\022-\n\003ttl\030\021 \001(\0132\031.google.prot" + + "obuf.DurationB\003\340A\004H\000\022\021\n\004name\030\001 \001(\tB\003\340A\005\022" + + "\017\n\002id\030\002 \001(\tB\003\340A\005\022<\n\004type\030\003 \001(\0162).google." + + "cloud.retail.v2alpha.Product.TypeB\003\340A\005\022\032" + + "\n\022primary_product_id\030\004 \001(\t\022\035\n\025collection" + + "_member_ids\030\005 \003(\t\022\014\n\004gtin\030\006 \001(\t\022\022\n\ncateg" + + "ories\030\007 \003(\t\022\022\n\005title\030\010 \001(\tB\003\340A\002\022\016\n\006brand" + + "s\030\t \003(\t\022\023\n\013description\030\n \001(\t\022\025\n\rlanguage" + + "_code\030\013 \001(\t\022H\n\nattributes\030\014 \003(\01324.google" + + ".cloud.retail.v2alpha.Product.Attributes" + + "Entry\022\014\n\004tags\030\r \003(\t\022:\n\nprice_info\030\016 \001(\0132" + + "&.google.cloud.retail.v2alpha.PriceInfo\022" + + "3\n\006rating\030\017 \001(\0132#.google.cloud.retail.v2" + + "alpha.Rating\0222\n\016available_time\030\022 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022G\n\014availability" + + "\030\023 \001(\01621.google.cloud.retail.v2alpha.Pro" + + "duct.Availability\0227\n\022available_quantity\030" + + "\024 \001(\0132\033.google.protobuf.Int32Value\022F\n\020fu" + + "lfillment_info\030\025 \003(\0132,.google.cloud.reta" + + "il.v2alpha.FulfillmentInfo\022\013\n\003uri\030\026 \001(\t\022" + + "2\n\006images\030\027 \003(\0132\".google.cloud.retail.v2" + + "alpha.Image\0227\n\010audience\030\030 \001(\0132%.google.c" + + "loud.retail.v2alpha.Audience\022:\n\ncolor_in" + + "fo\030\031 \001(\0132&.google.cloud.retail.v2alpha.C" + + "olorInfo\022\r\n\005sizes\030\032 \003(\t\022\021\n\tmaterials\030\033 \003" + + "(\t\022\020\n\010patterns\030\034 \003(\t\022\022\n\nconditions\030\035 \003(\t" + + "\022:\n\npromotions\030\" \003(\0132&.google.cloud.reta" + + "il.v2alpha.Promotion\0220\n\014publish_time\030! \001" + + "(\0132\032.google.protobuf.Timestamp\0226\n\022retrie" + + "vable_fields\030\036 \001(\0132\032.google.protobuf.Fie" + + "ldMask\022;\n\010variants\030\037 \003(\0132$.google.cloud." + + "retail.v2alpha.ProductB\003\340A\003\032_\n\017Attribute" + + "sEntry\022\013\n\003key\030\001 \001(\t\022;\n\005value\030\002 \001(\0132,.goo" + + "gle.cloud.retail.v2alpha.CustomAttribute" + + ":\0028\001\"F\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007PR" + + "IMARY\020\001\022\013\n\007VARIANT\020\002\022\016\n\nCOLLECTION\020\003\"i\n\014" + + "Availability\022\034\n\030AVAILABILITY_UNSPECIFIED" + + "\020\000\022\014\n\010IN_STOCK\020\001\022\020\n\014OUT_OF_STOCK\020\002\022\014\n\010PR" + + "EORDER\020\003\022\r\n\tBACKORDER\020\004:\204\001\352A\200\001\n\035retail.g" + + "oogleapis.com/Product\022_projects/{project" + + "}/locations/{location}/catalogs/{catalog" + + "}/branches/{branch}/products/{product}B\014" + + "\n\nexpirationB\311\002\n\037com.google.cloud.retail" + + ".v2alphaB\014ProductProtoP\001ZAgoogle.golang." + + "org/genproto/googleapis/cloud/retail/v2a" + + "lpha;retail\242\002\006RETAIL\252\002\033Google.Cloud.Reta" + + "il.V2Alpha\312\002\033Google\\Cloud\\Retail\\V2alpha" + + "\352\002\036Google::Cloud::Retail::V2alpha\352Al\n\034re" + + "tail.googleapis.com/Branch\022Lprojects/{pr" + + "oject}/locations/{location}/catalogs/{ca" + + "talog}/branches/{branch}b\006proto3" + }; + 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.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.PromotionProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_Product_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Product_descriptor, + new java.lang.String[] { + "ExpireTime", + "Ttl", + "Name", + "Id", + "Type", + "PrimaryProductId", + "CollectionMemberIds", + "Gtin", + "Categories", + "Title", + "Brands", + "Description", + "LanguageCode", + "Attributes", + "Tags", + "PriceInfo", + "Rating", + "AvailableTime", + "Availability", + "AvailableQuantity", + "FulfillmentInfo", + "Uri", + "Images", + "Audience", + "ColorInfo", + "Sizes", + "Materials", + "Patterns", + "Conditions", + "Promotions", + "PublishTime", + "RetrievableFields", + "Variants", + "Expiration", + }); + internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_Product_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Product_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.PromotionProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceProto.java new file mode 100644 index 00000000..0e16ad4a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceProto.java @@ -0,0 +1,476 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class ProductServiceProto { + private ProductServiceProto() {} + + 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_v2alpha_CreateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CreateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/retail/v2alpha/product_se" + + "rvice.proto\022\033google.cloud.retail.v2alpha" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032(goo" + + "gle/cloud/retail/v2alpha/common.proto\032/g" + + "oogle/cloud/retail/v2alpha/import_config" + + ".proto\032)google/cloud/retail/v2alpha/prod" + + "uct.proto\032.google/cloud/retail/v2alpha/p" + + "urge_config.proto\032#google/longrunning/op" + + "erations.proto\032\033google/protobuf/empty.pr" + + "oto\032 google/protobuf/field_mask.proto\032\037g" + + "oogle/protobuf/timestamp.proto\"\241\001\n\024Creat" + + "eProductRequest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n" + + "\034retail.googleapis.com/Branch\022:\n\007product" + + "\030\002 \001(\0132$.google.cloud.retail.v2alpha.Pro" + + "ductB\003\340A\002\022\027\n\nproduct_id\030\003 \001(\tB\003\340A\002\"H\n\021Ge" + + "tProductRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035r" + + "etail.googleapis.com/Product\"\232\001\n\024UpdateP" + + "roductRequest\022:\n\007product\030\001 \001(\0132$.google." + + "cloud.retail.v2alpha.ProductB\003\340A\002\022/\n\013upd" + + "ate_mask\030\002 \001(\0132\032.google.protobuf.FieldMa" + + "sk\022\025\n\rallow_missing\030\003 \001(\010\"K\n\024DeleteProdu" + + "ctRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035retail." + + "googleapis.com/Product\"\315\001\n\023ListProductsR" + + "equest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034retail.g" + + "oogleapis.com/Branch\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022-\n\tr" + + "ead_mask\030\005 \001(\0132\032.google.protobuf.FieldMa" + + "sk\022\032\n\022require_total_size\030\006 \001(\010\"{\n\024ListPr" + + "oductsResponse\0226\n\010products\030\001 \003(\0132$.googl" + + "e.cloud.retail.v2alpha.Product\022\027\n\017next_p" + + "age_token\030\002 \001(\t\022\022\n\ntotal_size\030\003 \001(\005\"\306\001\n\023" + + "SetInventoryRequest\022<\n\tinventory\030\001 \001(\0132$" + + ".google.cloud.retail.v2alpha.ProductB\003\340A" + + "\002\022,\n\010set_mask\030\002 \001(\0132\032.google.protobuf.Fi" + + "eldMask\022,\n\010set_time\030\003 \001(\0132\032.google.proto" + + "buf.Timestamp\022\025\n\rallow_missing\030\004 \001(\010\"\026\n\024" + + "SetInventoryMetadata\"\026\n\024SetInventoryResp" + + "onse\"\305\001\n\033AddFulfillmentPlacesRequest\0226\n\007" + + "product\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis" + + ".com/Product\022\021\n\004type\030\002 \001(\tB\003\340A\002\022\026\n\tplace" + + "_ids\030\003 \003(\tB\003\340A\002\022,\n\010add_time\030\004 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022\025\n\rallow_missing\030\005" + + " \001(\010\"\036\n\034AddFulfillmentPlacesMetadata\"\036\n\034" + + "AddFulfillmentPlacesResponse\"\224\002\n\032AddLoca" + + "lInventoriesRequest\0226\n\007product\030\001 \001(\tB%\340A" + + "\002\372A\037\n\035retail.googleapis.com/Product\022K\n\021l" + + "ocal_inventories\030\002 \003(\0132+.google.cloud.re" + + "tail.v2alpha.LocalInventoryB\003\340A\002\022,\n\010add_" + + "mask\030\004 \001(\0132\032.google.protobuf.FieldMask\022," + + "\n\010add_time\030\005 \001(\0132\032.google.protobuf.Times" + + "tamp\022\025\n\rallow_missing\030\006 \001(\010\"\035\n\033AddLocalI" + + "nventoriesMetadata\"\035\n\033AddLocalInventorie" + + "sResponse\"\267\001\n\035RemoveLocalInventoriesRequ" + + "est\0226\n\007product\030\001 \001(\tB%\340A\002\372A\037\n\035retail.goo" + + "gleapis.com/Product\022\026\n\tplace_ids\030\002 \003(\tB\003" + + "\340A\002\022/\n\013remove_time\030\005 \001(\0132\032.google.protob" + + "uf.Timestamp\022\025\n\rallow_missing\030\003 \001(\010\" \n\036R" + + "emoveLocalInventoriesMetadata\" \n\036RemoveL" + + "ocalInventoriesResponse\"\313\001\n\036RemoveFulfil" + + "lmentPlacesRequest\0226\n\007product\030\001 \001(\tB%\340A\002" + + "\372A\037\n\035retail.googleapis.com/Product\022\021\n\004ty" + + "pe\030\002 \001(\tB\003\340A\002\022\026\n\tplace_ids\030\003 \003(\tB\003\340A\002\022/\n" + + "\013remove_time\030\004 \001(\0132\032.google.protobuf.Tim" + + "estamp\022\025\n\rallow_missing\030\005 \001(\010\"!\n\037RemoveF" + + "ulfillmentPlacesMetadata\"!\n\037RemoveFulfil" + + "lmentPlacesResponse2\224\033\n\016ProductService\022\336" + + "\001\n\rCreateProduct\0221.google.cloud.retail.v" + + "2alpha.CreateProductRequest\032$.google.clo" + + "ud.retail.v2alpha.Product\"t\202\323\344\223\002R\"G/v2al" + + "pha/{parent=projects/*/locations/*/catal" + + "ogs/*/branches/*}/products:\007product\332A\031pa" + + "rent,product,product_id\022\273\001\n\nGetProduct\022." + + ".google.cloud.retail.v2alpha.GetProductR" + + "equest\032$.google.cloud.retail.v2alpha.Pro" + + "duct\"W\202\323\344\223\002J\022H/v2alpha/{name=projects/*/" + + "locations/*/catalogs/*/branches/*/produc" + + "ts/**}\332A\004name\022\315\001\n\014ListProducts\0220.google." + + "cloud.retail.v2alpha.ListProductsRequest" + + "\0321.google.cloud.retail.v2alpha.ListProdu" + + "ctsResponse\"X\202\323\344\223\002I\022G/v2alpha/{parent=pr" + + "ojects/*/locations/*/catalogs/*/branches" + + "/*}/products\332A\006parent\022\341\001\n\rUpdateProduct\022" + + "1.google.cloud.retail.v2alpha.UpdateProd" + + "uctRequest\032$.google.cloud.retail.v2alpha" + + ".Product\"w\202\323\344\223\002[2P/v2alpha/{product.name" + + "=projects/*/locations/*/catalogs/*/branc" + + "hes/*/products/**}:\007product\332A\023product,up" + + "date_mask\022\263\001\n\rDeleteProduct\0221.google.clo" + + "ud.retail.v2alpha.DeleteProductRequest\032\026" + + ".google.protobuf.Empty\"W\202\323\344\223\002J*H/v2alpha" + + "/{name=projects/*/locations/*/catalogs/*" + + "/branches/*/products/**}\332A\004name\022\245\002\n\rPurg" + + "eProducts\0221.google.cloud.retail.v2alpha." + + "PurgeProductsRequest\032\035.google.longrunnin" + + "g.Operation\"\301\001\202\323\344\223\002R\"M/v2alpha/{parent=p" + + "rojects/*/locations/*/catalogs/*/branche" + + "s/*}/products:purge:\001*\312Af\n1google.cloud." + + "retail.v2alpha.PurgeProductsResponse\0221go" + + "ogle.cloud.retail.v2alpha.PurgeProductsM" + + "etadata\022\242\002\n\016ImportProducts\0222.google.clou" + + "d.retail.v2alpha.ImportProductsRequest\032\035" + + ".google.longrunning.Operation\"\274\001\202\323\344\223\002S\"N" + + "/v2alpha/{parent=projects/*/locations/*/" + + "catalogs/*/branches/*}/products:import:\001" + + "*\312A`\n2google.cloud.retail.v2alpha.Import" + + "ProductsResponse\022*google.cloud.retail.v2" + + "alpha.ImportMetadata\022\310\002\n\014SetInventory\0220." + + "google.cloud.retail.v2alpha.SetInventory" + + "Request\032\035.google.longrunning.Operation\"\346" + + "\001\202\323\344\223\002d\"_/v2alpha/{inventory.name=projec" + + "ts/*/locations/*/catalogs/*/branches/*/p" + + "roducts/**}:setInventory:\001*\332A\022inventory," + + "set_mask\312Ad\n0google.cloud.retail.v2alpha" + + ".SetInventoryResponse\0220google.cloud.reta" + + "il.v2alpha.SetInventoryMetadata\022\336\002\n\024AddF" + + "ulfillmentPlaces\0228.google.cloud.retail.v" + + "2alpha.AddFulfillmentPlacesRequest\032\035.goo" + + "gle.longrunning.Operation\"\354\001\202\323\344\223\002e\"`/v2a" + + "lpha/{product=projects/*/locations/*/cat" + + "alogs/*/branches/*/products/**}:addFulfi" + + "llmentPlaces:\001*\332A\007product\312At\n8google.clo" + + "ud.retail.v2alpha.AddFulfillmentPlacesRe" + + "sponse\0228google.cloud.retail.v2alpha.AddF" + + "ulfillmentPlacesMetadata\022\355\002\n\027RemoveFulfi" + + "llmentPlaces\022;.google.cloud.retail.v2alp" + + "ha.RemoveFulfillmentPlacesRequest\032\035.goog" + + "le.longrunning.Operation\"\365\001\202\323\344\223\002h\"c/v2al" + + "pha/{product=projects/*/locations/*/cata" + + "logs/*/branches/*/products/**}:removeFul" + + "fillmentPlaces:\001*\332A\007product\312Az\n;google.c" + + "loud.retail.v2alpha.RemoveFulfillmentPla" + + "cesResponse\022;google.cloud.retail.v2alpha" + + ".RemoveFulfillmentPlacesMetadata\022\331\002\n\023Add" + + "LocalInventories\0227.google.cloud.retail.v" + + "2alpha.AddLocalInventoriesRequest\032\035.goog" + + "le.longrunning.Operation\"\351\001\202\323\344\223\002d\"_/v2al" + + "pha/{product=projects/*/locations/*/cata" + + "logs/*/branches/*/products/**}:addLocalI" + + "nventories:\001*\332A\007product\312Ar\n7google.cloud" + + ".retail.v2alpha.AddLocalInventoriesRespo" + + "nse\0227google.cloud.retail.v2alpha.AddLoca" + + "lInventoriesMetadata\022\350\002\n\026RemoveLocalInve" + + "ntories\022:.google.cloud.retail.v2alpha.Re" + + "moveLocalInventoriesRequest\032\035.google.lon" + + "grunning.Operation\"\362\001\202\323\344\223\002g\"b/v2alpha/{p" + + "roduct=projects/*/locations/*/catalogs/*" + + "/branches/*/products/**}:removeLocalInve" + + "ntories:\001*\332A\007product\312Ax\n:google.cloud.re" + + "tail.v2alpha.RemoveLocalInventoriesRespo" + + "nse\022:google.cloud.retail.v2alpha.RemoveL" + + "ocalInventoriesMetadata\032I\312A\025retail.googl" + + "eapis.com\322A.https://www.googleapis.com/a" + + "uth/cloud-platformB\341\001\n\037com.google.cloud." + + "retail.v2alphaB\023ProductServiceProtoP\001ZAg" + + "oogle.golang.org/genproto/googleapis/clo" + + "ud/retail/v2alpha;retail\242\002\006RETAIL\252\002\033Goog" + + "le.Cloud.Retail.V2Alpha\312\002\033Google\\Cloud\\R" + + "etail\\V2alpha\352\002\036Google::Cloud::Retail::V" + + "2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(), + com.google.cloud.retail.v2alpha.PurgeConfigProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_CreateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_CreateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CreateProductRequest_descriptor, + new java.lang.String[] { + "Parent", "Product", "ProductId", + }); + internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_GetProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor, + new java.lang.String[] { + "Product", "UpdateMask", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_DeleteProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_ListProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "ReadMask", "RequireTotalSize", + }); + internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_ListProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListProductsResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor, + new java.lang.String[] { + "Inventory", "SetMask", "SetTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesRequest_descriptor, + new java.lang.String[] { + "Product", "Type", "PlaceIds", "AddTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddFulfillmentPlacesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesRequest_descriptor, + new java.lang.String[] { + "Product", "LocalInventories", "AddMask", "AddTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddLocalInventoriesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor, + new java.lang.String[] { + "Product", "PlaceIds", "RemoveTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor, + new java.lang.String[] { + "Product", "Type", "PlaceIds", "RemoveTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_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.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(); + com.google.cloud.retail.v2alpha.PurgeConfigProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Promotion.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Promotion.java new file mode 100644 index 00000000..a205a8c9 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Promotion.java @@ -0,0 +1,678 @@ +/* + * 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/v2alpha/promotion.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Promotion information.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Promotion} + */ +public final class Promotion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Promotion) + PromotionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Promotion.newBuilder() to construct. + private Promotion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Promotion() { + promotionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Promotion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Promotion( + 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(); + + promotionId_ = 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.v2alpha.PromotionProto + .internal_static_google_cloud_retail_v2alpha_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PromotionProto + .internal_static_google_cloud_retail_v2alpha_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Promotion.class, + com.google.cloud.retail.v2alpha.Promotion.Builder.class); + } + + public static final int PROMOTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object promotionId_; + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + @java.lang.Override + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + 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(); + promotionId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = 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(promotionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, promotionId_); + } + 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(promotionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, promotionId_); + } + 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.v2alpha.Promotion)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Promotion other = + (com.google.cloud.retail.v2alpha.Promotion) obj; + + if (!getPromotionId().equals(other.getPromotionId())) 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) + PROMOTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPromotionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Promotion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Promotion 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; + } + /** + * + * + *
+   * Promotion information.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Promotion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Promotion) + com.google.cloud.retail.v2alpha.PromotionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PromotionProto + .internal_static_google_cloud_retail_v2alpha_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PromotionProto + .internal_static_google_cloud_retail_v2alpha_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Promotion.class, + com.google.cloud.retail.v2alpha.Promotion.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Promotion.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(); + promotionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PromotionProto + .internal_static_google_cloud_retail_v2alpha_Promotion_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Promotion getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Promotion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Promotion build() { + com.google.cloud.retail.v2alpha.Promotion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Promotion buildPartial() { + com.google.cloud.retail.v2alpha.Promotion result = + new com.google.cloud.retail.v2alpha.Promotion(this); + result.promotionId_ = promotionId_; + 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.v2alpha.Promotion) { + return mergeFrom((com.google.cloud.retail.v2alpha.Promotion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Promotion other) { + if (other == com.google.cloud.retail.v2alpha.Promotion.getDefaultInstance()) return this; + if (!other.getPromotionId().isEmpty()) { + promotionId_ = other.promotionId_; + 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.v2alpha.Promotion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Promotion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object promotionId_ = ""; + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + promotionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + promotionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPromotionId() { + + promotionId_ = getDefaultInstance().getPromotionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The bytes for promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + promotionId_ = 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.v2alpha.Promotion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Promotion) + private static final com.google.cloud.retail.v2alpha.Promotion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Promotion(); + } + + public static com.google.cloud.retail.v2alpha.Promotion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Promotion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Promotion(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.v2alpha.Promotion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionOrBuilder.java new file mode 100644 index 00000000..ce3671f8 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionOrBuilder.java @@ -0,0 +1,62 @@ +/* + * 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/v2alpha/promotion.proto + +package com.google.cloud.retail.v2alpha; + +public interface PromotionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Promotion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + java.lang.String getPromotionId(); + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + com.google.protobuf.ByteString getPromotionIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionProto.java new file mode 100644 index 00000000..8b2b1cfa --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PromotionProto.java @@ -0,0 +1,67 @@ +/* + * 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/v2alpha/promotion.proto + +package com.google.cloud.retail.v2alpha; + +public final class PromotionProto { + private PromotionProto() {} + + 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_v2alpha_Promotion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_Promotion_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/v2alpha/promotion." + + "proto\022\033google.cloud.retail.v2alpha\"!\n\tPr" + + "omotion\022\024\n\014promotion_id\030\001 \001(\tB\334\001\n\037com.go" + + "ogle.cloud.retail.v2alphaB\016PromotionProt" + + "oP\001ZAgoogle.golang.org/genproto/googleap" + + "is/cloud/retail/v2alpha;retail\242\002\006RETAIL\252" + + "\002\033Google.Cloud.Retail.V2Alpha\312\002\033Google\\C" + + "loud\\Retail\\V2alpha\352\002\036Google::Cloud::Ret" + + "ail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_retail_v2alpha_Promotion_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_Promotion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_Promotion_descriptor, + new java.lang.String[] { + "PromotionId", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransaction.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransaction.java new file mode 100644 index 00000000..6e12b3b7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransaction.java @@ -0,0 +1,1126 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * A transaction represents the entire purchase transaction.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurchaseTransaction} + */ +public final class PurchaseTransaction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurchaseTransaction) + PurchaseTransactionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurchaseTransaction.newBuilder() to construct. + private PurchaseTransaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurchaseTransaction() { + id_ = ""; + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurchaseTransaction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurchaseTransaction( + 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(); + + id_ = s; + break; + } + case 21: + { + revenue_ = input.readFloat(); + break; + } + case 29: + { + tax_ = input.readFloat(); + break; + } + case 37: + { + cost_ = input.readFloat(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + currencyCode_ = 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.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurchaseTransaction.class, + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVENUE_FIELD_NUMBER = 2; + private float revenue_; + /** + * + * + *
+   * Required. Total non-zero revenue or grand total associated with the
+   * transaction. This value include shipping, tax, or other adjustments to
+   * total revenue that you want to include as part of your revenue
+   * calculations.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + @java.lang.Override + public float getRevenue() { + return revenue_; + } + + public static final int TAX_FIELD_NUMBER = 3; + private float tax_; + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * float tax = 3; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + + public static final int COST_FIELD_NUMBER = 4; + private float cost_; + /** + * + * + *
+   * All the costs associated with the products. These can be manufacturing
+   * costs, shipping expenses not borne by the end user, or any other costs,
+   * such that:
+   * * Profit =
+   * [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] -
+   * [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] -
+   * [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost]
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (java.lang.Float.floatToRawIntBits(revenue_) != 0) { + output.writeFloat(2, revenue_); + } + if (java.lang.Float.floatToRawIntBits(tax_) != 0) { + output.writeFloat(3, tax_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + output.writeFloat(4, cost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, currencyCode_); + } + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (java.lang.Float.floatToRawIntBits(revenue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, revenue_); + } + if (java.lang.Float.floatToRawIntBits(tax_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, tax_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, currencyCode_); + } + 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.v2alpha.PurchaseTransaction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurchaseTransaction other = + (com.google.cloud.retail.v2alpha.PurchaseTransaction) obj; + + if (!getId().equals(other.getId())) return false; + if (java.lang.Float.floatToIntBits(getRevenue()) + != java.lang.Float.floatToIntBits(other.getRevenue())) return false; + if (java.lang.Float.floatToIntBits(getTax()) != java.lang.Float.floatToIntBits(other.getTax())) + return false; + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + REVENUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRevenue()); + hash = (37 * hash) + TAX_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTax()); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PurchaseTransaction 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; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurchaseTransaction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurchaseTransaction) + com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurchaseTransaction.class, + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurchaseTransaction.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(); + id_ = ""; + + revenue_ = 0F; + + tax_ = 0F; + + cost_ = 0F; + + currencyCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurchaseTransaction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurchaseTransaction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurchaseTransaction build() { + com.google.cloud.retail.v2alpha.PurchaseTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurchaseTransaction buildPartial() { + com.google.cloud.retail.v2alpha.PurchaseTransaction result = + new com.google.cloud.retail.v2alpha.PurchaseTransaction(this); + result.id_ = id_; + result.revenue_ = revenue_; + result.tax_ = tax_; + result.cost_ = cost_; + result.currencyCode_ = currencyCode_; + 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.v2alpha.PurchaseTransaction) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurchaseTransaction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurchaseTransaction other) { + if (other == com.google.cloud.retail.v2alpha.PurchaseTransaction.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.getRevenue() != 0F) { + setRevenue(other.getRevenue()); + } + if (other.getTax() != 0F) { + setTax(other.getTax()); + } + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + 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.v2alpha.PurchaseTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurchaseTransaction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private float revenue_; + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + @java.lang.Override + public float getRevenue() { + return revenue_; + } + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The revenue to set. + * @return This builder for chaining. + */ + public Builder setRevenue(float value) { + + revenue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRevenue() { + + revenue_ = 0F; + onChanged(); + return this; + } + + private float tax_; + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @param value The tax to set. + * @return This builder for chaining. + */ + public Builder setTax(float value) { + + tax_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @return This builder for chaining. + */ + public Builder clearTax() { + + tax_ = 0F; + onChanged(); + return this; + } + + private float cost_; + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + + cost_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = 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.v2alpha.PurchaseTransaction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurchaseTransaction) + private static final com.google.cloud.retail.v2alpha.PurchaseTransaction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurchaseTransaction(); + } + + public static com.google.cloud.retail.v2alpha.PurchaseTransaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurchaseTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurchaseTransaction(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.v2alpha.PurchaseTransaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransactionOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransactionOrBuilder.java new file mode 100644 index 00000000..93e5de09 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurchaseTransactionOrBuilder.java @@ -0,0 +1,123 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurchaseTransactionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurchaseTransaction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. Total non-zero revenue or grand total associated with the
+   * transaction. This value include shipping, tax, or other adjustments to
+   * total revenue that you want to include as part of your revenue
+   * calculations.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + float getRevenue(); + + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * float tax = 3; + * + * @return The tax. + */ + float getTax(); + + /** + * + * + *
+   * All the costs associated with the products. These can be manufacturing
+   * costs, shipping expenses not borne by the end user, or any other costs,
+   * such that:
+   * * Profit =
+   * [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] -
+   * [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] -
+   * [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost]
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + float getCost(); + + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeConfigProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeConfigProto.java new file mode 100644 index 00000000..0c8bf340 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeConfigProto.java @@ -0,0 +1,154 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public final class PurgeConfigProto { + private PurgeConfigProto() {} + + 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_v2alpha_PurgeMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_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/v2alpha/purge_conf" + + "ig.proto\022\033google.cloud.retail.v2alpha\032\037g" + + "oogle/api/field_behavior.proto\032\031google/a" + + "pi/resource.proto\032\037google/protobuf/times" + + "tamp.proto\"\017\n\rPurgeMetadata\"\247\001\n\025PurgePro" + + "ductsMetadata\022/\n\013create_time\030\001 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022/\n\013update_time\030\002 " + + "\001(\0132\032.google.protobuf.Timestamp\022\025\n\rsucce" + + "ss_count\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001(\003\"p\n" + + "\024PurgeProductsRequest\0224\n\006parent\030\001 \001(\tB$\340" + + "A\002\372A\036\n\034retail.googleapis.com/Branch\022\023\n\006f" + + "ilter\030\002 \001(\tB\003\340A\002\022\r\n\005force\030\003 \001(\010\"f\n\025Purge" + + "ProductsResponse\022\023\n\013purge_count\030\001 \001(\003\0228\n" + + "\014purge_sample\030\002 \003(\tB\"\372A\037\n\035retail.googlea" + + "pis.com/Product\"Q\n\026PurgeUserEventsReques" + + "t\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\023\n\006filter\030\002 \001(\tB\003" + + "\340A\002\022\r\n\005force\030\003 \001(\010\"6\n\027PurgeUserEventsRes" + + "ponse\022\033\n\023purged_events_count\030\001 \001(\003B\336\001\n\037c" + + "om.google.cloud.retail.v2alphaB\020PurgeCon" + + "figProtoP\001ZAgoogle.golang.org/genproto/g" + + "oogleapis/cloud/retail/v2alpha;retail\242\002\006" + + "RETAIL\252\002\033Google.Cloud.Retail.V2Alpha\312\002\033G" + + "oogle\\Cloud\\Retail\\V2alpha\352\002\036Google::Clo" + + "ud::Retail::V2alphab\006proto3" + }; + 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(), + }); + internal_static_google_cloud_retail_v2alpha_PurgeMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_PurgeMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", "SuccessCount", "FailureCount", + }); + internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor, + new java.lang.String[] { + "PurgeCount", "PurgeSample", + }); + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor, + new java.lang.String[] { + "PurgedEventsCount", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadata.java new file mode 100644 index 00000000..11952a5f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadata.java @@ -0,0 +1,458 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the Purge operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeMetadata} + */ +public final class PurgeMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeMetadata) + PurgeMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeMetadata.newBuilder() to construct. + private PurgeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeMetadata( + 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeMetadata.class, + com.google.cloud.retail.v2alpha.PurgeMetadata.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.v2alpha.PurgeMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeMetadata other = + (com.google.cloud.retail.v2alpha.PurgeMetadata) 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.v2alpha.PurgeMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PurgeMetadata 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 related to the progress of the Purge operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeMetadata) + com.google.cloud.retail.v2alpha.PurgeMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeMetadata.class, + com.google.cloud.retail.v2alpha.PurgeMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeMetadata.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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeMetadata build() { + com.google.cloud.retail.v2alpha.PurgeMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeMetadata buildPartial() { + com.google.cloud.retail.v2alpha.PurgeMetadata result = + new com.google.cloud.retail.v2alpha.PurgeMetadata(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.v2alpha.PurgeMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeMetadata other) { + if (other == com.google.cloud.retail.v2alpha.PurgeMetadata.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.v2alpha.PurgeMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.PurgeMetadata) 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.v2alpha.PurgeMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeMetadata) + private static final com.google.cloud.retail.v2alpha.PurgeMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeMetadata(); + } + + public static com.google.cloud.retail.v2alpha.PurgeMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeMetadata(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.v2alpha.PurgeMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadataOrBuilder.java new file mode 100644 index 00000000..53fbe554 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeMetadataOrBuilder.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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadata.java new file mode 100644 index 00000000..2d842373 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadata.java @@ -0,0 +1,1197 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the PurgeProducts operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsMetadata} + */ +public final class PurgeProductsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeProductsMetadata) + PurgeProductsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeProductsMetadata.newBuilder() to construct. + private PurgeProductsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeProductsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeProductsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeProductsMetadata( + 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.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 18: + { + 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 24: + { + successCount_ = input.readInt64(); + break; + } + case 32: + { + failureCount_ = input.readInt64(); + 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsMetadata.class, + com.google.cloud.retail.v2alpha.PurgeProductsMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_; + /** + * + * + *
+   * Count of entries that were deleted successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + + public static final int FAILURE_COUNT_FIELD_NUMBER = 4; + private long failureCount_; + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + + 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(2, getUpdateTime()); + } + if (successCount_ != 0L) { + output.writeInt64(3, successCount_); + } + if (failureCount_ != 0L) { + output.writeInt64(4, failureCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateTime()); + } + if (successCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, successCount_); + } + if (failureCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, failureCount_); + } + 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.v2alpha.PurgeProductsMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeProductsMetadata other = + (com.google.cloud.retail.v2alpha.PurgeProductsMetadata) obj; + + 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 (getSuccessCount() != other.getSuccessCount()) return false; + if (getFailureCount() != other.getFailureCount()) 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 (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) + SUCCESS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSuccessCount()); + hash = (37 * hash) + FAILURE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailureCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PurgeProductsMetadata 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 related to the progress of the PurgeProducts operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeProductsMetadata) + com.google.cloud.retail.v2alpha.PurgeProductsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsMetadata.class, + com.google.cloud.retail.v2alpha.PurgeProductsMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeProductsMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + successCount_ = 0L; + + failureCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeProductsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsMetadata build() { + com.google.cloud.retail.v2alpha.PurgeProductsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsMetadata buildPartial() { + com.google.cloud.retail.v2alpha.PurgeProductsMetadata result = + new com.google.cloud.retail.v2alpha.PurgeProductsMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.successCount_ = successCount_; + result.failureCount_ = failureCount_; + 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.v2alpha.PurgeProductsMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeProductsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeProductsMetadata other) { + if (other == com.google.cloud.retail.v2alpha.PurgeProductsMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getSuccessCount() != 0L) { + setSuccessCount(other.getSuccessCount()); + } + if (other.getFailureCount() != 0L) { + setFailureCount(other.getFailureCount()); + } + 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.v2alpha.PurgeProductsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurgeProductsMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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 long successCount_; + /** + * + * + *
+     * Count of entries that were deleted successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + /** + * + * + *
+     * Count of entries that were deleted successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @param value The successCount to set. + * @return This builder for chaining. + */ + public Builder setSuccessCount(long value) { + + successCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were deleted successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + + successCount_ = 0L; + onChanged(); + return this; + } + + private long failureCount_; + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @param value The failureCount to set. + * @return This builder for chaining. + */ + public Builder setFailureCount(long value) { + + failureCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + + failureCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PurgeProductsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeProductsMetadata) + private static final com.google.cloud.retail.v2alpha.PurgeProductsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeProductsMetadata(); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeProductsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeProductsMetadata(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.v2alpha.PurgeProductsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadataOrBuilder.java new file mode 100644 index 00000000..ed6bd53a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeProductsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeProductsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Count of entries that were deleted successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + long getSuccessCount(); + + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + long getFailureCount(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequest.java new file mode 100644 index 00000000..103b1a8f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequest.java @@ -0,0 +1,1146 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for PurgeProducts method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsRequest} + */ +public final class PurgeProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeProductsRequest) + PurgeProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeProductsRequest.newBuilder() to construct. + private PurgeProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeProductsRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeProductsRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + force_ = 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsRequest.class, + com.google.cloud.retail.v2alpha.PurgeProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the branch under which the products are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+   * 
+ * + * + * 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 resource name of the branch under which the products are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+   * 
+ * + * + * 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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Required. The filter string to specify the products to be deleted with a
+   * length limit of 5,000 characters.
+   * Empty string filter is not allowed. "*" implies delete all items in a
+   * branch.
+   * The eligible fields for filtering are:
+   * * `availability`: Double quoted
+   * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * string.
+   * * `create_time` : in ISO 8601 "zulu" format.
+   * Supported syntax:
+   * * Comparators (">", "<", ">=", "<=", "=").
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z"
+   *   * availability = "IN_STOCK"
+   * * Conjunctions ("AND")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+   * * Disjunctions ("OR")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+   * * Can support nested queries.
+   *   Examples:
+   *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+   *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+   * * Filter Limits:
+   *   * Filter should not contain more than 6 conditions.
+   *   * Max nesting depth should not exceed 2 levels.
+   * Examples queries:
+   * * Delete back order products created before a timestamp.
+   *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The filter string to specify the products to be deleted with a
+   * length limit of 5,000 characters.
+   * Empty string filter is not allowed. "*" implies delete all items in a
+   * branch.
+   * The eligible fields for filtering are:
+   * * `availability`: Double quoted
+   * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * string.
+   * * `create_time` : in ISO 8601 "zulu" format.
+   * Supported syntax:
+   * * Comparators (">", "<", ">=", "<=", "=").
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z"
+   *   * availability = "IN_STOCK"
+   * * Conjunctions ("AND")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+   * * Disjunctions ("OR")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+   * * Can support nested queries.
+   *   Examples:
+   *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+   *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+   * * Filter Limits:
+   *   * Filter should not contain more than 6 conditions.
+   *   * Max nesting depth should not exceed 2 levels.
+   * Examples queries:
+   * * Delete back order products created before a timestamp.
+   *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any products.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (force_ != false) { + output.writeBool(3, force_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } + 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.v2alpha.PurgeProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeProductsRequest other = + (com.google.cloud.retail.v2alpha.PurgeProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.PurgeProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for PurgeProducts method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeProductsRequest) + com.google.cloud.retail.v2alpha.PurgeProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsRequest.class, + com.google.cloud.retail.v2alpha.PurgeProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeProductsRequest.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_ = ""; + + filter_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsRequest build() { + com.google.cloud.retail.v2alpha.PurgeProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsRequest buildPartial() { + com.google.cloud.retail.v2alpha.PurgeProductsRequest result = + new com.google.cloud.retail.v2alpha.PurgeProductsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.force_ = force_; + 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.v2alpha.PurgeProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeProductsRequest other) { + if (other == com.google.cloud.retail.v2alpha.PurgeProductsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.v2alpha.PurgeProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurgeProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the branch under which the products are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+     * 
+ * + * + * 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 resource name of the branch under which the products are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+     * 
+ * + * + * 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 resource name of the branch under which the products are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+     * 
+ * + * + * 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 resource name of the branch under which the products are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+     * 
+ * + * + * 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 resource name of the branch under which the products are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+     * 
+ * + * + * 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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. The filter string to specify the products to be deleted with a
+     * length limit of 5,000 characters.
+     * Empty string filter is not allowed. "*" implies delete all items in a
+     * branch.
+     * The eligible fields for filtering are:
+     * * `availability`: Double quoted
+     * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * string.
+     * * `create_time` : in ISO 8601 "zulu" format.
+     * Supported syntax:
+     * * Comparators (">", "<", ">=", "<=", "=").
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z"
+     *   * availability = "IN_STOCK"
+     * * Conjunctions ("AND")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+     * * Disjunctions ("OR")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+     * * Can support nested queries.
+     *   Examples:
+     *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+     *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+     * * Filter Limits:
+     *   * Filter should not contain more than 6 conditions.
+     *   * Max nesting depth should not exceed 2 levels.
+     * Examples queries:
+     * * Delete back order products created before a timestamp.
+     *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the products to be deleted with a
+     * length limit of 5,000 characters.
+     * Empty string filter is not allowed. "*" implies delete all items in a
+     * branch.
+     * The eligible fields for filtering are:
+     * * `availability`: Double quoted
+     * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * string.
+     * * `create_time` : in ISO 8601 "zulu" format.
+     * Supported syntax:
+     * * Comparators (">", "<", ">=", "<=", "=").
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z"
+     *   * availability = "IN_STOCK"
+     * * Conjunctions ("AND")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+     * * Disjunctions ("OR")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+     * * Can support nested queries.
+     *   Examples:
+     *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+     *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+     * * Filter Limits:
+     *   * Filter should not contain more than 6 conditions.
+     *   * Max nesting depth should not exceed 2 levels.
+     * Examples queries:
+     * * Delete back order products created before a timestamp.
+     *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the products to be deleted with a
+     * length limit of 5,000 characters.
+     * Empty string filter is not allowed. "*" implies delete all items in a
+     * branch.
+     * The eligible fields for filtering are:
+     * * `availability`: Double quoted
+     * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * string.
+     * * `create_time` : in ISO 8601 "zulu" format.
+     * Supported syntax:
+     * * Comparators (">", "<", ">=", "<=", "=").
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z"
+     *   * availability = "IN_STOCK"
+     * * Conjunctions ("AND")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+     * * Disjunctions ("OR")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+     * * Can support nested queries.
+     *   Examples:
+     *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+     *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+     * * Filter Limits:
+     *   * Filter should not contain more than 6 conditions.
+     *   * Max nesting depth should not exceed 2 levels.
+     * Examples queries:
+     * * Delete back order products created before a timestamp.
+     *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the products to be deleted with a
+     * length limit of 5,000 characters.
+     * Empty string filter is not allowed. "*" implies delete all items in a
+     * branch.
+     * The eligible fields for filtering are:
+     * * `availability`: Double quoted
+     * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * string.
+     * * `create_time` : in ISO 8601 "zulu" format.
+     * Supported syntax:
+     * * Comparators (">", "<", ">=", "<=", "=").
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z"
+     *   * availability = "IN_STOCK"
+     * * Conjunctions ("AND")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+     * * Disjunctions ("OR")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+     * * Can support nested queries.
+     *   Examples:
+     *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+     *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+     * * Filter Limits:
+     *   * Filter should not contain more than 6 conditions.
+     *   * Max nesting depth should not exceed 2 levels.
+     * Examples queries:
+     * * Delete back order products created before a timestamp.
+     *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the products to be deleted with a
+     * length limit of 5,000 characters.
+     * Empty string filter is not allowed. "*" implies delete all items in a
+     * branch.
+     * The eligible fields for filtering are:
+     * * `availability`: Double quoted
+     * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * string.
+     * * `create_time` : in ISO 8601 "zulu" format.
+     * Supported syntax:
+     * * Comparators (">", "<", ">=", "<=", "=").
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z"
+     *   * availability = "IN_STOCK"
+     * * Conjunctions ("AND")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+     * * Disjunctions ("OR")
+     *   Examples:
+     *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+     * * Can support nested queries.
+     *   Examples:
+     *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+     *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+     * * Filter Limits:
+     *   * Filter should not contain more than 6 conditions.
+     *   * Max nesting depth should not exceed 2 levels.
+     * Examples queries:
+     * * Delete back order products created before a timestamp.
+     *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any products.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any products.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any products.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = 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.v2alpha.PurgeProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeProductsRequest) + private static final com.google.cloud.retail.v2alpha.PurgeProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeProductsRequest(); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeProductsRequest(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.v2alpha.PurgeProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequestOrBuilder.java new file mode 100644 index 00000000..704921aa --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsRequestOrBuilder.java @@ -0,0 +1,156 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the branch under which the products are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the branch under which the products are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The filter string to specify the products to be deleted with a
+   * length limit of 5,000 characters.
+   * Empty string filter is not allowed. "*" implies delete all items in a
+   * branch.
+   * The eligible fields for filtering are:
+   * * `availability`: Double quoted
+   * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * string.
+   * * `create_time` : in ISO 8601 "zulu" format.
+   * Supported syntax:
+   * * Comparators (">", "<", ">=", "<=", "=").
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z"
+   *   * availability = "IN_STOCK"
+   * * Conjunctions ("AND")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+   * * Disjunctions ("OR")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+   * * Can support nested queries.
+   *   Examples:
+   *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+   *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+   * * Filter Limits:
+   *   * Filter should not contain more than 6 conditions.
+   *   * Max nesting depth should not exceed 2 levels.
+   * Examples queries:
+   * * Delete back order products created before a timestamp.
+   *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. The filter string to specify the products to be deleted with a
+   * length limit of 5,000 characters.
+   * Empty string filter is not allowed. "*" implies delete all items in a
+   * branch.
+   * The eligible fields for filtering are:
+   * * `availability`: Double quoted
+   * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * string.
+   * * `create_time` : in ISO 8601 "zulu" format.
+   * Supported syntax:
+   * * Comparators (">", "<", ">=", "<=", "=").
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z"
+   *   * availability = "IN_STOCK"
+   * * Conjunctions ("AND")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
+   * * Disjunctions ("OR")
+   *   Examples:
+   *   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
+   * * Can support nested queries.
+   *   Examples:
+   *   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
+   *   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
+   * * Filter Limits:
+   *   * Filter should not contain more than 6 conditions.
+   *   * Max nesting depth should not exceed 2 levels.
+   * Examples queries:
+   * * Delete back order products created before a timestamp.
+   *   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any products.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponse.java new file mode 100644 index 00000000..495a7715 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponse.java @@ -0,0 +1,860 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the PurgeProductsRequest. If the long running operation is
+ * successfully done, then this message is returned by the
+ * google.longrunning.Operations.response field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsResponse} + */ +public final class PurgeProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeProductsResponse) + PurgeProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeProductsResponse.newBuilder() to construct. + private PurgeProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeProductsResponse() { + purgeSample_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeProductsResponse( + 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 8: + { + purgeCount_ = input.readInt64(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + purgeSample_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + purgeSample_.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)) { + purgeSample_ = purgeSample_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsResponse.class, + com.google.cloud.retail.v2alpha.PurgeProductsResponse.Builder.class); + } + + public static final int PURGE_COUNT_FIELD_NUMBER = 1; + private long purgeCount_; + /** + * + * + *
+   * The total count of products purged as a result of the operation.
+   * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + @java.lang.Override + public long getPurgeCount() { + return purgeCount_; + } + + public static final int PURGE_SAMPLE_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList purgeSample_; + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the purgeSample. + */ + public com.google.protobuf.ProtocolStringList getPurgeSampleList() { + return purgeSample_; + } + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return The count of purgeSample. + */ + public int getPurgeSampleCount() { + return purgeSample_.size(); + } + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The purgeSample at the given index. + */ + public java.lang.String getPurgeSample(int index) { + return purgeSample_.get(index); + } + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the purgeSample at the given index. + */ + public com.google.protobuf.ByteString getPurgeSampleBytes(int index) { + return purgeSample_.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 (purgeCount_ != 0L) { + output.writeInt64(1, purgeCount_); + } + for (int i = 0; i < purgeSample_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, purgeSample_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (purgeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, purgeCount_); + } + { + int dataSize = 0; + for (int i = 0; i < purgeSample_.size(); i++) { + dataSize += computeStringSizeNoTag(purgeSample_.getRaw(i)); + } + size += dataSize; + size += 1 * getPurgeSampleList().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.v2alpha.PurgeProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeProductsResponse other = + (com.google.cloud.retail.v2alpha.PurgeProductsResponse) obj; + + if (getPurgeCount() != other.getPurgeCount()) return false; + if (!getPurgeSampleList().equals(other.getPurgeSampleList())) 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) + PURGE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPurgeCount()); + if (getPurgeSampleCount() > 0) { + hash = (37 * hash) + PURGE_SAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getPurgeSampleList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PurgeProductsResponse 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 PurgeProductsRequest. If the long running operation is
+   * successfully done, then this message is returned by the
+   * google.longrunning.Operations.response field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeProductsResponse) + com.google.cloud.retail.v2alpha.PurgeProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeProductsResponse.class, + com.google.cloud.retail.v2alpha.PurgeProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeProductsResponse.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(); + purgeCount_ = 0L; + + purgeSample_ = 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsResponse build() { + com.google.cloud.retail.v2alpha.PurgeProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeProductsResponse buildPartial() { + com.google.cloud.retail.v2alpha.PurgeProductsResponse result = + new com.google.cloud.retail.v2alpha.PurgeProductsResponse(this); + int from_bitField0_ = bitField0_; + result.purgeCount_ = purgeCount_; + if (((bitField0_ & 0x00000001) != 0)) { + purgeSample_ = purgeSample_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.purgeSample_ = purgeSample_; + 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.v2alpha.PurgeProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeProductsResponse other) { + if (other == com.google.cloud.retail.v2alpha.PurgeProductsResponse.getDefaultInstance()) + return this; + if (other.getPurgeCount() != 0L) { + setPurgeCount(other.getPurgeCount()); + } + if (!other.purgeSample_.isEmpty()) { + if (purgeSample_.isEmpty()) { + purgeSample_ = other.purgeSample_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePurgeSampleIsMutable(); + purgeSample_.addAll(other.purgeSample_); + } + 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.v2alpha.PurgeProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurgeProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long purgeCount_; + /** + * + * + *
+     * The total count of products purged as a result of the operation.
+     * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + @java.lang.Override + public long getPurgeCount() { + return purgeCount_; + } + /** + * + * + *
+     * The total count of products purged as a result of the operation.
+     * 
+ * + * int64 purge_count = 1; + * + * @param value The purgeCount to set. + * @return This builder for chaining. + */ + public Builder setPurgeCount(long value) { + + purgeCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of products purged as a result of the operation.
+     * 
+ * + * int64 purge_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgeCount() { + + purgeCount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList purgeSample_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePurgeSampleIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + purgeSample_ = new com.google.protobuf.LazyStringArrayList(purgeSample_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the purgeSample. + */ + public com.google.protobuf.ProtocolStringList getPurgeSampleList() { + return purgeSample_.getUnmodifiableView(); + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return The count of purgeSample. + */ + public int getPurgeSampleCount() { + return purgeSample_.size(); + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The purgeSample at the given index. + */ + public java.lang.String getPurgeSample(int index) { + return purgeSample_.get(index); + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the purgeSample at the given index. + */ + public com.google.protobuf.ByteString getPurgeSampleBytes(int index) { + return purgeSample_.getByteString(index); + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index to set the value at. + * @param value The purgeSample to set. + * @return This builder for chaining. + */ + public Builder setPurgeSample(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePurgeSampleIsMutable(); + purgeSample_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The purgeSample to add. + * @return This builder for chaining. + */ + public Builder addPurgeSample(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePurgeSampleIsMutable(); + purgeSample_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param values The purgeSample to add. + * @return This builder for chaining. + */ + public Builder addAllPurgeSample(java.lang.Iterable values) { + ensurePurgeSampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, purgeSample_); + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearPurgeSample() { + purgeSample_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of the product names that will be deleted.
+     * Only populated if `force` is set to false. A max of 100 names will be
+     * returned and the names are chosen at random.
+     * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes of the purgeSample to add. + * @return This builder for chaining. + */ + public Builder addPurgeSampleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePurgeSampleIsMutable(); + purgeSample_.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.v2alpha.PurgeProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeProductsResponse) + private static final com.google.cloud.retail.v2alpha.PurgeProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeProductsResponse(); + } + + public static com.google.cloud.retail.v2alpha.PurgeProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeProductsResponse(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.v2alpha.PurgeProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponseOrBuilder.java new file mode 100644 index 00000000..39943cb3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeProductsResponseOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of products purged as a result of the operation.
+   * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + long getPurgeCount(); + + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the purgeSample. + */ + java.util.List getPurgeSampleList(); + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @return The count of purgeSample. + */ + int getPurgeSampleCount(); + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The purgeSample at the given index. + */ + java.lang.String getPurgeSample(int index); + /** + * + * + *
+   * A sample of the product names that will be deleted.
+   * Only populated if `force` is set to false. A max of 100 names will be
+   * returned and the names are chosen at random.
+   * 
+ * + * repeated string purge_sample = 2 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the purgeSample at the given index. + */ + com.google.protobuf.ByteString getPurgeSampleBytes(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequest.java new file mode 100644 index 00000000..1f242169 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequest.java @@ -0,0 +1,1063 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for PurgeUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeUserEventsRequest} + */ +public final class PurgeUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeUserEventsRequest) + PurgeUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsRequest.newBuilder() to construct. + private PurgeUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + force_ = 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.class, + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any user events.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (force_ != false) { + output.writeBool(3, force_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } + 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.v2alpha.PurgeUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest other = + (com.google.cloud.retail.v2alpha.PurgeUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for PurgeUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeUserEventsRequest) + com.google.cloud.retail.v2alpha.PurgeUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.class, + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.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_ = ""; + + filter_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsRequest build() { + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsRequest buildPartial() { + com.google.cloud.retail.v2alpha.PurgeUserEventsRequest result = + new com.google.cloud.retail.v2alpha.PurgeUserEventsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.force_ = force_; + 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.v2alpha.PurgeUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeUserEventsRequest other) { + if (other == com.google.cloud.retail.v2alpha.PurgeUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.v2alpha.PurgeUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurgeUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = 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.v2alpha.PurgeUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeUserEventsRequest) + private static final com.google.cloud.retail.v2alpha.PurgeUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsRequest(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.v2alpha.PurgeUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..df635b3d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any user events.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponse.java new file mode 100644 index 00000000..7299eb9f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponse.java @@ -0,0 +1,553 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the PurgeUserEventsRequest. If the long running operation is
+ * successfully done, then this message is returned by the
+ * google.longrunning.Operations.response field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeUserEventsResponse} + */ +public final class PurgeUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.PurgeUserEventsResponse) + PurgeUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsResponse.newBuilder() to construct. + private PurgeUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsResponse( + 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 8: + { + purgedEventsCount_ = input.readInt64(); + 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.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.class, + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.Builder.class); + } + + public static final int PURGED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long purgedEventsCount_; + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + @java.lang.Override + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + + 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 (purgedEventsCount_ != 0L) { + output.writeInt64(1, purgedEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (purgedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, purgedEventsCount_); + } + 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.v2alpha.PurgeUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse other = + (com.google.cloud.retail.v2alpha.PurgeUserEventsResponse) obj; + + if (getPurgedEventsCount() != other.getPurgedEventsCount()) 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) + PURGED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPurgedEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse 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 PurgeUserEventsRequest. If the long running operation is
+   * successfully done, then this message is returned by the
+   * google.longrunning.Operations.response field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.PurgeUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.PurgeUserEventsResponse) + com.google.cloud.retail.v2alpha.PurgeUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.class, + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.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(); + purgedEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.PurgeConfigProto + .internal_static_google_cloud_retail_v2alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsResponse build() { + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurgeUserEventsResponse buildPartial() { + com.google.cloud.retail.v2alpha.PurgeUserEventsResponse result = + new com.google.cloud.retail.v2alpha.PurgeUserEventsResponse(this); + result.purgedEventsCount_ = purgedEventsCount_; + 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.v2alpha.PurgeUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.PurgeUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.PurgeUserEventsResponse other) { + if (other == com.google.cloud.retail.v2alpha.PurgeUserEventsResponse.getDefaultInstance()) + return this; + if (other.getPurgedEventsCount() != 0L) { + setPurgedEventsCount(other.getPurgedEventsCount()); + } + 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.v2alpha.PurgeUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.PurgeUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long purgedEventsCount_; + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + @java.lang.Override + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @param value The purgedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setPurgedEventsCount(long value) { + + purgedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgedEventsCount() { + + purgedEventsCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.PurgeUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.PurgeUserEventsResponse) + private static final com.google.cloud.retail.v2alpha.PurgeUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); + } + + public static com.google.cloud.retail.v2alpha.PurgeUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsResponse(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.v2alpha.PurgeUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..b4c63218 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/PurgeUserEventsResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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/v2alpha/purge_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface PurgeUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.PurgeUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + long getPurgedEventsCount(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rating.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rating.java new file mode 100644 index 00000000..8975ef2a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rating.java @@ -0,0 +1,956 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The rating of a [Product][google.cloud.retail.v2alpha.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rating} + */ +public final class Rating extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rating) + RatingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rating.newBuilder() to construct. + private Rating(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rating() { + ratingHistogram_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rating(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rating( + 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 8: + { + ratingCount_ = input.readInt32(); + break; + } + case 21: + { + averageRating_ = input.readFloat(); + break; + } + case 24: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + ratingHistogram_.addInt(input.readInt32()); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + ratingHistogram_.addInt(input.readInt32()); + } + input.popLimit(limit); + 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)) { + ratingHistogram_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rating.class, + com.google.cloud.retail.v2alpha.Rating.Builder.class); + } + + public static final int RATING_COUNT_FIELD_NUMBER = 1; + private int ratingCount_; + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + + public static final int AVERAGE_RATING_FIELD_NUMBER = 2; + private float averageRating_; + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2alpha.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + + public static final int RATING_HISTOGRAM_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.IntList ratingHistogram_; + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + @java.lang.Override + public java.util.List getRatingHistogramList() { + return ratingHistogram_; + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + + private int ratingHistogramMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (ratingCount_ != 0) { + output.writeInt32(1, ratingCount_); + } + if (java.lang.Float.floatToRawIntBits(averageRating_) != 0) { + output.writeFloat(2, averageRating_); + } + if (getRatingHistogramList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(ratingHistogramMemoizedSerializedSize); + } + for (int i = 0; i < ratingHistogram_.size(); i++) { + output.writeInt32NoTag(ratingHistogram_.getInt(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ratingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, ratingCount_); + } + if (java.lang.Float.floatToRawIntBits(averageRating_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, averageRating_); + } + { + int dataSize = 0; + for (int i = 0; i < ratingHistogram_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(ratingHistogram_.getInt(i)); + } + size += dataSize; + if (!getRatingHistogramList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + ratingHistogramMemoizedSerializedSize = dataSize; + } + 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.v2alpha.Rating)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rating other = (com.google.cloud.retail.v2alpha.Rating) obj; + + if (getRatingCount() != other.getRatingCount()) return false; + if (java.lang.Float.floatToIntBits(getAverageRating()) + != java.lang.Float.floatToIntBits(other.getAverageRating())) return false; + if (!getRatingHistogramList().equals(other.getRatingHistogramList())) 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) + RATING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getRatingCount(); + hash = (37 * hash) + AVERAGE_RATING_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAverageRating()); + if (getRatingHistogramCount() > 0) { + hash = (37 * hash) + RATING_HISTOGRAM_FIELD_NUMBER; + hash = (53 * hash) + getRatingHistogramList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rating parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rating parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rating parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Rating prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The rating of a [Product][google.cloud.retail.v2alpha.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rating} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rating) + com.google.cloud.retail.v2alpha.RatingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rating.class, + com.google.cloud.retail.v2alpha.Rating.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rating.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(); + ratingCount_ = 0; + + averageRating_ = 0F; + + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rating_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rating getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rating.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rating build() { + com.google.cloud.retail.v2alpha.Rating result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rating buildPartial() { + com.google.cloud.retail.v2alpha.Rating result = + new com.google.cloud.retail.v2alpha.Rating(this); + int from_bitField0_ = bitField0_; + result.ratingCount_ = ratingCount_; + result.averageRating_ = averageRating_; + if (((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ratingHistogram_ = ratingHistogram_; + 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.v2alpha.Rating) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rating) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rating other) { + if (other == com.google.cloud.retail.v2alpha.Rating.getDefaultInstance()) return this; + if (other.getRatingCount() != 0) { + setRatingCount(other.getRatingCount()); + } + if (other.getAverageRating() != 0F) { + setAverageRating(other.getAverageRating()); + } + if (!other.ratingHistogram_.isEmpty()) { + if (ratingHistogram_.isEmpty()) { + ratingHistogram_ = other.ratingHistogram_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addAll(other.ratingHistogram_); + } + 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.v2alpha.Rating parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Rating) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int ratingCount_; + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @param value The ratingCount to set. + * @return This builder for chaining. + */ + public Builder setRatingCount(int value) { + + ratingCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRatingCount() { + + ratingCount_ = 0; + onChanged(); + return this; + } + + private float averageRating_; + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2alpha.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2alpha.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @param value The averageRating to set. + * @return This builder for chaining. + */ + public Builder setAverageRating(float value) { + + averageRating_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2alpha.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return This builder for chaining. + */ + public Builder clearAverageRating() { + + averageRating_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList ratingHistogram_ = emptyIntList(); + + private void ensureRatingHistogramIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = mutableCopy(ratingHistogram_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + public java.util.List getRatingHistogramList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(ratingHistogram_) + : ratingHistogram_; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index to set the value at. + * @param value The ratingHistogram to set. + * @return This builder for chaining. + */ + public Builder setRatingHistogram(int index, int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param value The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addRatingHistogram(int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param values The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addAllRatingHistogram(java.lang.Iterable values) { + ensureRatingHistogramIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ratingHistogram_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return This builder for chaining. + */ + public Builder clearRatingHistogram() { + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Rating) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rating) + private static final com.google.cloud.retail.v2alpha.Rating DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rating(); + } + + public static com.google.cloud.retail.v2alpha.Rating getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rating parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rating(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.v2alpha.Rating getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RatingOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RatingOrBuilder.java new file mode 100644 index 00000000..e69addbf --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RatingOrBuilder.java @@ -0,0 +1,109 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface RatingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rating) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + int getRatingCount(); + + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2alpha.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + float getAverageRating(); + + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + java.util.List getRatingHistogramList(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + int getRatingHistogramCount(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + int getRatingHistogram(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadata.java new file mode 100644 index 00000000..abc64d9a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadata.java @@ -0,0 +1,459 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsMetadata} + */ +public final class RejoinUserEventsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RejoinUserEventsMetadata) + RejoinUserEventsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsMetadata.newBuilder() to construct. + private RejoinUserEventsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsMetadata( + 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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.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.v2alpha.RejoinUserEventsMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata other = + (com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata) 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.v2alpha.RejoinUserEventsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata 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 for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RejoinUserEventsMetadata) + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata build() { + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata buildPartial() { + com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata result = + new com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata(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.v2alpha.RejoinUserEventsMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata other) { + if (other == com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata.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.v2alpha.RejoinUserEventsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata) 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.v2alpha.RejoinUserEventsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RejoinUserEventsMetadata) + private static final com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata(); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsMetadata(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.v2alpha.RejoinUserEventsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadataOrBuilder.java new file mode 100644 index 00000000..3b10c6d0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsMetadataOrBuilder.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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RejoinUserEventsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RejoinUserEventsMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequest.java new file mode 100644 index 00000000..327dbfe5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequest.java @@ -0,0 +1,1017 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsRequest} + */ +public final class RejoinUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RejoinUserEventsRequest) + RejoinUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsRequest.newBuilder() to construct. + private RejoinUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsRequest() { + parent_ = ""; + userEventRejoinScope_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsRequest( + 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: + { + int rawValue = input.readEnum(); + + userEventRejoinScope_ = rawValue; + 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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.Builder.class); + } + + /** + * + * + *
+   * 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.
+   * 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.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope} + */ + public enum UserEventRejoinScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Rejoin all events with the latest product catalog, including both joined
+     * events and unjoined events.
+     * 
+ * + * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + */ + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Only rejoin joined events with the latest product catalog.
+     * 
+ * + * JOINED_EVENTS = 1; + */ + JOINED_EVENTS(1), + /** + * + * + *
+     * Only rejoin unjoined events with the latest product catalog.
+     * 
+ * + * UNJOINED_EVENTS = 2; + */ + UNJOINED_EVENTS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Rejoin all events with the latest product catalog, including both joined
+     * events and unjoined events.
+     * 
+ * + * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + */ + public static final int USER_EVENT_REJOIN_SCOPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Only rejoin joined events with the latest product catalog.
+     * 
+ * + * JOINED_EVENTS = 1; + */ + public static final int JOINED_EVENTS_VALUE = 1; + /** + * + * + *
+     * Only rejoin unjoined events with the latest product catalog.
+     * 
+ * + * UNJOINED_EVENTS = 2; + */ + public static final int UNJOINED_EVENTS_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 UserEventRejoinScope 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 UserEventRejoinScope forNumber(int value) { + switch (value) { + case 0: + return USER_EVENT_REJOIN_SCOPE_UNSPECIFIED; + case 1: + return JOINED_EVENTS; + case 2: + return UNJOINED_EVENTS; + 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 UserEventRejoinScope findValueByNumber(int number) { + return UserEventRejoinScope.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.v2alpha.RejoinUserEventsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final UserEventRejoinScope[] VALUES = values(); + + public static UserEventRejoinScope 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 UserEventRejoinScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope) + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_REJOIN_SCOPE_FIELD_NUMBER = 2; + private int userEventRejoinScope_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + @java.lang.Override + public int getUserEventRejoinScopeValue() { + return userEventRejoinScope_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope result = + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope.valueOf( + userEventRejoinScope_); + return result == null + ? com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope.UNRECOGNIZED + : result; + } + + 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 (userEventRejoinScope_ + != com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + .USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, userEventRejoinScope_); + } + 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 (userEventRejoinScope_ + != com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + .USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, userEventRejoinScope_); + } + 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.v2alpha.RejoinUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest other = + (com.google.cloud.retail.v2alpha.RejoinUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (userEventRejoinScope_ != other.userEventRejoinScope_) 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) + USER_EVENT_REJOIN_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + userEventRejoinScope_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RejoinUserEventsRequest) + com.google.cloud.retail.v2alpha.RejoinUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.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_ = ""; + + userEventRejoinScope_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsRequest build() { + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsRequest buildPartial() { + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest result = + new com.google.cloud.retail.v2alpha.RejoinUserEventsRequest(this); + result.parent_ = parent_; + result.userEventRejoinScope_ = userEventRejoinScope_; + 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.v2alpha.RejoinUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.RejoinUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RejoinUserEventsRequest other) { + if (other == com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.userEventRejoinScope_ != 0) { + setUserEventRejoinScopeValue(other.getUserEventRejoinScopeValue()); + } + 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.v2alpha.RejoinUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RejoinUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 userEventRejoinScope_ = 0; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + @java.lang.Override + public int getUserEventRejoinScopeValue() { + return userEventRejoinScope_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @param value The enum numeric value on the wire for userEventRejoinScope to set. + * @return This builder for chaining. + */ + public Builder setUserEventRejoinScopeValue(int value) { + + userEventRejoinScope_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope result = + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope.valueOf( + userEventRejoinScope_); + return result == null + ? com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @param value The userEventRejoinScope to set. + * @return This builder for chaining. + */ + public Builder setUserEventRejoinScope( + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope value) { + if (value == null) { + throw new NullPointerException(); + } + + userEventRejoinScope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearUserEventRejoinScope() { + + userEventRejoinScope_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.RejoinUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RejoinUserEventsRequest) + private static final com.google.cloud.retail.v2alpha.RejoinUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RejoinUserEventsRequest(); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsRequest(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.v2alpha.RejoinUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..d2ba7c47 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RejoinUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RejoinUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + 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.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + com.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponse.java new file mode 100644 index 00000000..e235e1d0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponse.java @@ -0,0 +1,549 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response message for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsResponse} + */ +public final class RejoinUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RejoinUserEventsResponse) + RejoinUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsResponse.newBuilder() to construct. + private RejoinUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsResponse( + 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 8: + { + rejoinedUserEventsCount_ = input.readInt64(); + 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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.Builder.class); + } + + public static final int REJOINED_USER_EVENTS_COUNT_FIELD_NUMBER = 1; + private long rejoinedUserEventsCount_; + /** + * + * + *
+   * Number of user events that were joined with latest product catalog.
+   * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + @java.lang.Override + public long getRejoinedUserEventsCount() { + return rejoinedUserEventsCount_; + } + + 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 (rejoinedUserEventsCount_ != 0L) { + output.writeInt64(1, rejoinedUserEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rejoinedUserEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rejoinedUserEventsCount_); + } + 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.v2alpha.RejoinUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse other = + (com.google.cloud.retail.v2alpha.RejoinUserEventsResponse) obj; + + if (getRejoinedUserEventsCount() != other.getRejoinedUserEventsCount()) 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) + REJOINED_USER_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRejoinedUserEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse 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 message for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RejoinUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RejoinUserEventsResponse) + com.google.cloud.retail.v2alpha.RejoinUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.class, + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.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(); + rejoinedUserEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsResponse build() { + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RejoinUserEventsResponse buildPartial() { + com.google.cloud.retail.v2alpha.RejoinUserEventsResponse result = + new com.google.cloud.retail.v2alpha.RejoinUserEventsResponse(this); + result.rejoinedUserEventsCount_ = rejoinedUserEventsCount_; + 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.v2alpha.RejoinUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.RejoinUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RejoinUserEventsResponse other) { + if (other == com.google.cloud.retail.v2alpha.RejoinUserEventsResponse.getDefaultInstance()) + return this; + if (other.getRejoinedUserEventsCount() != 0L) { + setRejoinedUserEventsCount(other.getRejoinedUserEventsCount()); + } + 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.v2alpha.RejoinUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RejoinUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long rejoinedUserEventsCount_; + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + @java.lang.Override + public long getRejoinedUserEventsCount() { + return rejoinedUserEventsCount_; + } + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @param value The rejoinedUserEventsCount to set. + * @return This builder for chaining. + */ + public Builder setRejoinedUserEventsCount(long value) { + + rejoinedUserEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRejoinedUserEventsCount() { + + rejoinedUserEventsCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.RejoinUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RejoinUserEventsResponse) + private static final com.google.cloud.retail.v2alpha.RejoinUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RejoinUserEventsResponse(); + } + + public static com.google.cloud.retail.v2alpha.RejoinUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsResponse(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.v2alpha.RejoinUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..76f08e0e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RejoinUserEventsResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RejoinUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RejoinUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of user events that were joined with latest product catalog.
+   * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + long getRejoinedUserEventsCount(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequest.java new file mode 100644 index 00000000..44d4c699 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequest.java @@ -0,0 +1,854 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.RemoveCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} + */ +public final class RemoveCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + RemoveCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveCatalogAttributeRequest.newBuilder() to construct. + private RemoveCatalogAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveCatalogAttributeRequest() { + attributesConfig_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = 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(attributesConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributesConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + 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.v2alpha.RemoveCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest other = + (com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (!getKey().equals(other.getKey())) 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(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest 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.RemoveCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.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_ = ""; + + key_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest build() { + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest result = + new com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + result.key_ = key_; + 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.v2alpha.RemoveCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + 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.v2alpha.RemoveCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 java.lang.Object key_ = ""; + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = 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.v2alpha.RemoveCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + private static final com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveCatalogAttributeRequest(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.v2alpha.RemoveCatalogAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..b77ddcac --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 key of the
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequest.java new file mode 100644 index 00000000..e6f76654 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequest.java @@ -0,0 +1,845 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for RemoveControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveControlRequest} + */ +public final class RemoveControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveControlRequest) + RemoveControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveControlRequest.newBuilder() to construct. + private RemoveControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveControlRequest() { + servingConfig_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveControlRequest( + 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(); + + servingConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveControlRequest.class, + com.google.cloud.retail.v2alpha.RemoveControlRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object servingConfig_; + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTROL_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, controlId_); + } + 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(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, controlId_); + } + 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.v2alpha.RemoveControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveControlRequest other = + (com.google.cloud.retail.v2alpha.RemoveControlRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getControlId().equals(other.getControlId())) 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) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.RemoveControlRequest 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 RemoveControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveControlRequest) + com.google.cloud.retail.v2alpha.RemoveControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveControlRequest.class, + com.google.cloud.retail.v2alpha.RemoveControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveControlRequest.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(); + servingConfig_ = ""; + + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveControlRequest build() { + com.google.cloud.retail.v2alpha.RemoveControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.RemoveControlRequest result = + new com.google.cloud.retail.v2alpha.RemoveControlRequest(this); + result.servingConfig_ = servingConfig_; + result.controlId_ = controlId_; + 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.v2alpha.RemoveControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.RemoveControlRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + onChanged(); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.v2alpha.RemoveControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + + servingConfig_ = getDefaultInstance().getServingConfig(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfig_ = value; + onChanged(); + return this; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.v2alpha.RemoveControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveControlRequest) + private static final com.google.cloud.retail.v2alpha.RemoveControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.RemoveControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveControlRequest(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.v2alpha.RemoveControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequestOrBuilder.java new file mode 100644 index 00000000..c6ecc3db --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveControlRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..77229477 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadata.java @@ -0,0 +1,471 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the RemoveFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} + */ +public final class RemoveFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + RemoveFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesMetadata.newBuilder() to construct. + private RemoveFulfillmentPlacesMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesMetadata( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.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.v2alpha.RemoveFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) 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.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata 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 related to the progress of the RemoveFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(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.v2alpha.RemoveFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.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.v2alpha.RemoveFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + 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.v2alpha.RemoveFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesMetadata(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.v2alpha.RemoveFulfillmentPlacesMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..1e46fef7 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesMetadataOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequest.java new file mode 100644 index 00000000..bda7f931 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequest.java @@ -0,0 +1,1762 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} + */ +public final class RemoveFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + RemoveFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesRequest.newBuilder() to construct. + private RemoveFulfillmentPlacesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (removeTime_ != null) { + subBuilder = removeTime_.toBuilder(); + } + removeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(removeTime_); + removeTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int REMOVE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp removeTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + @java.lang.Override + public boolean hasRemoveTime() { + return removeTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRemoveTime() { + return removeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : removeTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + return getRemoveTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (removeTime_ != null) { + output.writeMessage(4, getRemoveTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (removeTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRemoveTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.v2alpha.RemoveFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasRemoveTime() != other.hasRemoveTime()) return false; + if (hasRemoveTime()) { + if (!getRemoveTime().equals(other.getRemoveTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasRemoveTime()) { + hash = (37 * hash) + REMOVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.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(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (removeTimeBuilder_ == null) { + removeTime_ = null; + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (removeTimeBuilder_ == null) { + result.removeTime_ = removeTime_; + } else { + result.removeTime_ = removeTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.RemoveFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasRemoveTime()) { + mergeRemoveTime(other.getRemoveTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.RemoveFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp removeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + removeTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + public boolean hasRemoveTime() { + return removeTimeBuilder_ != null || removeTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + public com.google.protobuf.Timestamp getRemoveTime() { + if (removeTimeBuilder_ == null) { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } else { + return removeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + removeTime_ = value; + onChanged(); + } else { + removeTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (removeTimeBuilder_ == null) { + removeTime_ = builderForValue.build(); + onChanged(); + } else { + removeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder mergeRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (removeTime_ != null) { + removeTime_ = + com.google.protobuf.Timestamp.newBuilder(removeTime_).mergeFrom(value).buildPartial(); + } else { + removeTime_ = value; + } + onChanged(); + } else { + removeTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder clearRemoveTime() { + if (removeTimeBuilder_ == null) { + removeTime_ = null; + onChanged(); + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getRemoveTimeBuilder() { + + onChanged(); + return getRemoveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + if (removeTimeBuilder_ != null) { + return removeTimeBuilder_.getMessageOrBuilder(); + } else { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRemoveTimeFieldBuilder() { + if (removeTimeBuilder_ == null) { + removeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRemoveTime(), getParentForChildren(), isClean()); + removeTime_ = null; + } + return removeTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.RemoveFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesRequest(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.v2alpha.RemoveFulfillmentPlacesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..dc278ee3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,259 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + boolean hasRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + com.google.protobuf.Timestamp getRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponse.java new file mode 100644 index 00000000..3686cdb3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponse.java @@ -0,0 +1,471 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
+ * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} + */ +public final class RemoveFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + RemoveFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesResponse.newBuilder() to construct. + private RemoveFulfillmentPlacesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesResponse( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.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.v2alpha.RemoveFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) 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.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse 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 RemoveFulfillmentPlacesRequest. Currently empty because there
+   * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(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.v2alpha.RemoveFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.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.v2alpha.RemoveFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + 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.v2alpha.RemoveFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesResponse(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.v2alpha.RemoveFulfillmentPlacesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..6c6fb513 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveFulfillmentPlacesResponseOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadata.java new file mode 100644 index 00000000..7b4b0571 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadata.java @@ -0,0 +1,470 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the RemoveLocalInventories operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [RemoveLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} + */ +public final class RemoveLocalInventoriesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + RemoveLocalInventoriesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesMetadata.newBuilder() to construct. + private RemoveLocalInventoriesMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesMetadata( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.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.v2alpha.RemoveLocalInventoriesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata other = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) 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.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata 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 related to the progress of the RemoveLocalInventories operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [RemoveLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata build() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata buildPartial() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata result = + new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(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.v2alpha.RemoveLocalInventoriesMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.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.v2alpha.RemoveLocalInventoriesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + 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.v2alpha.RemoveLocalInventoriesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + private static final com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesMetadata(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.v2alpha.RemoveLocalInventoriesMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadataOrBuilder.java new file mode 100644 index 00000000..7e59a73e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesMetadataOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveLocalInventoriesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequest.java new file mode 100644 index 00000000..ad311792 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequest.java @@ -0,0 +1,1391 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [RemoveLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} + */ +public final class RemoveLocalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + RemoveLocalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesRequest.newBuilder() to construct. + private RemoveLocalInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesRequest() { + product_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 24: + { + allowMissing_ = input.readBool(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (removeTime_ != null) { + subBuilder = removeTime_.toBuilder(); + } + removeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(removeTime_); + removeTime_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int REMOVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp removeTime_; + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + @java.lang.Override + public boolean hasRemoveTime() { + return removeTime_ != null; + } + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRemoveTime() { + return removeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : removeTime_; + } + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + return getRemoveTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the local inventory removal request will still be processed and
+   * retained for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, placeIds_.getRaw(i)); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (removeTime_ != null) { + output.writeMessage(5, getRemoveTime()); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (removeTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRemoveTime()); + } + 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.v2alpha.RemoveLocalInventoriesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest other = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasRemoveTime() != other.hasRemoveTime()) return false; + if (hasRemoveTime()) { + if (!getRemoveTime().equals(other.getRemoveTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasRemoveTime()) { + hash = (37 * hash) + REMOVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [RemoveLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.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(); + product_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (removeTimeBuilder_ == null) { + removeTime_ = null; + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest build() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest buildPartial() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest result = + new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (removeTimeBuilder_ == null) { + result.removeTime_ = removeTime_; + } else { + result.removeTime_ = removeTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.RemoveLocalInventoriesRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasRemoveTime()) { + mergeRemoveTime(other.getRemoveTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.RemoveLocalInventoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2alpha.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp removeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + removeTimeBuilder_; + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + public boolean hasRemoveTime() { + return removeTimeBuilder_ != null || removeTime_ != null; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + public com.google.protobuf.Timestamp getRemoveTime() { + if (removeTimeBuilder_ == null) { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } else { + return removeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + removeTime_ = value; + onChanged(); + } else { + removeTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (removeTimeBuilder_ == null) { + removeTime_ = builderForValue.build(); + onChanged(); + } else { + removeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder mergeRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (removeTime_ != null) { + removeTime_ = + com.google.protobuf.Timestamp.newBuilder(removeTime_).mergeFrom(value).buildPartial(); + } else { + removeTime_ = value; + } + onChanged(); + } else { + removeTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder clearRemoveTime() { + if (removeTimeBuilder_ == null) { + removeTime_ = null; + onChanged(); + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getRemoveTimeBuilder() { + + onChanged(); + return getRemoveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + if (removeTimeBuilder_ != null) { + return removeTimeBuilder_.getMessageOrBuilder(); + } else { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRemoveTimeFieldBuilder() { + if (removeTimeBuilder_ == null) { + removeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRemoveTime(), getParentForChildren(), isClean()); + removeTime_ = null; + } + return removeTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.RemoveLocalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + private static final com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesRequest(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.v2alpha.RemoveLocalInventoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequestOrBuilder.java new file mode 100644 index 00000000..e432e2f3 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesRequestOrBuilder.java @@ -0,0 +1,178 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveLocalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2alpha.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + boolean hasRemoveTime(); + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + com.google.protobuf.Timestamp getRemoveTime(); + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, the local inventory removal request will still be processed and
+   * retained for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2alpha.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponse.java new file mode 100644 index 00000000..3f87f011 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponse.java @@ -0,0 +1,470 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the [RemoveLocalInventories][] API.  Currently empty because
+ * there is no meaningful response populated from the [RemoveLocalInventories][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} + */ +public final class RemoveLocalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + RemoveLocalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesResponse.newBuilder() to construct. + private RemoveLocalInventoriesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesResponse( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.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.v2alpha.RemoveLocalInventoriesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse other = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) 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.v2alpha.RemoveLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse 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 [RemoveLocalInventories][] API.  Currently empty because
+   * there is no meaningful response populated from the [RemoveLocalInventories][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.class, + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse build() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse buildPartial() { + com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse result = + new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(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.v2alpha.RemoveLocalInventoriesResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse other) { + if (other + == com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.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.v2alpha.RemoveLocalInventoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + 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.v2alpha.RemoveLocalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + private static final com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); + } + + public static com.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesResponse(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.v2alpha.RemoveLocalInventoriesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponseOrBuilder.java new file mode 100644 index 00000000..e08aac37 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RemoveLocalInventoriesResponseOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface RemoveLocalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequest.java new file mode 100644 index 00000000..69c73d13 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequest.java @@ -0,0 +1,1306 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} + */ +public final class ReplaceCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + ReplaceCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplaceCatalogAttributeRequest.newBuilder() to construct. + private ReplaceCatalogAttributeRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplaceCatalogAttributeRequest() { + attributesConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplaceCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplaceCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder subBuilder = null; + if (catalogAttribute_ != null) { + subBuilder = catalogAttribute_.toBuilder(); + } + catalogAttribute_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CatalogAttribute.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogAttribute_); + catalogAttribute_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 CATALOG_ATTRIBUTE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.CatalogAttribute catalogAttribute_; + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + @java.lang.Override + public boolean hasCatalogAttribute() { + return catalogAttribute_ != null; + } + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute() { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + return getCatalogAttribute(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributesConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributesConfig_); + } + if (catalogAttribute_ != null) { + output.writeMessage(2, getCatalogAttribute()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + 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_); + } + if (catalogAttribute_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogAttribute()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, 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.v2alpha.ReplaceCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest other = + (com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (hasCatalogAttribute() != other.hasCatalogAttribute()) return false; + if (hasCatalogAttribute()) { + if (!getCatalogAttribute().equals(other.getCatalogAttribute())) 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(); + hash = (37 * hash) + ATTRIBUTES_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAttributesConfig().hashCode(); + if (hasCatalogAttribute()) { + hash = (37 * hash) + CATALOG_ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getCatalogAttribute().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.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.class, + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.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_ = ""; + + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest build() { + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest result = + new com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + if (catalogAttributeBuilder_ == null) { + result.catalogAttribute_ = catalogAttribute_; + } else { + result.catalogAttribute_ = catalogAttributeBuilder_.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.v2alpha.ReplaceCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest other) { + if (other + == com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (other.hasCatalogAttribute()) { + mergeCatalogAttribute(other.getCatalogAttribute()); + } + 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.v2alpha.ReplaceCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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.cloud.retail.v2alpha.CatalogAttribute catalogAttribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder> + catalogAttributeBuilder_; + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + public boolean hasCatalogAttribute() { + return catalogAttributeBuilder_ != null || catalogAttribute_ != null; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + public com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } else { + return catalogAttributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute(com.google.cloud.retail.v2alpha.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogAttribute_ = value; + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute( + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder builderForValue) { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = builderForValue.build(); + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogAttribute(com.google.cloud.retail.v2alpha.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (catalogAttribute_ != null) { + catalogAttribute_ = + com.google.cloud.retail.v2alpha.CatalogAttribute.newBuilder(catalogAttribute_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogAttribute_ = value; + } + onChanged(); + } else { + catalogAttributeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + onChanged(); + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CatalogAttribute.Builder getCatalogAttributeBuilder() { + + onChanged(); + return getCatalogAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder + getCatalogAttributeOrBuilder() { + if (catalogAttributeBuilder_ != null) { + return catalogAttributeBuilder_.getMessageOrBuilder(); + } else { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2alpha.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder> + getCatalogAttributeFieldBuilder() { + if (catalogAttributeBuilder_ == null) { + catalogAttributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CatalogAttribute, + com.google.cloud.retail.v2alpha.CatalogAttribute.Builder, + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder>( + getCatalogAttribute(), getParentForChildren(), isClean()); + catalogAttribute_ = null; + } + return catalogAttributeBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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.v2alpha.ReplaceCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + private static final com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplaceCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplaceCatalogAttributeRequest(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.v2alpha.ReplaceCatalogAttributeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..8cceeda0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ReplaceCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface ReplaceCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + boolean hasCatalogAttribute(); + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + com.google.cloud.retail.v2alpha.CatalogAttribute getCatalogAttribute(); + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rule.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rule.java new file mode 100644 index 00000000..8b1db61c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/Rule.java @@ -0,0 +1,11626 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * 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.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule} + */ +public final class Rule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule) + RuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rule.newBuilder() to construct. + private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rule() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rule( + 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.v2alpha.Condition.Builder subBuilder = null; + if (condition_ != null) { + subBuilder = condition_.toBuilder(); + } + condition_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Condition.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(condition_); + condition_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder subBuilder = null; + if (actionCase_ == 2) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.BoostAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.BoostAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Rule.BoostAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder subBuilder = null; + if (actionCase_ == 3) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.RedirectAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 3; + break; + } + case 50: + { + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder subBuilder = null; + if (actionCase_ == 6) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 6; + break; + } + case 58: + { + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder subBuilder = null; + if (actionCase_ == 7) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 7; + break; + } + case 66: + { + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder subBuilder = null; + if (actionCase_ == 8) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 8; + break; + } + case 74: + { + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder subBuilder = null; + if (actionCase_ == 9) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 9; + break; + } + case 82: + { + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder subBuilder = null; + if (actionCase_ == 10) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.FilterAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.FilterAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Rule.FilterAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 10; + break; + } + case 90: + { + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder subBuilder = null; + if (actionCase_ == 11) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 11; + 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.class, + com.google.cloud.retail.v2alpha.Rule.Builder.class); + } + + public interface BoostActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.BoostAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Strength of the condition boost, which must be in [-1, 1]. Negative
+     * boost means demotion. Default is 0.0.
+     * Setting to 1.0 gives the item a big promotion. However, it does not
+     * necessarily mean that the boosted item will be the top result at all
+     * times, nor that other items will be excluded. Results could still be
+     * shown even when none of them matches the condition. And results that
+     * are significantly more relevant to the search query can still trump
+     * your heavily favored but irrelevant items.
+     * Setting to -1.0 gives the item a big demotion. However, results that
+     * are deeply relevant might still be shown. The item will have an
+     * upstream battle to get a fairly high ranking, but it is not blocked out
+     * completely.
+     * Setting to 0.0 means no boost applied. The boosting condition is
+     * ignored.
+     * 
+ * + * float boost = 1; + * + * @return The boost. + */ + float getBoost(); + + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + java.lang.String getProductsFilter(); + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + com.google.protobuf.ByteString getProductsFilterBytes(); + } + /** + * + * + *
+   * A boost action to apply to results matching condition specified above.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.BoostAction} + */ + public static final class BoostAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.BoostAction) + BoostActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostAction.newBuilder() to construct. + private BoostAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostAction() { + productsFilter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoostAction( + 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 13: + { + boost_ = input.readFloat(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + productsFilter_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.BoostAction.class, + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder.class); + } + + public static final int BOOST_FIELD_NUMBER = 1; + private float boost_; + /** + * + * + *
+     * Strength of the condition boost, which must be in [-1, 1]. Negative
+     * boost means demotion. Default is 0.0.
+     * Setting to 1.0 gives the item a big promotion. However, it does not
+     * necessarily mean that the boosted item will be the top result at all
+     * times, nor that other items will be excluded. Results could still be
+     * shown even when none of them matches the condition. And results that
+     * are significantly more relevant to the search query can still trump
+     * your heavily favored but irrelevant items.
+     * Setting to -1.0 gives the item a big demotion. However, results that
+     * are deeply relevant might still be shown. The item will have an
+     * upstream battle to get a fairly high ranking, but it is not blocked out
+     * completely.
+     * Setting to 0.0 means no boost applied. The boosting condition is
+     * ignored.
+     * 
+ * + * float boost = 1; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + public static final int PRODUCTS_FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object productsFilter_; + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + @java.lang.Override + public java.lang.String getProductsFilter() { + java.lang.Object ref = productsFilter_; + 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(); + productsFilter_ = s; + return s; + } + } + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductsFilterBytes() { + java.lang.Object ref = productsFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productsFilter_ = 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 (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(1, boost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productsFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, productsFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, boost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productsFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, productsFilter_); + } + 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.v2alpha.Rule.BoostAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.BoostAction other = + (com.google.cloud.retail.v2alpha.Rule.BoostAction) obj; + + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) return false; + if (!getProductsFilter().equals(other.getProductsFilter())) 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) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (37 * hash) + PRODUCTS_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getProductsFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Rule.BoostAction 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; + } + /** + * + * + *
+     * A boost action to apply to results matching condition specified above.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.BoostAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.BoostAction) + com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.BoostAction.class, + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.BoostAction.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(); + boost_ = 0F; + + productsFilter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_BoostAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostAction build() { + com.google.cloud.retail.v2alpha.Rule.BoostAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.BoostAction result = + new com.google.cloud.retail.v2alpha.Rule.BoostAction(this); + result.boost_ = boost_; + result.productsFilter_ = productsFilter_; + 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.v2alpha.Rule.BoostAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.BoostAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.BoostAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance()) + return this; + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + if (!other.getProductsFilter().isEmpty()) { + productsFilter_ = other.productsFilter_; + 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.v2alpha.Rule.BoostAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.BoostAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float boost_; + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object productsFilter_ = ""; + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + public java.lang.String getProductsFilter() { + java.lang.Object ref = productsFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productsFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + public com.google.protobuf.ByteString getProductsFilterBytes() { + java.lang.Object ref = productsFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productsFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @param value The productsFilter to set. + * @return This builder for chaining. + */ + public Builder setProductsFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productsFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearProductsFilter() { + + productsFilter_ = getDefaultInstance().getProductsFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @param value The bytes for productsFilter to set. + * @return This builder for chaining. + */ + public Builder setProductsFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productsFilter_ = 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.v2alpha.Rule.BoostAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.BoostAction) + private static final com.google.cloud.retail.v2alpha.Rule.BoostAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.BoostAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.BoostAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoostAction(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.v2alpha.Rule.BoostAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FilterActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.FilterAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + } + /** + * + * + *
+   * * Rule Condition:
+   *   - No [Condition][query_terms] provided is a global match.
+   *   - 1 or more [Condition][query_terms] provided is combined with OR
+   *   operator.
+   * * Action Input: The request query and filter that will be applied to the
+   * retrieved products, in addition to any filters already provided with the
+   * SearchRequest. The AND operator is used to combine the query's existing
+   * filters with the filter rule(s). NOTE: May result in 0 results when
+   * filters conflict.
+   * * Action Result: Filters the returned objects to be ONLY those that passed
+   * the filter.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.FilterAction} + */ + public static final class FilterAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.FilterAction) + FilterActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use FilterAction.newBuilder() to construct. + private FilterAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FilterAction() { + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FilterAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FilterAction( + 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(); + + filter_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.FilterAction.class, + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + private volatile java.lang.Object filter_; + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + 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(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + 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.v2alpha.Rule.FilterAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.FilterAction other = + (com.google.cloud.retail.v2alpha.Rule.FilterAction) obj; + + if (!getFilter().equals(other.getFilter())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Rule.FilterAction 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; + } + /** + * + * + *
+     * * Rule Condition:
+     *   - No [Condition][query_terms] provided is a global match.
+     *   - 1 or more [Condition][query_terms] provided is combined with OR
+     *   operator.
+     * * Action Input: The request query and filter that will be applied to the
+     * retrieved products, in addition to any filters already provided with the
+     * SearchRequest. The AND operator is used to combine the query's existing
+     * filters with the filter rule(s). NOTE: May result in 0 results when
+     * filters conflict.
+     * * Action Result: Filters the returned objects to be ONLY those that passed
+     * the filter.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.FilterAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.FilterAction) + com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.FilterAction.class, + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.FilterAction.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(); + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_FilterAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterAction build() { + com.google.cloud.retail.v2alpha.Rule.FilterAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.FilterAction result = + new com.google.cloud.retail.v2alpha.Rule.FilterAction(this); + result.filter_ = filter_; + 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.v2alpha.Rule.FilterAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.FilterAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.FilterAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.v2alpha.Rule.FilterAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.FilterAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Rule.FilterAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.FilterAction) + private static final com.google.cloud.retail.v2alpha.Rule.FilterAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.FilterAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.FilterAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilterAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FilterAction(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.v2alpha.Rule.FilterAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RedirectActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.RedirectAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * * Rule Condition:
+   *   - Must specify [Condition][query_terms].
+   * * Action Input: Request Query
+   * * Action Result: Redirects shopper to provided uri.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.RedirectAction} + */ + public static final class RedirectAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.RedirectAction) + RedirectActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use RedirectAction.newBuilder() to construct. + private RedirectAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RedirectAction() { + redirectUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RedirectAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RedirectAction( + 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(); + + redirectUri_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.RedirectAction.class, + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder.class); + } + + public static final int REDIRECT_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object redirectUri_; + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + 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(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = 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(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, redirectUri_); + } + 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(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, redirectUri_); + } + 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.v2alpha.Rule.RedirectAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.RedirectAction other = + (com.google.cloud.retail.v2alpha.Rule.RedirectAction) obj; + + if (!getRedirectUri().equals(other.getRedirectUri())) 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) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Rule.RedirectAction 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; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * * Rule Condition:
+     *   - Must specify [Condition][query_terms].
+     * * Action Input: Request Query
+     * * Action Result: Redirects shopper to provided uri.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.RedirectAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.RedirectAction) + com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.RedirectAction.class, + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.RedirectAction.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(); + redirectUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectAction build() { + com.google.cloud.retail.v2alpha.Rule.RedirectAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.RedirectAction result = + new com.google.cloud.retail.v2alpha.Rule.RedirectAction(this); + result.redirectUri_ = redirectUri_; + 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.v2alpha.Rule.RedirectAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.RedirectAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.RedirectAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance()) + return this; + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + 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.v2alpha.Rule.RedirectAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.RedirectAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @param value The redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redirectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + + redirectUri_ = getDefaultInstance().getRedirectUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @param value The bytes for redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redirectUri_ = 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.v2alpha.Rule.RedirectAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.RedirectAction) + private static final com.google.cloud.retail.v2alpha.Rule.RedirectAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.RedirectAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.RedirectAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RedirectAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RedirectAction(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.v2alpha.Rule.RedirectAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TwowaySynonymsActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + java.util.List getSynonymsList(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + int getSynonymsCount(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + java.lang.String getSynonyms(int index); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + com.google.protobuf.ByteString getSynonymsBytes(int index); + } + /** + * + * + *
+   * Creates a set of terms that will be treated as synonyms of each other.
+   * Example: synonyms of "sneakers" and "shoes".
+   *  * "sneakers" will use a synonym of "shoes".
+   *  * "shoes" will use a synonym of "sneakers".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} + */ + public static final class TwowaySynonymsAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + TwowaySynonymsActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TwowaySynonymsAction.newBuilder() to construct. + private TwowaySynonymsAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TwowaySynonymsAction() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TwowaySynonymsAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TwowaySynonymsAction( + 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)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + synonyms_.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)) { + synonyms_ = synonyms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.class, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder.class); + } + + public static final int SYNONYMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList synonyms_; + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.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 < synonyms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, synonyms_.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 < synonyms_.size(); i++) { + dataSize += computeStringSizeNoTag(synonyms_.getRaw(i)); + } + size += dataSize; + size += 1 * getSynonymsList().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.v2alpha.Rule.TwowaySynonymsAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction other = + (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) obj; + + if (!getSynonymsList().equals(other.getSynonymsList())) 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 (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction 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; + } + /** + * + * + *
+     * Creates a set of terms that will be treated as synonyms of each other.
+     * Example: synonyms of "sneakers" and "shoes".
+     *  * "sneakers" will use a synonym of "shoes".
+     *  * "shoes" will use a synonym of "sneakers".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.class, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.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(); + synonyms_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction build() { + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction result = + new com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.synonyms_ = synonyms_; + 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.v2alpha.Rule.TwowaySynonymsAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance()) + return this; + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + 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.v2alpha.Rule.TwowaySynonymsAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList synonyms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(synonyms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index to set the value at. + * @param value The synonyms to set. + * @return This builder for chaining. + */ + public Builder setSynonyms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param value The synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonyms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param values The synonyms to add. + * @return This builder for chaining. + */ + public Builder addAllSynonyms(java.lang.Iterable values) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return This builder for chaining. + */ + public Builder clearSynonyms() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param value The bytes of the synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonymsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSynonymsIsMutable(); + synonyms_.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.v2alpha.Rule.TwowaySynonymsAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + private static final com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TwowaySynonymsAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TwowaySynonymsAction(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.v2alpha.Rule.TwowaySynonymsAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OnewaySynonymsActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + java.util.List getSynonymsList(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + int getSynonymsCount(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + java.lang.String getSynonyms(int index); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + com.google.protobuf.ByteString getSynonymsBytes(int index); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + java.util.List getOnewayTermsList(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + int getOnewayTermsCount(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + java.lang.String getOnewayTerms(int index); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + com.google.protobuf.ByteString getOnewayTermsBytes(int index); + } + /** + * + * + *
+   * Maps a set of terms to a set of synonyms.
+   * Set of synonyms will be treated as synonyms of each query term only.
+   * `query_terms` will not be treated as synonyms of each other.
+   * Example: "sneakers" will use a synonym of "shoes".
+   * "shoes" will not use a synonym of "sneakers".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} + */ + public static final class OnewaySynonymsAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + OnewaySynonymsActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use OnewaySynonymsAction.newBuilder() to construct. + private OnewaySynonymsAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OnewaySynonymsAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OnewaySynonymsAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OnewaySynonymsAction( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + onewayTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + synonyms_.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_ & 0x00000004) != 0)) { + onewayTerms_ = onewayTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.class, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int SYNONYMS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList synonyms_; + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + + public static final int ONEWAY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList onewayTerms_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + public com.google.protobuf.ProtocolStringList getOnewayTermsList() { + return onewayTerms_; + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + public int getOnewayTermsCount() { + return onewayTerms_.size(); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + public java.lang.String getOnewayTerms(int index) { + return onewayTerms_.get(index); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + public com.google.protobuf.ByteString getOnewayTermsBytes(int index) { + return onewayTerms_.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 < onewayTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, onewayTerms_.getRaw(i)); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, queryTerms_.getRaw(i)); + } + for (int i = 0; i < synonyms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, synonyms_.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 < onewayTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(onewayTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getOnewayTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < synonyms_.size(); i++) { + dataSize += computeStringSizeNoTag(synonyms_.getRaw(i)); + } + size += dataSize; + size += 1 * getSynonymsList().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.v2alpha.Rule.OnewaySynonymsAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction other = + (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getSynonymsList().equals(other.getSynonymsList())) return false; + if (!getOnewayTermsList().equals(other.getOnewayTermsList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + if (getOnewayTermsCount() > 0) { + hash = (37 * hash) + ONEWAY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getOnewayTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction 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; + } + /** + * + * + *
+     * Maps a set of terms to a set of synonyms.
+     * Set of synonyms will be treated as synonyms of each query term only.
+     * `query_terms` will not be treated as synonyms of each other.
+     * Example: "sneakers" will use a synonym of "shoes".
+     * "shoes" will not use a synonym of "sneakers".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.class, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction build() { + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction result = + new com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + if (((bitField0_ & 0x00000002) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.synonyms_ = synonyms_; + if (((bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = onewayTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.onewayTerms_ = onewayTerms_; + 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.v2alpha.Rule.OnewaySynonymsAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + onChanged(); + } + if (!other.onewayTerms_.isEmpty()) { + if (onewayTerms_.isEmpty()) { + onewayTerms_ = other.onewayTerms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureOnewayTermsIsMutable(); + onewayTerms_.addAll(other.onewayTerms_); + } + 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.v2alpha.Rule.OnewaySynonymsAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList synonyms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(synonyms_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index to set the value at. + * @param value The synonyms to set. + * @return This builder for chaining. + */ + public Builder setSynonyms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param value The synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonyms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param values The synonyms to add. + * @return This builder for chaining. + */ + public Builder addAllSynonyms(java.lang.Iterable values) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return This builder for chaining. + */ + public Builder clearSynonyms() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param value The bytes of the synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonymsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList onewayTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOnewayTermsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = new com.google.protobuf.LazyStringArrayList(onewayTerms_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + public com.google.protobuf.ProtocolStringList getOnewayTermsList() { + return onewayTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + public int getOnewayTermsCount() { + return onewayTerms_.size(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + public java.lang.String getOnewayTerms(int index) { + return onewayTerms_.get(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + public com.google.protobuf.ByteString getOnewayTermsBytes(int index) { + return onewayTerms_.getByteString(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index to set the value at. + * @param value The onewayTerms to set. + * @return This builder for chaining. + */ + public Builder setOnewayTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewayTermsIsMutable(); + onewayTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param value The onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addOnewayTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewayTermsIsMutable(); + onewayTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param values The onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addAllOnewayTerms(java.lang.Iterable values) { + ensureOnewayTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onewayTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearOnewayTerms() { + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param value The bytes of the onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addOnewayTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOnewayTermsIsMutable(); + onewayTerms_.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.v2alpha.Rule.OnewaySynonymsAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + private static final com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OnewaySynonymsAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OnewaySynonymsAction(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.v2alpha.Rule.OnewaySynonymsAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DoNotAssociateActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + java.util.List getDoNotAssociateTermsList(); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + int getDoNotAssociateTermsCount(); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + java.lang.String getDoNotAssociateTerms(int index); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + java.util.List getTermsList(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + int getTermsCount(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + java.lang.String getTerms(int index); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + com.google.protobuf.ByteString getTermsBytes(int index); + } + /** + * + * + *
+   * Prevents `query_term` from being associated with specified terms during
+   * search.
+   * Example: Don't associate "gShoe" and "cheap".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} + */ + public static final class DoNotAssociateAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) + DoNotAssociateActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoNotAssociateAction.newBuilder() to construct. + private DoNotAssociateAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DoNotAssociateAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DoNotAssociateAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DoNotAssociateAction( + 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_ & 0x00000004) != 0)) { + terms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + terms_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + doNotAssociateTerms_.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_ & 0x00000004) != 0)) { + terms_ = terms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = doNotAssociateTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.class, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int DO_NOT_ASSOCIATE_TERMS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList doNotAssociateTerms_; + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateTermsList() { + return doNotAssociateTerms_; + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + public int getDoNotAssociateTermsCount() { + return doNotAssociateTerms_.size(); + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + public java.lang.String getDoNotAssociateTerms(int index) { + return doNotAssociateTerms_.get(index); + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index) { + return doNotAssociateTerms_.getByteString(index); + } + + public static final int TERMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList terms_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + public com.google.protobuf.ProtocolStringList getTermsList() { + return terms_; + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + public int getTermsCount() { + return terms_.size(); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + public java.lang.String getTerms(int index) { + return terms_.get(index); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + public com.google.protobuf.ByteString getTermsBytes(int index) { + return terms_.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 < terms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, terms_.getRaw(i)); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queryTerms_.getRaw(i)); + } + for (int i = 0; i < doNotAssociateTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, doNotAssociateTerms_.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 < terms_.size(); i++) { + dataSize += computeStringSizeNoTag(terms_.getRaw(i)); + } + size += dataSize; + size += 1 * getTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < doNotAssociateTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(doNotAssociateTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getDoNotAssociateTermsList().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.v2alpha.Rule.DoNotAssociateAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction other = + (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getDoNotAssociateTermsList().equals(other.getDoNotAssociateTermsList())) return false; + if (!getTermsList().equals(other.getTermsList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getDoNotAssociateTermsCount() > 0) { + hash = (37 * hash) + DO_NOT_ASSOCIATE_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateTermsList().hashCode(); + } + if (getTermsCount() > 0) { + hash = (37 * hash) + TERMS_FIELD_NUMBER; + hash = (53 * hash) + getTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction 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; + } + /** + * + * + *
+     * Prevents `query_term` from being associated with specified terms during
+     * search.
+     * Example: Don't associate "gShoe" and "cheap".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.class, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction build() { + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction result = + new com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + if (((bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = doNotAssociateTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.doNotAssociateTerms_ = doNotAssociateTerms_; + if (((bitField0_ & 0x00000004) != 0)) { + terms_ = terms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.terms_ = terms_; + 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.v2alpha.Rule.DoNotAssociateAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.doNotAssociateTerms_.isEmpty()) { + if (doNotAssociateTerms_.isEmpty()) { + doNotAssociateTerms_ = other.doNotAssociateTerms_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.addAll(other.doNotAssociateTerms_); + } + onChanged(); + } + if (!other.terms_.isEmpty()) { + if (terms_.isEmpty()) { + terms_ = other.terms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTermsIsMutable(); + terms_.addAll(other.terms_); + } + 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.v2alpha.Rule.DoNotAssociateAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList doNotAssociateTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDoNotAssociateTermsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = new com.google.protobuf.LazyStringArrayList(doNotAssociateTerms_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateTermsList() { + return doNotAssociateTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + public int getDoNotAssociateTermsCount() { + return doNotAssociateTerms_.size(); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + public java.lang.String getDoNotAssociateTerms(int index) { + return doNotAssociateTerms_.get(index); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index) { + return doNotAssociateTerms_.getByteString(index); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index to set the value at. + * @param value The doNotAssociateTerms to set. + * @return This builder for chaining. + */ + public Builder setDoNotAssociateTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param value The doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param values The doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addAllDoNotAssociateTerms(java.lang.Iterable values) { + ensureDoNotAssociateTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, doNotAssociateTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return This builder for chaining. + */ + public Builder clearDoNotAssociateTerms() { + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param value The bytes of the doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList terms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTermsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + terms_ = new com.google.protobuf.LazyStringArrayList(terms_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + public com.google.protobuf.ProtocolStringList getTermsList() { + return terms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + public int getTermsCount() { + return terms_.size(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + public java.lang.String getTerms(int index) { + return terms_.get(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + public com.google.protobuf.ByteString getTermsBytes(int index) { + return terms_.getByteString(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index to set the value at. + * @param value The terms to set. + * @return This builder for chaining. + */ + public Builder setTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTermsIsMutable(); + terms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param value The terms to add. + * @return This builder for chaining. + */ + public Builder addTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTermsIsMutable(); + terms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param values The terms to add. + * @return This builder for chaining. + */ + public Builder addAllTerms(java.lang.Iterable values) { + ensureTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, terms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return This builder for chaining. + */ + public Builder clearTerms() { + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param value The bytes of the terms to add. + * @return This builder for chaining. + */ + public Builder addTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTermsIsMutable(); + terms_.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.v2alpha.Rule.DoNotAssociateAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) + private static final com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoNotAssociateAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DoNotAssociateAction(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.v2alpha.Rule.DoNotAssociateAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReplacementActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.ReplacementAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + java.lang.String getReplacementTerm(); + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + com.google.protobuf.ByteString getReplacementTermBytes(); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The term. + */ + java.lang.String getTerm(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + com.google.protobuf.ByteString getTermBytes(); + } + /** + * + * + *
+   * Replaces a term in the query. Multiple replacement candidates can be
+   * specified. All `query_terms` will be replaced with the replacement term.
+   * Example: Replace "gShoe" with "google shoe".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.ReplacementAction} + */ + public static final class ReplacementAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.ReplacementAction) + ReplacementActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplacementAction.newBuilder() to construct. + private ReplacementAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplacementAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + replacementTerm_ = ""; + term_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplacementAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplacementAction( + 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(); + + term_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + replacementTerm_ = 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)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.class, + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int REPLACEMENT_TERM_FIELD_NUMBER = 3; + private volatile java.lang.Object replacementTerm_; + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + @java.lang.Override + public java.lang.String getReplacementTerm() { + java.lang.Object ref = replacementTerm_; + 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(); + replacementTerm_ = s; + return s; + } + } + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplacementTermBytes() { + java.lang.Object ref = replacementTerm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementTerm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TERM_FIELD_NUMBER = 1; + private volatile java.lang.Object term_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The term. + */ + @java.lang.Override + public java.lang.String getTerm() { + java.lang.Object ref = term_; + 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(); + term_ = s; + return s; + } + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTermBytes() { + java.lang.Object ref = term_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + term_ = 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(term_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, term_); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queryTerms_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementTerm_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, replacementTerm_); + } + 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(term_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, term_); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementTerm_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, replacementTerm_); + } + 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.v2alpha.Rule.ReplacementAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.ReplacementAction other = + (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getReplacementTerm().equals(other.getReplacementTerm())) return false; + if (!getTerm().equals(other.getTerm())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + hash = (37 * hash) + REPLACEMENT_TERM_FIELD_NUMBER; + hash = (53 * hash) + getReplacementTerm().hashCode(); + hash = (37 * hash) + TERM_FIELD_NUMBER; + hash = (53 * hash) + getTerm().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction 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; + } + /** + * + * + *
+     * Replaces a term in the query. Multiple replacement candidates can be
+     * specified. All `query_terms` will be replaced with the replacement term.
+     * Example: Replace "gShoe" with "google shoe".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.ReplacementAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.ReplacementAction) + com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.class, + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.ReplacementAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + replacementTerm_ = ""; + + term_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction build() { + com.google.cloud.retail.v2alpha.Rule.ReplacementAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.ReplacementAction result = + new com.google.cloud.retail.v2alpha.Rule.ReplacementAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + result.replacementTerm_ = replacementTerm_; + result.term_ = term_; + 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.v2alpha.Rule.ReplacementAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.ReplacementAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.ReplacementAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.getReplacementTerm().isEmpty()) { + replacementTerm_ = other.replacementTerm_; + onChanged(); + } + if (!other.getTerm().isEmpty()) { + term_ = other.term_; + 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.v2alpha.Rule.ReplacementAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private java.lang.Object replacementTerm_ = ""; + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + public java.lang.String getReplacementTerm() { + java.lang.Object ref = replacementTerm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replacementTerm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + public com.google.protobuf.ByteString getReplacementTermBytes() { + java.lang.Object ref = replacementTerm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementTerm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @param value The replacementTerm to set. + * @return This builder for chaining. + */ + public Builder setReplacementTerm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replacementTerm_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return This builder for chaining. + */ + public Builder clearReplacementTerm() { + + replacementTerm_ = getDefaultInstance().getReplacementTerm(); + onChanged(); + return this; + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @param value The bytes for replacementTerm to set. + * @return This builder for chaining. + */ + public Builder setReplacementTermBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replacementTerm_ = value; + onChanged(); + return this; + } + + private java.lang.Object term_ = ""; + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return The term. + */ + public java.lang.String getTerm() { + java.lang.Object ref = term_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + term_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + public com.google.protobuf.ByteString getTermBytes() { + java.lang.Object ref = term_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + term_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @param value The term to set. + * @return This builder for chaining. + */ + public Builder setTerm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + term_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return This builder for chaining. + */ + public Builder clearTerm() { + + term_ = getDefaultInstance().getTerm(); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @param value The bytes for term to set. + * @return This builder for chaining. + */ + public Builder setTermBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + term_ = 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.v2alpha.Rule.ReplacementAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.ReplacementAction) + private static final com.google.cloud.retail.v2alpha.Rule.ReplacementAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.ReplacementAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.ReplacementAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplacementAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplacementAction(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.v2alpha.Rule.ReplacementAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IgnoreActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule.IgnoreAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + java.util.List getIgnoreTermsList(); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + int getIgnoreTermsCount(); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + java.lang.String getIgnoreTerms(int index); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + com.google.protobuf.ByteString getIgnoreTermsBytes(int index); + } + /** + * + * + *
+   * Prevents a term in the query from being used in search.
+   * Example: Don't search for "shoddy".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.IgnoreAction} + */ + public static final class IgnoreAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.Rule.IgnoreAction) + IgnoreActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use IgnoreAction.newBuilder() to construct. + private IgnoreAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IgnoreAction() { + ignoreTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IgnoreAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IgnoreAction( + 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)) { + ignoreTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ignoreTerms_.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)) { + ignoreTerms_ = ignoreTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.class, + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder.class); + } + + public static final int IGNORE_TERMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ignoreTerms_; + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + public com.google.protobuf.ProtocolStringList getIgnoreTermsList() { + return ignoreTerms_; + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + public int getIgnoreTermsCount() { + return ignoreTerms_.size(); + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + public java.lang.String getIgnoreTerms(int index) { + return ignoreTerms_.get(index); + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + public com.google.protobuf.ByteString getIgnoreTermsBytes(int index) { + return ignoreTerms_.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 < ignoreTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ignoreTerms_.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 < ignoreTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(ignoreTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getIgnoreTermsList().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.v2alpha.Rule.IgnoreAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule.IgnoreAction other = + (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) obj; + + if (!getIgnoreTermsList().equals(other.getIgnoreTermsList())) 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 (getIgnoreTermsCount() > 0) { + hash = (37 * hash) + IGNORE_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Rule.IgnoreAction 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; + } + /** + * + * + *
+     * Prevents a term in the query from being used in search.
+     * Example: Don't search for "shoddy".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule.IgnoreAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule.IgnoreAction) + com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.class, + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.IgnoreAction.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(); + ignoreTerms_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction build() { + com.google.cloud.retail.v2alpha.Rule.IgnoreAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction buildPartial() { + com.google.cloud.retail.v2alpha.Rule.IgnoreAction result = + new com.google.cloud.retail.v2alpha.Rule.IgnoreAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + ignoreTerms_ = ignoreTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ignoreTerms_ = ignoreTerms_; + 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.v2alpha.Rule.IgnoreAction) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule.IgnoreAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule.IgnoreAction other) { + if (other == com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance()) + return this; + if (!other.ignoreTerms_.isEmpty()) { + if (ignoreTerms_.isEmpty()) { + ignoreTerms_ = other.ignoreTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIgnoreTermsIsMutable(); + ignoreTerms_.addAll(other.ignoreTerms_); + } + 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.v2alpha.Rule.IgnoreAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList ignoreTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIgnoreTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ignoreTerms_ = new com.google.protobuf.LazyStringArrayList(ignoreTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + public com.google.protobuf.ProtocolStringList getIgnoreTermsList() { + return ignoreTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + public int getIgnoreTermsCount() { + return ignoreTerms_.size(); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + public java.lang.String getIgnoreTerms(int index) { + return ignoreTerms_.get(index); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + public com.google.protobuf.ByteString getIgnoreTermsBytes(int index) { + return ignoreTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index to set the value at. + * @param value The ignoreTerms to set. + * @return This builder for chaining. + */ + public Builder setIgnoreTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreTermsIsMutable(); + ignoreTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param value The ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addIgnoreTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreTermsIsMutable(); + ignoreTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param values The ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreTerms(java.lang.Iterable values) { + ensureIgnoreTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ignoreTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreTerms() { + ignoreTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param value The bytes of the ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addIgnoreTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIgnoreTermsIsMutable(); + ignoreTerms_.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.v2alpha.Rule.IgnoreAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule.IgnoreAction) + private static final com.google.cloud.retail.v2alpha.Rule.IgnoreAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule.IgnoreAction(); + } + + public static com.google.cloud.retail.v2alpha.Rule.IgnoreAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IgnoreAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IgnoreAction(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.v2alpha.Rule.IgnoreAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public enum ActionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BOOST_ACTION(2), + REDIRECT_ACTION(3), + ONEWAY_SYNONYMS_ACTION(6), + DO_NOT_ASSOCIATE_ACTION(7), + REPLACEMENT_ACTION(8), + IGNORE_ACTION(9), + FILTER_ACTION(10), + TWOWAY_SYNONYMS_ACTION(11), + ACTION_NOT_SET(0); + private final int value; + + private ActionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ActionCase valueOf(int value) { + return forNumber(value); + } + + public static ActionCase forNumber(int value) { + switch (value) { + case 2: + return BOOST_ACTION; + case 3: + return REDIRECT_ACTION; + case 6: + return ONEWAY_SYNONYMS_ACTION; + case 7: + return DO_NOT_ASSOCIATE_ACTION; + case 8: + return REPLACEMENT_ACTION; + case 9: + return IGNORE_ACTION; + case 10: + return FILTER_ACTION; + case 11: + return TWOWAY_SYNONYMS_ACTION; + case 0: + return ACTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public static final int BOOST_ACTION_FIELD_NUMBER = 2; + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + @java.lang.Override + public boolean hasBoostAction() { + return actionCase_ == 2; + } + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostAction getBoostAction() { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder getBoostActionOrBuilder() { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + + public static final int REDIRECT_ACTION_FIELD_NUMBER = 3; + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + @java.lang.Override + public boolean hasRedirectAction() { + return actionCase_ == 3; + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectAction getRedirectAction() { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder getRedirectActionOrBuilder() { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + + public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER = 6; + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return Whether the onewaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasOnewaySynonymsAction() { + return actionCase_ == 6; + } + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return The onewaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction getOnewaySynonymsAction() { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder() { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + + public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER = 7; + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return Whether the doNotAssociateAction field is set. + */ + @java.lang.Override + public boolean hasDoNotAssociateAction() { + return actionCase_ == 7; + } + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return The doNotAssociateAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction getDoNotAssociateAction() { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder() { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + + public static final int REPLACEMENT_ACTION_FIELD_NUMBER = 8; + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + @java.lang.Override + public boolean hasReplacementAction() { + return actionCase_ == 8; + } + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction getReplacementAction() { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder + getReplacementActionOrBuilder() { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + + public static final int IGNORE_ACTION_FIELD_NUMBER = 9; + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + @java.lang.Override + public boolean hasIgnoreAction() { + return actionCase_ == 9; + } + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction getIgnoreAction() { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder() { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + + public static final int FILTER_ACTION_FIELD_NUMBER = 10; + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + @java.lang.Override + public boolean hasFilterAction() { + return actionCase_ == 10; + } + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterAction getFilterAction() { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder getFilterActionOrBuilder() { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + + public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER = 11; + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return Whether the twowaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasTwowaySynonymsAction() { + return actionCase_ == 11; + } + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return The twowaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction getTwowaySynonymsAction() { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder() { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Condition condition_; + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return condition_ != null; + } + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Condition getCondition() { + return condition_ == null + ? com.google.cloud.retail.v2alpha.Condition.getDefaultInstance() + : condition_; + } + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ConditionOrBuilder getConditionOrBuilder() { + return getCondition(); + } + + 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 (condition_ != null) { + output.writeMessage(1, getCondition()); + } + if (actionCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_); + } + if (actionCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_); + } + if (actionCase_ == 6) { + output.writeMessage(6, (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_); + } + if (actionCase_ == 7) { + output.writeMessage(7, (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_); + } + if (actionCase_ == 8) { + output.writeMessage(8, (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_); + } + if (actionCase_ == 9) { + output.writeMessage(9, (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_); + } + if (actionCase_ == 10) { + output.writeMessage(10, (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_); + } + if (actionCase_ == 11) { + output.writeMessage(11, (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCondition()); + } + if (actionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_); + } + if (actionCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_); + } + if (actionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_); + } + if (actionCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_); + } + if (actionCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_); + } + if (actionCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_); + } + if (actionCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_); + } + if (actionCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_); + } + 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.v2alpha.Rule)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.Rule other = (com.google.cloud.retail.v2alpha.Rule) obj; + + if (hasCondition() != other.hasCondition()) return false; + if (hasCondition()) { + if (!getCondition().equals(other.getCondition())) return false; + } + if (!getActionCase().equals(other.getActionCase())) return false; + switch (actionCase_) { + case 2: + if (!getBoostAction().equals(other.getBoostAction())) return false; + break; + case 3: + if (!getRedirectAction().equals(other.getRedirectAction())) return false; + break; + case 6: + if (!getOnewaySynonymsAction().equals(other.getOnewaySynonymsAction())) return false; + break; + case 7: + if (!getDoNotAssociateAction().equals(other.getDoNotAssociateAction())) return false; + break; + case 8: + if (!getReplacementAction().equals(other.getReplacementAction())) return false; + break; + case 9: + if (!getIgnoreAction().equals(other.getIgnoreAction())) return false; + break; + case 10: + if (!getFilterAction().equals(other.getFilterAction())) return false; + break; + case 11: + if (!getTwowaySynonymsAction().equals(other.getTwowaySynonymsAction())) return false; + break; + case 0: + default: + } + 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 (hasCondition()) { + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + } + switch (actionCase_) { + case 2: + hash = (37 * hash) + BOOST_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getBoostAction().hashCode(); + break; + case 3: + hash = (37 * hash) + REDIRECT_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getRedirectAction().hashCode(); + break; + case 6: + hash = (37 * hash) + ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getOnewaySynonymsAction().hashCode(); + break; + case 7: + hash = (37 * hash) + DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateAction().hashCode(); + break; + case 8: + hash = (37 * hash) + REPLACEMENT_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getReplacementAction().hashCode(); + break; + case 9: + hash = (37 * hash) + IGNORE_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreAction().hashCode(); + break; + case 10: + hash = (37 * hash) + FILTER_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getFilterAction().hashCode(); + break; + case 11: + hash = (37 * hash) + TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getTwowaySynonymsAction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.Rule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.Rule 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; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.Rule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.Rule) + com.google.cloud.retail.v2alpha.RuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.Rule.class, + com.google.cloud.retail.v2alpha.Rule.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.Rule.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 (conditionBuilder_ == null) { + condition_ = null; + } else { + condition_ = null; + conditionBuilder_ = null; + } + actionCase_ = 0; + action_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_Rule_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.Rule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule build() { + com.google.cloud.retail.v2alpha.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule buildPartial() { + com.google.cloud.retail.v2alpha.Rule result = new com.google.cloud.retail.v2alpha.Rule(this); + if (actionCase_ == 2) { + if (boostActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = boostActionBuilder_.build(); + } + } + if (actionCase_ == 3) { + if (redirectActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = redirectActionBuilder_.build(); + } + } + if (actionCase_ == 6) { + if (onewaySynonymsActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = onewaySynonymsActionBuilder_.build(); + } + } + if (actionCase_ == 7) { + if (doNotAssociateActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = doNotAssociateActionBuilder_.build(); + } + } + if (actionCase_ == 8) { + if (replacementActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = replacementActionBuilder_.build(); + } + } + if (actionCase_ == 9) { + if (ignoreActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = ignoreActionBuilder_.build(); + } + } + if (actionCase_ == 10) { + if (filterActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = filterActionBuilder_.build(); + } + } + if (actionCase_ == 11) { + if (twowaySynonymsActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = twowaySynonymsActionBuilder_.build(); + } + } + if (conditionBuilder_ == null) { + result.condition_ = condition_; + } else { + result.condition_ = conditionBuilder_.build(); + } + result.actionCase_ = actionCase_; + 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.v2alpha.Rule) { + return mergeFrom((com.google.cloud.retail.v2alpha.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.Rule other) { + if (other == com.google.cloud.retail.v2alpha.Rule.getDefaultInstance()) return this; + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + switch (other.getActionCase()) { + case BOOST_ACTION: + { + mergeBoostAction(other.getBoostAction()); + break; + } + case REDIRECT_ACTION: + { + mergeRedirectAction(other.getRedirectAction()); + break; + } + case ONEWAY_SYNONYMS_ACTION: + { + mergeOnewaySynonymsAction(other.getOnewaySynonymsAction()); + break; + } + case DO_NOT_ASSOCIATE_ACTION: + { + mergeDoNotAssociateAction(other.getDoNotAssociateAction()); + break; + } + case REPLACEMENT_ACTION: + { + mergeReplacementAction(other.getReplacementAction()); + break; + } + case IGNORE_ACTION: + { + mergeIgnoreAction(other.getIgnoreAction()); + break; + } + case FILTER_ACTION: + { + mergeFilterAction(other.getFilterAction()); + break; + } + case TWOWAY_SYNONYMS_ACTION: + { + mergeTwowaySynonymsAction(other.getTwowaySynonymsAction()); + break; + } + case ACTION_NOT_SET: + { + break; + } + } + 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.v2alpha.Rule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.Rule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public Builder clearAction() { + actionCase_ = 0; + action_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.BoostAction, + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder, + com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder> + boostActionBuilder_; + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + @java.lang.Override + public boolean hasBoostAction() { + return actionCase_ == 2; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostAction getBoostAction() { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } else { + if (actionCase_ == 2) { + return boostActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + public Builder setBoostAction(com.google.cloud.retail.v2alpha.Rule.BoostAction value) { + if (boostActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + boostActionBuilder_.setMessage(value); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + public Builder setBoostAction( + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder builderForValue) { + if (boostActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + boostActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + public Builder mergeBoostAction(com.google.cloud.retail.v2alpha.Rule.BoostAction value) { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2 + && action_ != com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.BoostAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 2) { + boostActionBuilder_.mergeFrom(value); + } else { + boostActionBuilder_.setMessage(value); + } + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + public Builder clearBoostAction() { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + } + boostActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + public com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder getBoostActionBuilder() { + return getBoostActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder getBoostActionOrBuilder() { + if ((actionCase_ == 2) && (boostActionBuilder_ != null)) { + return boostActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.BoostAction, + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder, + com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder> + getBoostActionFieldBuilder() { + if (boostActionBuilder_ == null) { + if (!(actionCase_ == 2)) { + action_ = com.google.cloud.retail.v2alpha.Rule.BoostAction.getDefaultInstance(); + } + boostActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.BoostAction, + com.google.cloud.retail.v2alpha.Rule.BoostAction.Builder, + com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.BoostAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 2; + onChanged(); + ; + return boostActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.RedirectAction, + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder> + redirectActionBuilder_; + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + @java.lang.Override + public boolean hasRedirectAction() { + return actionCase_ == 3; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectAction getRedirectAction() { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } else { + if (actionCase_ == 3) { + return redirectActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + public Builder setRedirectAction(com.google.cloud.retail.v2alpha.Rule.RedirectAction value) { + if (redirectActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + redirectActionBuilder_.setMessage(value); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + public Builder setRedirectAction( + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder builderForValue) { + if (redirectActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + redirectActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + public Builder mergeRedirectAction(com.google.cloud.retail.v2alpha.Rule.RedirectAction value) { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3 + && action_ + != com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.RedirectAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 3) { + redirectActionBuilder_.mergeFrom(value); + } else { + redirectActionBuilder_.setMessage(value); + } + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + public Builder clearRedirectAction() { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + } + redirectActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + public com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder getRedirectActionBuilder() { + return getRedirectActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder + getRedirectActionOrBuilder() { + if ((actionCase_ == 3) && (redirectActionBuilder_ != null)) { + return redirectActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.RedirectAction, + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder> + getRedirectActionFieldBuilder() { + if (redirectActionBuilder_ == null) { + if (!(actionCase_ == 3)) { + action_ = com.google.cloud.retail.v2alpha.Rule.RedirectAction.getDefaultInstance(); + } + redirectActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.RedirectAction, + com.google.cloud.retail.v2alpha.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.RedirectAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 3; + onChanged(); + ; + return redirectActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder> + onewaySynonymsActionBuilder_; + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * + * @return Whether the onewaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasOnewaySynonymsAction() { + return actionCase_ == 6; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * + * @return The onewaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction getOnewaySynonymsAction() { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } else { + if (actionCase_ == 6) { + return onewaySynonymsActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder setOnewaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction value) { + if (onewaySynonymsActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + onewaySynonymsActionBuilder_.setMessage(value); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder setOnewaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder builderForValue) { + if (onewaySynonymsActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + onewaySynonymsActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder mergeOnewaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction value) { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6 + && action_ + != com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 6) { + onewaySynonymsActionBuilder_.mergeFrom(value); + } else { + onewaySynonymsActionBuilder_.setMessage(value); + } + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder clearOnewaySynonymsAction() { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + } + onewaySynonymsActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder + getOnewaySynonymsActionBuilder() { + return getOnewaySynonymsActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder() { + if ((actionCase_ == 6) && (onewaySynonymsActionBuilder_ != null)) { + return onewaySynonymsActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder> + getOnewaySynonymsActionFieldBuilder() { + if (onewaySynonymsActionBuilder_ == null) { + if (!(actionCase_ == 6)) { + action_ = com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + onewaySynonymsActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 6; + onChanged(); + ; + return onewaySynonymsActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder> + doNotAssociateActionBuilder_; + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return Whether the doNotAssociateAction field is set. + */ + @java.lang.Override + public boolean hasDoNotAssociateAction() { + return actionCase_ == 7; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return The doNotAssociateAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction getDoNotAssociateAction() { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } else { + if (actionCase_ == 7) { + return doNotAssociateActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder setDoNotAssociateAction( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction value) { + if (doNotAssociateActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + doNotAssociateActionBuilder_.setMessage(value); + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder setDoNotAssociateAction( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder builderForValue) { + if (doNotAssociateActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + doNotAssociateActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder mergeDoNotAssociateAction( + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction value) { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7 + && action_ + != com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 7) { + doNotAssociateActionBuilder_.mergeFrom(value); + } else { + doNotAssociateActionBuilder_.setMessage(value); + } + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder clearDoNotAssociateAction() { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 7) { + actionCase_ = 0; + action_ = null; + } + doNotAssociateActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder + getDoNotAssociateActionBuilder() { + return getDoNotAssociateActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder() { + if ((actionCase_ == 7) && (doNotAssociateActionBuilder_ != null)) { + return doNotAssociateActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder> + getDoNotAssociateActionFieldBuilder() { + if (doNotAssociateActionBuilder_ == null) { + if (!(actionCase_ == 7)) { + action_ = com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.getDefaultInstance(); + } + doNotAssociateActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 7; + onChanged(); + ; + return doNotAssociateActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.ReplacementAction, + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder> + replacementActionBuilder_; + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + @java.lang.Override + public boolean hasReplacementAction() { + return actionCase_ == 8; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction getReplacementAction() { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } else { + if (actionCase_ == 8) { + return replacementActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + public Builder setReplacementAction( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction value) { + if (replacementActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + replacementActionBuilder_.setMessage(value); + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + public Builder setReplacementAction( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder builderForValue) { + if (replacementActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + replacementActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + public Builder mergeReplacementAction( + com.google.cloud.retail.v2alpha.Rule.ReplacementAction value) { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8 + && action_ + != com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 8) { + replacementActionBuilder_.mergeFrom(value); + } else { + replacementActionBuilder_.setMessage(value); + } + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + public Builder clearReplacementAction() { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 8) { + actionCase_ = 0; + action_ = null; + } + replacementActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + public com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder + getReplacementActionBuilder() { + return getReplacementActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder + getReplacementActionOrBuilder() { + if ((actionCase_ == 8) && (replacementActionBuilder_ != null)) { + return replacementActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.ReplacementAction, + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder> + getReplacementActionFieldBuilder() { + if (replacementActionBuilder_ == null) { + if (!(actionCase_ == 8)) { + action_ = com.google.cloud.retail.v2alpha.Rule.ReplacementAction.getDefaultInstance(); + } + replacementActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.ReplacementAction, + com.google.cloud.retail.v2alpha.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.ReplacementAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 8; + onChanged(); + ; + return replacementActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.IgnoreAction, + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder> + ignoreActionBuilder_; + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + @java.lang.Override + public boolean hasIgnoreAction() { + return actionCase_ == 9; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction getIgnoreAction() { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } else { + if (actionCase_ == 9) { + return ignoreActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + public Builder setIgnoreAction(com.google.cloud.retail.v2alpha.Rule.IgnoreAction value) { + if (ignoreActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + ignoreActionBuilder_.setMessage(value); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + public Builder setIgnoreAction( + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder builderForValue) { + if (ignoreActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + ignoreActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + public Builder mergeIgnoreAction(com.google.cloud.retail.v2alpha.Rule.IgnoreAction value) { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9 + && action_ != com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 9) { + ignoreActionBuilder_.mergeFrom(value); + } else { + ignoreActionBuilder_.setMessage(value); + } + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + public Builder clearIgnoreAction() { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + } + ignoreActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + public com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder getIgnoreActionBuilder() { + return getIgnoreActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder() { + if ((actionCase_ == 9) && (ignoreActionBuilder_ != null)) { + return ignoreActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.IgnoreAction, + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder> + getIgnoreActionFieldBuilder() { + if (ignoreActionBuilder_ == null) { + if (!(actionCase_ == 9)) { + action_ = com.google.cloud.retail.v2alpha.Rule.IgnoreAction.getDefaultInstance(); + } + ignoreActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.IgnoreAction, + com.google.cloud.retail.v2alpha.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.IgnoreAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 9; + onChanged(); + ; + return ignoreActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.FilterAction, + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder, + com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder> + filterActionBuilder_; + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + @java.lang.Override + public boolean hasFilterAction() { + return actionCase_ == 10; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterAction getFilterAction() { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } else { + if (actionCase_ == 10) { + return filterActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + public Builder setFilterAction(com.google.cloud.retail.v2alpha.Rule.FilterAction value) { + if (filterActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + filterActionBuilder_.setMessage(value); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + public Builder setFilterAction( + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder builderForValue) { + if (filterActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + filterActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + public Builder mergeFilterAction(com.google.cloud.retail.v2alpha.Rule.FilterAction value) { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10 + && action_ != com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.FilterAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 10) { + filterActionBuilder_.mergeFrom(value); + } else { + filterActionBuilder_.setMessage(value); + } + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + public Builder clearFilterAction() { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + } + filterActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + public com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder getFilterActionBuilder() { + return getFilterActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder getFilterActionOrBuilder() { + if ((actionCase_ == 10) && (filterActionBuilder_ != null)) { + return filterActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.FilterAction, + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder, + com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder> + getFilterActionFieldBuilder() { + if (filterActionBuilder_ == null) { + if (!(actionCase_ == 10)) { + action_ = com.google.cloud.retail.v2alpha.Rule.FilterAction.getDefaultInstance(); + } + filterActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.FilterAction, + com.google.cloud.retail.v2alpha.Rule.FilterAction.Builder, + com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.FilterAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 10; + onChanged(); + ; + return filterActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder> + twowaySynonymsActionBuilder_; + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return Whether the twowaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasTwowaySynonymsAction() { + return actionCase_ == 11; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return The twowaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction getTwowaySynonymsAction() { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } else { + if (actionCase_ == 11) { + return twowaySynonymsActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder setTwowaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction value) { + if (twowaySynonymsActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + twowaySynonymsActionBuilder_.setMessage(value); + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder setTwowaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder builderForValue) { + if (twowaySynonymsActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + twowaySynonymsActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder mergeTwowaySynonymsAction( + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction value) { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11 + && action_ + != com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.newBuilder( + (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 11) { + twowaySynonymsActionBuilder_.mergeFrom(value); + } else { + twowaySynonymsActionBuilder_.setMessage(value); + } + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder clearTwowaySynonymsAction() { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 11) { + actionCase_ = 0; + action_ = null; + } + twowaySynonymsActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder + getTwowaySynonymsActionBuilder() { + return getTwowaySynonymsActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder() { + if ((actionCase_ == 11) && (twowaySynonymsActionBuilder_ != null)) { + return twowaySynonymsActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder> + getTwowaySynonymsActionFieldBuilder() { + if (twowaySynonymsActionBuilder_ == null) { + if (!(actionCase_ == 11)) { + action_ = com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + twowaySynonymsActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder>( + (com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 11; + onChanged(); + ; + return twowaySynonymsActionBuilder_; + } + + private com.google.cloud.retail.v2alpha.Condition condition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition, + com.google.cloud.retail.v2alpha.Condition.Builder, + com.google.cloud.retail.v2alpha.ConditionOrBuilder> + conditionBuilder_; + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + public boolean hasCondition() { + return conditionBuilder_ != null || condition_ != null; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + public com.google.cloud.retail.v2alpha.Condition getCondition() { + if (conditionBuilder_ == null) { + return condition_ == null + ? com.google.cloud.retail.v2alpha.Condition.getDefaultInstance() + : condition_; + } else { + return conditionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCondition(com.google.cloud.retail.v2alpha.Condition value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCondition(com.google.cloud.retail.v2alpha.Condition.Builder builderForValue) { + if (conditionBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCondition(com.google.cloud.retail.v2alpha.Condition value) { + if (conditionBuilder_ == null) { + if (condition_ != null) { + condition_ = + com.google.cloud.retail.v2alpha.Condition.newBuilder(condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); + } else { + conditionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCondition() { + if (conditionBuilder_ == null) { + condition_ = null; + onChanged(); + } else { + condition_ = null; + conditionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Condition.Builder getConditionBuilder() { + + onChanged(); + return getConditionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ConditionOrBuilder getConditionOrBuilder() { + if (conditionBuilder_ != null) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + return condition_ == null + ? com.google.cloud.retail.v2alpha.Condition.getDefaultInstance() + : condition_; + } + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition, + com.google.cloud.retail.v2alpha.Condition.Builder, + com.google.cloud.retail.v2alpha.ConditionOrBuilder> + getConditionFieldBuilder() { + if (conditionBuilder_ == null) { + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Condition, + com.google.cloud.retail.v2alpha.Condition.Builder, + com.google.cloud.retail.v2alpha.ConditionOrBuilder>( + getCondition(), getParentForChildren(), isClean()); + condition_ = null; + } + return conditionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.Rule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.Rule) + private static final com.google.cloud.retail.v2alpha.Rule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.Rule(); + } + + public static com.google.cloud.retail.v2alpha.Rule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rule(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.v2alpha.Rule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RuleOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RuleOrBuilder.java new file mode 100644 index 00000000..3699d397 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/RuleOrBuilder.java @@ -0,0 +1,363 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + boolean hasBoostAction(); + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + com.google.cloud.retail.v2alpha.Rule.BoostAction getBoostAction(); + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2; + */ + com.google.cloud.retail.v2alpha.Rule.BoostActionOrBuilder getBoostActionOrBuilder(); + + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + boolean hasRedirectAction(); + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + com.google.cloud.retail.v2alpha.Rule.RedirectAction getRedirectAction(); + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3; + */ + com.google.cloud.retail.v2alpha.Rule.RedirectActionOrBuilder getRedirectActionOrBuilder(); + + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return Whether the onewaySynonymsAction field is set. + */ + boolean hasOnewaySynonymsAction(); + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return The onewaySynonymsAction. + */ + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction getOnewaySynonymsAction(); + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + */ + com.google.cloud.retail.v2alpha.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder(); + + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return Whether the doNotAssociateAction field is set. + */ + boolean hasDoNotAssociateAction(); + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return The doNotAssociateAction. + */ + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction getDoNotAssociateAction(); + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + com.google.cloud.retail.v2alpha.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder(); + + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + boolean hasReplacementAction(); + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + com.google.cloud.retail.v2alpha.Rule.ReplacementAction getReplacementAction(); + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8; + */ + com.google.cloud.retail.v2alpha.Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder(); + + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + boolean hasIgnoreAction(); + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + com.google.cloud.retail.v2alpha.Rule.IgnoreAction getIgnoreAction(); + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9; + */ + com.google.cloud.retail.v2alpha.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder(); + + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + boolean hasFilterAction(); + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + com.google.cloud.retail.v2alpha.Rule.FilterAction getFilterAction(); + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10; + */ + com.google.cloud.retail.v2alpha.Rule.FilterActionOrBuilder getFilterActionOrBuilder(); + + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return Whether the twowaySynonymsAction field is set. + */ + boolean hasTwowaySynonymsAction(); + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return The twowaySynonymsAction. + */ + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction getTwowaySynonymsAction(); + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + com.google.cloud.retail.v2alpha.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder(); + + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + com.google.cloud.retail.v2alpha.Condition getCondition(); + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ConditionOrBuilder getConditionOrBuilder(); + + public com.google.cloud.retail.v2alpha.Rule.ActionCase getActionCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequest.java new file mode 100644 index 00000000..0986968e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequest.java @@ -0,0 +1,17240 @@ +/* + * 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/v2alpha/search_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for
+ * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest} + */ +public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest) + SearchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchRequest.newBuilder() to construct. + private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchRequest() { + placement_ = ""; + branch_ = ""; + query_ = ""; + visitorId_ = ""; + pageToken_ = ""; + filter_ = ""; + canonicalFilter_ = ""; + orderBy_ = ""; + facetSpecs_ = java.util.Collections.emptyList(); + relevanceThreshold_ = 0; + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + searchMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchRequest( + 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(); + + placement_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branch_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + case 42: + { + com.google.cloud.retail.v2alpha.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + offset_ = input.readInt32(); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec>(); + mutable_bitField0_ |= 0x00000001; + } + facetSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.parser(), + extensionRegistry)); + break; + } + case 106: + { + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder subBuilder = null; + if (boostSpec_ != null) { + subBuilder = boostSpec_.toBuilder(); + } + boostSpec_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boostSpec_); + boostSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder subBuilder = + null; + if (queryExpansionSpec_ != null) { + subBuilder = queryExpansionSpec_.toBuilder(); + } + queryExpansionSpec_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionSpec_); + queryExpansionSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 120: + { + int rawValue = input.readEnum(); + + relevanceThreshold_ = rawValue; + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + variantRollupKeys_.add(s); + break; + } + case 170: + { + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder subBuilder = + null; + if (dynamicFacetSpec_ != null) { + subBuilder = dynamicFacetSpec_.toBuilder(); + } + dynamicFacetSpec_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicFacetSpec_); + dynamicFacetSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 186: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + pageCategories_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalFilter_ = s; + break; + } + case 248: + { + int rawValue = input.readEnum(); + + searchMode_ = rawValue; + break; + } + case 258: + { + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder subBuilder = + null; + if (personalizationSpec_ != null) { + subBuilder = personalizationSpec_.toBuilder(); + } + personalizationSpec_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(personalizationSpec_); + personalizationSpec_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.class, + com.google.cloud.retail.v2alpha.SearchRequest.Builder.class); + } + + /** + * + * + *
+   * The relevance threshold of the search results. The higher relevance
+   * threshold is, the higher relevant results are shown and the less number of
+   * results are returned.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} + */ + public enum RelevanceThreshold implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH].
+     * 
+ * + * RELEVANCE_THRESHOLD_UNSPECIFIED = 0; + */ + RELEVANCE_THRESHOLD_UNSPECIFIED(0), + /** + * + * + *
+     * High relevance threshold.
+     * 
+ * + * HIGH = 1; + */ + HIGH(1), + /** + * + * + *
+     * Medium relevance threshold.
+     * 
+ * + * MEDIUM = 2; + */ + MEDIUM(2), + /** + * + * + *
+     * Low relevance threshold.
+     * 
+ * + * LOW = 3; + */ + LOW(3), + /** + * + * + *
+     * Lowest relevance threshold.
+     * 
+ * + * LOWEST = 4; + */ + LOWEST(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH].
+     * 
+ * + * RELEVANCE_THRESHOLD_UNSPECIFIED = 0; + */ + public static final int RELEVANCE_THRESHOLD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * High relevance threshold.
+     * 
+ * + * HIGH = 1; + */ + public static final int HIGH_VALUE = 1; + /** + * + * + *
+     * Medium relevance threshold.
+     * 
+ * + * MEDIUM = 2; + */ + public static final int MEDIUM_VALUE = 2; + /** + * + * + *
+     * Low relevance threshold.
+     * 
+ * + * LOW = 3; + */ + public static final int LOW_VALUE = 3; + /** + * + * + *
+     * Lowest relevance threshold.
+     * 
+ * + * LOWEST = 4; + */ + public static final int LOWEST_VALUE = 4; + + 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 RelevanceThreshold 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 RelevanceThreshold forNumber(int value) { + switch (value) { + case 0: + return RELEVANCE_THRESHOLD_UNSPECIFIED; + case 1: + return HIGH; + case 2: + return MEDIUM; + case 3: + return LOW; + case 4: + return LOWEST; + 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 RelevanceThreshold findValueByNumber(int number) { + return RelevanceThreshold.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.v2alpha.SearchRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final RelevanceThreshold[] VALUES = values(); + + public static RelevanceThreshold 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 RelevanceThreshold(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold) + } + + /** + * + * + *
+   * The search mode of each search request.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchRequest.SearchMode} + */ + 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.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + 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
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * or
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec]
+     * is set.
+     * 
+ * + * PRODUCT_SEARCH_ONLY = 1; + */ + PRODUCT_SEARCH_ONLY(1), + /** + * + * + *
+     * Only faceted search will be performed. The product search will be
+     * disabled.
+     * When in this mode, one or both of [SearchRequest.facet_spec][] and
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec]
+     * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
+     * [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
+     * will not be returned.
+     * 
+ * + * FACETED_SEARCH_ONLY = 2; + */ + FACETED_SEARCH_ONLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. In this case both product search and faceted search will
+     * be performed. Both [SearchResponse.SearchResult] and
+     * [SearchResponse.Facet] will be returned.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + public static final int SEARCH_MODE_UNSPECIFIED_VALUE = 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
+     * [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
+     * or
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec]
+     * is set.
+     * 
+ * + * PRODUCT_SEARCH_ONLY = 1; + */ + public static final int PRODUCT_SEARCH_ONLY_VALUE = 1; + /** + * + * + *
+     * Only faceted search will be performed. The product search will be
+     * disabled.
+     * When in this mode, one or both of [SearchRequest.facet_spec][] and
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec]
+     * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
+     * [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
+     * will not be returned.
+     * 
+ * + * FACETED_SEARCH_ONLY = 2; + */ + public static final int FACETED_SEARCH_ONLY_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 SearchMode 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 SearchMode forNumber(int value) { + switch (value) { + case 0: + return SEARCH_MODE_UNSPECIFIED; + case 1: + return PRODUCT_SEARCH_ONLY; + case 2: + return FACETED_SEARCH_ONLY; + 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 SearchMode findValueByNumber(int number) { + return SearchMode.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.v2alpha.SearchRequest.getDescriptor().getEnumTypes().get(1); + } + + private static final SearchMode[] VALUES = values(); + + public static SearchMode 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 SearchMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchRequest.SearchMode) + } + + public interface FacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + boolean hasFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey getFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder(); + + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + int getLimit(); + + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + java.util.List getExcludedFilterKeysList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + int getExcludedFilterKeysCount(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + java.lang.String getExcludedFilterKeys(int index); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index); + + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + boolean getEnableDynamicPosition(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.FacetSpec} + */ + public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + FacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetSpec.newBuilder() to construct. + private FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetSpec() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetSpec( + 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: + { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder + subBuilder = null; + if (facetKey_ != null) { + subBuilder = facetKey_.toBuilder(); + } + facetKey_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(facetKey_); + facetKey_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + limit_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + excludedFilterKeys_.add(s); + break; + } + case 32: + { + enableDynamicPosition_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder.class); + } + + public interface FacetKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + java.util.List getIntervalsList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + com.google.cloud.retail.v2alpha.Interval getIntervals(int index); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + int getIntervalsCount(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + java.util.List + getIntervalsOrBuilderList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalsOrBuilder(int index); + + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + java.util.List getRestrictedValuesList(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + int getRestrictedValuesCount(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + java.lang.String getRestrictedValues(int index); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + com.google.protobuf.ByteString getRestrictedValuesBytes(int index); + + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + java.util.List getPrefixesList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + int getPrefixesCount(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + java.lang.String getPrefixes(int index); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + com.google.protobuf.ByteString getPrefixesBytes(int index); + + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + java.util.List getContainsList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + int getContainsCount(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + java.lang.String getContains(int index); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + com.google.protobuf.ByteString getContainsBytes(int index); + + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + } + /** + * + * + *
+     * Specifies how a facet is computed.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} + */ + public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + FacetKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetKey.newBuilder() to construct. + private FacetKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetKey() { + key_ = ""; + intervals_ = java.util.Collections.emptyList(); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + orderBy_ = ""; + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetKey(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetKey( + 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(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + intervals_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + intervals_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.Interval.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + restrictedValues_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + prefixes_.add(s); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + contains_.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)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVALS_FIELD_NUMBER = 2; + private java.util.List intervals_; + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List getIntervalsList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List + getIntervalsOrBuilderList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + @java.lang.Override + public int getIntervalsCount() { + return intervals_.size(); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getIntervals(int index) { + return intervals_.get(index); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalsOrBuilder(int index) { + return intervals_.get(index); + } + + public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList restrictedValues_; + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_; + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + + public static final int PREFIXES_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList prefixes_; + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_; + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + + public static final int CONTAINS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList contains_; + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_; + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 5; + private volatile java.lang.Object query_; + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + output.writeMessage(2, intervals_.get(i)); + } + for (int i = 0; i < restrictedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, restrictedValues_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, query_); + } + for (int i = 0; i < prefixes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, prefixes_.getRaw(i)); + } + for (int i = 0; i < contains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, contains_.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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, intervals_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedValuesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, query_); + } + { + int dataSize = 0; + for (int i = 0; i < prefixes_.size(); i++) { + dataSize += computeStringSizeNoTag(prefixes_.getRaw(i)); + } + size += dataSize; + size += 1 * getPrefixesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < contains_.size(); i++) { + dataSize += computeStringSizeNoTag(contains_.getRaw(i)); + } + size += dataSize; + size += 1 * getContainsList().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.v2alpha.SearchRequest.FacetSpec.FacetKey)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey other = + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getIntervalsList().equals(other.getIntervalsList())) return false; + if (!getRestrictedValuesList().equals(other.getRestrictedValuesList())) return false; + if (!getPrefixesList().equals(other.getPrefixesList())) return false; + if (!getContainsList().equals(other.getContainsList())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getQuery().equals(other.getQuery())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getIntervalsCount() > 0) { + hash = (37 * hash) + INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getIntervalsList().hashCode(); + } + if (getRestrictedValuesCount() > 0) { + hash = (37 * hash) + RESTRICTED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedValuesList().hashCode(); + } + if (getPrefixesCount() > 0) { + hash = (37 * hash) + PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getPrefixesList().hashCode(); + } + if (getContainsCount() > 0) { + hash = (37 * hash) + CONTAINS_FIELD_NUMBER; + hash = (53 * hash) + getContainsList().hashCode(); + } + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey 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; + } + /** + * + * + *
+       * Specifies how a facet is computed.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntervalsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + intervalsBuilder_.clear(); + } + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + orderBy_ = ""; + + query_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey build() { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey result = + new com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (intervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.intervals_ = intervals_; + } else { + result.intervals_ = intervalsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.restrictedValues_ = restrictedValues_; + if (((bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.prefixes_ = prefixes_; + if (((bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.contains_ = contains_; + result.orderBy_ = orderBy_; + result.query_ = query_; + 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.v2alpha.SearchRequest.FacetSpec.FacetKey) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey other) { + if (other + == com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (intervalsBuilder_ == null) { + if (!other.intervals_.isEmpty()) { + if (intervals_.isEmpty()) { + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIntervalsIsMutable(); + intervals_.addAll(other.intervals_); + } + onChanged(); + } + } else { + if (!other.intervals_.isEmpty()) { + if (intervalsBuilder_.isEmpty()) { + intervalsBuilder_.dispose(); + intervalsBuilder_ = null; + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + intervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntervalsFieldBuilder() + : null; + } else { + intervalsBuilder_.addAllMessages(other.intervals_); + } + } + } + if (!other.restrictedValues_.isEmpty()) { + if (restrictedValues_.isEmpty()) { + restrictedValues_ = other.restrictedValues_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRestrictedValuesIsMutable(); + restrictedValues_.addAll(other.restrictedValues_); + } + onChanged(); + } + if (!other.prefixes_.isEmpty()) { + if (prefixes_.isEmpty()) { + prefixes_ = other.prefixes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePrefixesIsMutable(); + prefixes_.addAll(other.prefixes_); + } + onChanged(); + } + if (!other.contains_.isEmpty()) { + if (contains_.isEmpty()) { + contains_ = other.contains_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureContainsIsMutable(); + contains_.addAll(other.contains_); + } + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + 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.v2alpha.SearchRequest.FacetSpec.FacetKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2alpha.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List intervals_ = + java.util.Collections.emptyList(); + + private void ensureIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + intervals_ = + new java.util.ArrayList(intervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + intervalsBuilder_; + + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public java.util.List getIntervalsList() { + if (intervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(intervals_); + } else { + return intervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public int getIntervalsCount() { + if (intervalsBuilder_ == null) { + return intervals_.size(); + } else { + return intervalsBuilder_.getCount(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public com.google.cloud.retail.v2alpha.Interval getIntervals(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder setIntervals(int index, com.google.cloud.retail.v2alpha.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.set(index, value); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.set(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder addIntervals(com.google.cloud.retail.v2alpha.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(value); + onChanged(); + } else { + intervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder addIntervals(int index, com.google.cloud.retail.v2alpha.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(index, value); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder addIntervals( + com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder addAllIntervals( + java.lang.Iterable values) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_); + onChanged(); + } else { + intervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder clearIntervals() { + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + intervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public Builder removeIntervals(int index) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.remove(index); + onChanged(); + } else { + intervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder getIntervalsBuilder(int index) { + return getIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalsOrBuilder(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public java.util.List + getIntervalsOrBuilderList() { + if (intervalsBuilder_ != null) { + return intervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intervals_); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder addIntervalsBuilder() { + return getIntervalsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder addIntervalsBuilder(int index) { + return getIntervalsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2alpha.Interval intervals = 2; + */ + public java.util.List + getIntervalsBuilderList() { + return getIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + getIntervalsFieldBuilder() { + if (intervalsBuilder_ == null) { + intervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder>( + intervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + intervals_ = null; + } + return intervalsBuilder_; + } + + private com.google.protobuf.LazyStringList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRestrictedValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index to set the value at. + * @param value The restrictedValues to set. + * @return This builder for chaining. + */ + public Builder setRestrictedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param values The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedValues(java.lang.Iterable values) { + ensureRestrictedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedValues() { + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The bytes of the restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList prefixes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePrefixesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index to set the value at. + * @param value The prefixes to set. + * @return This builder for chaining. + */ + public Builder setPrefixes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param values The prefixes to add. + * @return This builder for chaining. + */ + public Builder addAllPrefixes(java.lang.Iterable values) { + ensurePrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return This builder for chaining. + */ + public Builder clearPrefixes() { + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The bytes of the prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList contains_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureContainsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(contains_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index to set the value at. + * @param value The contains to set. + * @return This builder for chaining. + */ + public Builder setContains(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The contains to add. + * @return This builder for chaining. + */ + public Builder addContains(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param values The contains to add. + * @return This builder for chaining. + */ + public Builder addAllContains(java.lang.Iterable values) { + ensureContainsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return This builder for chaining. + */ + public Builder clearContains() { + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The bytes of the contains to add. + * @return This builder for chaining. + */ + public Builder addContainsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = 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.v2alpha.SearchRequest.FacetSpec.FacetKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + private static final com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetKey(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.v2alpha.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FACET_KEY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facetKey_; + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + @java.lang.Override + public boolean hasFacetKey() { + return facetKey_ != null; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey getFacetKey() { + return facetKey_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + return getFacetKey(); + } + + public static final int LIMIT_FIELD_NUMBER = 2; + private int limit_; + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int EXCLUDED_FILTER_KEYS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList excludedFilterKeys_; + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_; + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + + public static final int ENABLE_DYNAMIC_POSITION_FIELD_NUMBER = 4; + private boolean enableDynamicPosition_; + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + + 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 (facetKey_ != null) { + output.writeMessage(1, getFacetKey()); + } + if (limit_ != 0) { + output.writeInt32(2, limit_); + } + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, excludedFilterKeys_.getRaw(i)); + } + if (enableDynamicPosition_ != false) { + output.writeBool(4, enableDynamicPosition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFacetKey()); + } + if (limit_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, limit_); + } + { + int dataSize = 0; + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(excludedFilterKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getExcludedFilterKeysList().size(); + } + if (enableDynamicPosition_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enableDynamicPosition_); + } + 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.v2alpha.SearchRequest.FacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) obj; + + if (hasFacetKey() != other.hasFacetKey()) return false; + if (hasFacetKey()) { + if (!getFacetKey().equals(other.getFacetKey())) return false; + } + if (getLimit() != other.getLimit()) return false; + if (!getExcludedFilterKeysList().equals(other.getExcludedFilterKeysList())) return false; + if (getEnableDynamicPosition() != other.getEnableDynamicPosition()) 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 (hasFacetKey()) { + hash = (37 * hash) + FACET_KEY_FIELD_NUMBER; + hash = (53 * hash) + getFacetKey().hashCode(); + } + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + if (getExcludedFilterKeysCount() > 0) { + hash = (37 * hash) + EXCLUDED_FILTER_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedFilterKeysList().hashCode(); + } + hash = (37 * hash) + ENABLE_DYNAMIC_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPosition()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec 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; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.FacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.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 (facetKeyBuilder_ == null) { + facetKey_ = null; + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + limit_ = 0; + + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + enableDynamicPosition_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(this); + int from_bitField0_ = bitField0_; + if (facetKeyBuilder_ == null) { + result.facetKey_ = facetKey_; + } else { + result.facetKey_ = facetKeyBuilder_.build(); + } + result.limit_ = limit_; + if (((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.excludedFilterKeys_ = excludedFilterKeys_; + result.enableDynamicPosition_ = enableDynamicPosition_; + 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.v2alpha.SearchRequest.FacetSpec) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec other) { + if (other == com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance()) + return this; + if (other.hasFacetKey()) { + mergeFacetKey(other.getFacetKey()); + } + if (other.getLimit() != 0) { + setLimit(other.getLimit()); + } + if (!other.excludedFilterKeys_.isEmpty()) { + if (excludedFilterKeys_.isEmpty()) { + excludedFilterKeys_ = other.excludedFilterKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.addAll(other.excludedFilterKeys_); + } + onChanged(); + } + if (other.getEnableDynamicPosition() != false) { + setEnableDynamicPosition(other.getEnableDynamicPosition()); + } + 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.v2alpha.SearchRequest.FacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facetKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder> + facetKeyBuilder_; + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + public boolean hasFacetKey() { + return facetKeyBuilder_ != null || facetKey_ != null; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey getFacetKey() { + if (facetKeyBuilder_ == null) { + return facetKey_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } else { + return facetKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetKey_ = value; + onChanged(); + } else { + facetKeyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder + builderForValue) { + if (facetKeyBuilder_ == null) { + facetKey_ = builderForValue.build(); + onChanged(); + } else { + facetKeyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFacetKey( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (facetKey_ != null) { + facetKey_ = + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.newBuilder( + facetKey_) + .mergeFrom(value) + .buildPartial(); + } else { + facetKey_ = value; + } + onChanged(); + } else { + facetKeyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFacetKey() { + if (facetKeyBuilder_ == null) { + facetKey_ = null; + onChanged(); + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder + getFacetKeyBuilder() { + + onChanged(); + return getFacetKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + if (facetKeyBuilder_ != null) { + return facetKeyBuilder_.getMessageOrBuilder(); + } else { + return facetKey_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder> + getFacetKeyFieldBuilder() { + if (facetKeyBuilder_ == null) { + facetKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder>( + getFacetKey(), getParentForChildren(), isClean()); + facetKey_ = null; + } + return facetKeyBuilder_; + } + + private int limit_; + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimit() { + + limit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExcludedFilterKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_.getUnmodifiableView(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index to set the value at. + * @param value The excludedFilterKeys to set. + * @return This builder for chaining. + */ + public Builder setExcludedFilterKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param values The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addAllExcludedFilterKeys(java.lang.Iterable values) { + ensureExcludedFilterKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return This builder for chaining. + */ + public Builder clearExcludedFilterKeys() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The bytes of the excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + + private boolean enableDynamicPosition_; + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @param value The enableDynamicPosition to set. + * @return This builder for chaining. + */ + public Builder setEnableDynamicPosition(boolean value) { + + enableDynamicPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnableDynamicPosition() { + + enableDynamicPosition_ = 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.v2alpha.SearchRequest.FacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetSpec(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.v2alpha.SearchRequest.FacetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DynamicFacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode getMode(); + } + /** + * + * + *
+   * The specifications of dynamically generated facets.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} + */ + public static final class DynamicFacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + DynamicFacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DynamicFacetSpec.newBuilder() to construct. + private DynamicFacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DynamicFacetSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DynamicFacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DynamicFacetSpec( + 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 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder.class); + } + + /** + * + * + *
+     * Enum to control DynamicFacet mode
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + ENABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + public static final int 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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return 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 Mode findValueByNumber(int number) { + return Mode.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.v2alpha.SearchRequest.DynamicFacetSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + + 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 (mode_ + != com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + 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.v2alpha.SearchRequest.DynamicFacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) obj; + + if (mode_ != other.mode_) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The specifications of dynamically generated facets.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.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(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(this); + result.mode_ = mode_; + 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.v2alpha.SearchRequest.DynamicFacetSpec) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec other) { + if (other + == com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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.v2alpha.SearchRequest.DynamicFacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DynamicFacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicFacetSpec(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.v2alpha.SearchRequest.DynamicFacetSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List + getConditionBoostSpecsList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + int getConditionBoostSpecsCount(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index); + + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + boolean hasSkipBoostSpecValidation(); + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + boolean getSkipBoostSpecValidation(); + } + /** + * + * + *
+   * Boost specification to boost certain items.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.BoostSpec} + */ + public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + BoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostSpec.newBuilder() to construct. + private BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostSpec() { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoostSpec( + 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)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpec>(); + mutable_bitField0_ |= 0x00000001; + } + conditionBoostSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .parser(), + extensionRegistry)); + break; + } + case 16: + { + bitField0_ |= 0x00000001; + skipBoostSpecValidation_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder.class); + } + + public interface ConditionBoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + float getBoost(); + } + /** + * + * + *
+     * Boost applies to products which match a condition.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + ConditionBoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConditionBoostSpec.newBuilder() to construct. + private ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConditionBoostSpec() { + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConditionBoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConditionBoostSpec( + 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(); + + condition_ = s; + break; + } + case 21: + { + boost_ = input.readFloat(); + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private volatile java.lang.Object condition_; + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_; + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + 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(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(2, boost_); + } + 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(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); + } + 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.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec 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; + } + /** + * + * + *
+       * Boost applies to products which match a condition.
+       * 
+ * + * Protobuf type {@code + * google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.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(); + condition_ = ""; + + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(this); + result.condition_ = condition_; + result.boost_ = boost_; + 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.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec other) { + if (other + == com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + 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.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private float boost_; + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConditionBoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConditionBoostSpec(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.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_; + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public int getConditionBoostSpecsCount() { + return conditionBoostSpecs_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + return conditionBoostSpecs_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + return conditionBoostSpecs_.get(index); + } + + public static final int SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER = 2; + private boolean skipBoostSpecValidation_; + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + @java.lang.Override + public boolean hasSkipBoostSpecValidation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + @java.lang.Override + public boolean getSkipBoostSpecValidation() { + return skipBoostSpecValidation_; + } + + 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 < conditionBoostSpecs_.size(); i++) { + output.writeMessage(1, conditionBoostSpecs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(2, skipBoostSpecValidation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, conditionBoostSpecs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, skipBoostSpecValidation_); + } + 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.v2alpha.SearchRequest.BoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) obj; + + if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) return false; + if (hasSkipBoostSpecValidation() != other.hasSkipBoostSpecValidation()) return false; + if (hasSkipBoostSpecValidation()) { + if (getSkipBoostSpecValidation() != other.getSkipBoostSpecValidation()) 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 (getConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getConditionBoostSpecsList().hashCode(); + } + if (hasSkipBoostSpecValidation()) { + hash = (37 * hash) + SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipBoostSpecValidation()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec 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; + } + /** + * + * + *
+     * Boost specification to boost certain items.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.BoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConditionBoostSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conditionBoostSpecsBuilder_.clear(); + } + skipBoostSpecValidation_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (conditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionBoostSpecs_ = conditionBoostSpecs_; + } else { + result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.skipBoostSpecValidation_ = skipBoostSpecValidation_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + 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.v2alpha.SearchRequest.BoostSpec) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec other) { + if (other == com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.getDefaultInstance()) + return this; + if (conditionBoostSpecsBuilder_ == null) { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecs_.isEmpty()) { + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.addAll(other.conditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecsBuilder_.isEmpty()) { + conditionBoostSpecsBuilder_.dispose(); + conditionBoostSpecsBuilder_ = null; + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionBoostSpecsFieldBuilder() + : null; + } else { + conditionBoostSpecsBuilder_.addAllMessages(other.conditionBoostSpecs_); + } + } + } + if (other.hasSkipBoostSpecValidation()) { + setSkipBoostSpecValidation(other.getSkipBoostSpecValidation()); + } + 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.v2alpha.SearchRequest.BoostSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec>( + conditionBoostSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + conditionBoostSpecsBuilder_; + + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + if (conditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } else { + return conditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public int getConditionBoostSpecsCount() { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.size(); + } else { + return conditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addAllConditionBoostSpecs( + java.lang.Iterable< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + values) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder clearConditionBoostSpecs() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder removeConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.remove(index); + onChanged(); + } else { + conditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + if (conditionBoostSpecsBuilder_ != null) { + return conditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder() { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> + getConditionBoostSpecsBuilderList() { + return getConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsFieldBuilder() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder>( + conditionBoostSpecs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionBoostSpecs_ = null; + } + return conditionBoostSpecsBuilder_; + } + + private boolean skipBoostSpecValidation_; + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + @java.lang.Override + public boolean hasSkipBoostSpecValidation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + @java.lang.Override + public boolean getSkipBoostSpecValidation() { + return skipBoostSpecValidation_; + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @param value The skipBoostSpecValidation to set. + * @return This builder for chaining. + */ + public Builder setSkipBoostSpecValidation(boolean value) { + bitField0_ |= 0x00000002; + skipBoostSpecValidation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return This builder for chaining. + */ + public Builder clearSkipBoostSpecValidation() { + bitField0_ = (bitField0_ & ~0x00000002); + skipBoostSpecValidation_ = 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.v2alpha.SearchRequest.BoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoostSpec(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.v2alpha.SearchRequest.BoostSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + int getConditionValue(); + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition getCondition(); + + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + boolean getPinUnexpandedResults(); + } + /** + * + * + *
+   * Specification to determine under which conditions query expansion should
+   * occur.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} + */ + public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + QueryExpansionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionSpec.newBuilder() to construct. + private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionSpec() { + condition_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionSpec( + 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 8: + { + int rawValue = input.readEnum(); + + condition_ = rawValue; + break; + } + case 16: + { + pinUnexpandedResults_ = 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder.class); + } + + /** + * + * + *
+     * Enum describing under which condition query expansion should occur.
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition} + */ + public enum Condition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED(0), + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2alpha.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + AUTO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + public static final int CONDITION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2alpha.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + public static final int AUTO_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 Condition 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 Condition forNumber(int value) { + switch (value) { + case 0: + return CONDITION_UNSPECIFIED; + case 1: + return DISABLED; + case 3: + return AUTO; + 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 Condition findValueByNumber(int number) { + return Condition.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.v2alpha.SearchRequest.QueryExpansionSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Condition[] VALUES = values(); + + public static Condition 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 Condition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition) + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private int condition_; + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.valueOf( + condition_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED + : result; + } + + public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2; + private boolean pinUnexpandedResults_; + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + + 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 (condition_ + != com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, condition_); + } + if (pinUnexpandedResults_ != false) { + output.writeBool(2, pinUnexpandedResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ + != com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); + } + if (pinUnexpandedResults_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, pinUnexpandedResults_); + } + 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.v2alpha.SearchRequest.QueryExpansionSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) obj; + + if (condition_ != other.condition_) return false; + if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + condition_; + hash = (37 * hash) + PIN_UNEXPANDED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPinUnexpandedResults()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec 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; + } + /** + * + * + *
+     * Specification to determine under which conditions query expansion should
+     * occur.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.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(); + condition_ = 0; + + pinUnexpandedResults_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(this); + result.condition_ = condition_; + result.pinUnexpandedResults_ = pinUnexpandedResults_; + 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.v2alpha.SearchRequest.QueryExpansionSpec) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec other) { + if (other + == com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance()) return this; + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + if (other.getPinUnexpandedResults() != false) { + setPinUnexpandedResults(other.getPinUnexpandedResults()); + } + 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.v2alpha.SearchRequest.QueryExpansionSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int condition_ = 0; + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The enum numeric value on the wire for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionValue(int value) { + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.valueOf( + condition_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = 0; + onChanged(); + return this; + } + + private boolean pinUnexpandedResults_; + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @param value The pinUnexpandedResults to set. + * @return This builder for chaining. + */ + public Builder setPinUnexpandedResults(boolean value) { + + pinUnexpandedResults_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinUnexpandedResults() { + + pinUnexpandedResults_ = 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.v2alpha.SearchRequest.QueryExpansionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionSpec(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.v2alpha.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PersonalizationSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode getMode(); + } + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} + */ + public static final class PersonalizationSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + PersonalizationSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersonalizationSpec.newBuilder() to construct. + private PersonalizationSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersonalizationSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersonalizationSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PersonalizationSpec( + 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 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder.class); + } + + /** + * + * + *
+     * The personalization mode of each search request.
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Let CRS decide whether to use personalization.
+       * 
+ * + * AUTO = 1; + */ + AUTO(1), + /** + * + * + *
+       * Disable personalization.
+       * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Let CRS decide whether to use personalization.
+       * 
+ * + * AUTO = 1; + */ + public static final int AUTO_VALUE = 1; + /** + * + * + *
+       * Disable personalization.
+       * 
+ * + * DISABLED = 2; + */ + public static final int 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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return AUTO; + case 2: + return 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 Mode findValueByNumber(int number) { + return Mode.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.v2alpha.SearchRequest.PersonalizationSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode result = + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED + : result; + } + + 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 (mode_ + != com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + 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.v2alpha.SearchRequest.PersonalizationSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec other = + (com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) obj; + + if (mode_ != other.mode_) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.class, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.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(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec build() { + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec result = + new com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(this); + result.mode_ = mode_; + 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.v2alpha.SearchRequest.PersonalizationSpec) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec other) { + if (other + == com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + .getDefaultInstance()) return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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.v2alpha.SearchRequest.PersonalizationSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode result = + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + private static final com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersonalizationSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PersonalizationSpec(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.v2alpha.SearchRequest.PersonalizationSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PLACEMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object placement_; + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + @java.lang.Override + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + 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(); + placement_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_FIELD_NUMBER = 2; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + 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(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_INFO_FIELD_NUMBER = 5; + private com.google.cloud.retail.v2alpha.UserInfo userInfo_; + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+   * return. If unspecified, defaults to a reasonable value. The maximum allowed
+   * value is 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @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; + } + } + + public static final int OFFSET_FIELD_NUMBER = 9; + private int offset_; + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the
+   * [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
+   * relevant) in search results. This field is only considered if
+   * [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
+   * unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int FILTER_FIELD_NUMBER = 10; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANONICAL_FILTER_FIELD_NUMBER = 28; + private volatile java.lang.Object canonicalFilter_; + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + @java.lang.Override + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + 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(); + canonicalFilter_ = s; + return s; + } + } + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 11; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FACET_SPECS_FIELD_NUMBER = 12; + private java.util.List facetSpecs_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List + getFacetSpecsList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List + getFacetSpecsOrBuilderList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public int getFacetSpecsCount() { + return facetSpecs_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpecs(int index) { + return facetSpecs_.get(index); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + return facetSpecs_.get(index); + } + + public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 21; + private com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpec_ != null; + } + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return The dynamicFacetSpec. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + return getDynamicFacetSpec(); + } + + public static final int BOOST_SPEC_FIELD_NUMBER = 13; + private com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec boostSpec_; + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + @java.lang.Override + public boolean hasBoostSpec() { + return boostSpec_ != null; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec getBoostSpec() { + return boostSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() { + return getBoostSpec(); + } + + public static final int QUERY_EXPANSION_SPEC_FIELD_NUMBER = 14; + private com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionSpec() { + return queryExpansionSpec_ != null; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + return getQueryExpansionSpec(); + } + + public static final int RELEVANCE_THRESHOLD_FIELD_NUMBER = 15; + private int relevanceThreshold_; + /** + * + * + *
+   * The relevance threshold of the search results.
+   * Defaults to
+   * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+   * which means only the most relevant results are shown, and the least number
+   * of results are returned. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The enum numeric value on the wire for relevanceThreshold. + */ + @java.lang.Override + public int getRelevanceThresholdValue() { + return relevanceThreshold_; + } + /** + * + * + *
+   * The relevance threshold of the search results.
+   * Defaults to
+   * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+   * which means only the most relevant results are shown, and the least number
+   * of results are returned. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The relevanceThreshold. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold getRelevanceThreshold() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold result = + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.valueOf( + relevanceThreshold_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.UNRECOGNIZED + : result; + } + + public static final int VARIANT_ROLLUP_KEYS_FIELD_NUMBER = 17; + private com.google.protobuf.LazyStringList variantRollupKeys_; + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_; + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 23; + private com.google.protobuf.LazyStringList pageCategories_; + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + + public static final int SEARCH_MODE_FIELD_NUMBER = 31; + private int searchMode_; + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.SearchMode getSearchMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.SearchMode result = + com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.valueOf(searchMode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.UNRECOGNIZED + : result; + } + + public static final int PERSONALIZATION_SPEC_FIELD_NUMBER = 32; + private com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalizationSpec_; + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + @java.lang.Override + public boolean hasPersonalizationSpec() { + return personalizationSpec_ != null; + } + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return The personalizationSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + getPersonalizationSpec() { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder() { + return getPersonalizationSpec(); + } + + 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(placement_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, visitorId_); + } + if (userInfo_ != null) { + output.writeMessage(5, getUserInfo()); + } + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (offset_ != 0) { + output.writeInt32(9, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + output.writeMessage(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + output.writeMessage(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + output.writeMessage(14, getQueryExpansionSpec()); + } + if (relevanceThreshold_ + != com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold + .RELEVANCE_THRESHOLD_UNSPECIFIED + .getNumber()) { + output.writeEnum(15, relevanceThreshold_); + } + for (int i = 0; i < variantRollupKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, variantRollupKeys_.getRaw(i)); + } + if (dynamicFacetSpec_ != null) { + output.writeMessage(21, getDynamicFacetSpec()); + } + for (int i = 0; i < pageCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 23, pageCategories_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, canonicalFilter_); + } + if (searchMode_ + != com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(31, searchMode_); + } + if (personalizationSpec_ != null) { + output.writeMessage(32, getPersonalizationSpec()); + } + 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(placement_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, visitorId_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUserInfo()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionSpec()); + } + if (relevanceThreshold_ + != com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold + .RELEVANCE_THRESHOLD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, relevanceThreshold_); + } + { + int dataSize = 0; + for (int i = 0; i < variantRollupKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(variantRollupKeys_.getRaw(i)); + } + size += dataSize; + size += 2 * getVariantRollupKeysList().size(); + } + if (dynamicFacetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getDynamicFacetSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < pageCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); + } + size += dataSize; + size += 2 * getPageCategoriesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(28, canonicalFilter_); + } + if (searchMode_ + != com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(31, searchMode_); + } + if (personalizationSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(32, getPersonalizationSpec()); + } + 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.v2alpha.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchRequest other = + (com.google.cloud.retail.v2alpha.SearchRequest) obj; + + if (!getPlacement().equals(other.getPlacement())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getCanonicalFilter().equals(other.getCanonicalFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false; + if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false; + if (hasDynamicFacetSpec()) { + if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false; + } + if (hasBoostSpec() != other.hasBoostSpec()) return false; + if (hasBoostSpec()) { + if (!getBoostSpec().equals(other.getBoostSpec())) return false; + } + if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; + if (hasQueryExpansionSpec()) { + if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + } + if (relevanceThreshold_ != other.relevanceThreshold_) return false; + if (!getVariantRollupKeysList().equals(other.getVariantRollupKeysList())) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (searchMode_ != other.searchMode_) return false; + if (hasPersonalizationSpec() != other.hasPersonalizationSpec()) return false; + if (hasPersonalizationSpec()) { + if (!getPersonalizationSpec().equals(other.getPersonalizationSpec())) 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) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().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 = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + CANONICAL_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (getFacetSpecsCount() > 0) { + hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpecsList().hashCode(); + } + if (hasDynamicFacetSpec()) { + hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getDynamicFacetSpec().hashCode(); + } + if (hasBoostSpec()) { + hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getBoostSpec().hashCode(); + } + if (hasQueryExpansionSpec()) { + hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + } + hash = (37 * hash) + RELEVANCE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + relevanceThreshold_; + if (getVariantRollupKeysCount() > 0) { + hash = (37 * hash) + VARIANT_ROLLUP_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getVariantRollupKeysList().hashCode(); + } + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + hash = (37 * hash) + SEARCH_MODE_FIELD_NUMBER; + hash = (53 * hash) + searchMode_; + if (hasPersonalizationSpec()) { + hash = (37 * hash) + PERSONALIZATION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getPersonalizationSpec().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.SearchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchRequest) + com.google.cloud.retail.v2alpha.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchRequest.class, + com.google.cloud.retail.v2alpha.SearchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFacetSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + placement_ = ""; + + branch_ = ""; + + query_ = ""; + + visitorId_ = ""; + + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + offset_ = 0; + + filter_ = ""; + + canonicalFilter_ = ""; + + orderBy_ = ""; + + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + facetSpecsBuilder_.clear(); + } + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + relevanceThreshold_ = 0; + + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + searchMode_ = 0; + + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest build() { + com.google.cloud.retail.v2alpha.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest buildPartial() { + com.google.cloud.retail.v2alpha.SearchRequest result = + new com.google.cloud.retail.v2alpha.SearchRequest(this); + int from_bitField0_ = bitField0_; + result.placement_ = placement_; + result.branch_ = branch_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.offset_ = offset_; + result.filter_ = filter_; + result.canonicalFilter_ = canonicalFilter_; + result.orderBy_ = orderBy_; + if (facetSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.facetSpecs_ = facetSpecs_; + } else { + result.facetSpecs_ = facetSpecsBuilder_.build(); + } + if (dynamicFacetSpecBuilder_ == null) { + result.dynamicFacetSpec_ = dynamicFacetSpec_; + } else { + result.dynamicFacetSpec_ = dynamicFacetSpecBuilder_.build(); + } + if (boostSpecBuilder_ == null) { + result.boostSpec_ = boostSpec_; + } else { + result.boostSpec_ = boostSpecBuilder_.build(); + } + if (queryExpansionSpecBuilder_ == null) { + result.queryExpansionSpec_ = queryExpansionSpec_; + } else { + result.queryExpansionSpec_ = queryExpansionSpecBuilder_.build(); + } + result.relevanceThreshold_ = relevanceThreshold_; + if (((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.variantRollupKeys_ = variantRollupKeys_; + if (((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pageCategories_ = pageCategories_; + result.searchMode_ = searchMode_; + if (personalizationSpecBuilder_ == null) { + result.personalizationSpec_ = personalizationSpec_; + } else { + result.personalizationSpec_ = personalizationSpecBuilder_.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.v2alpha.SearchRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchRequest other) { + if (other == com.google.cloud.retail.v2alpha.SearchRequest.getDefaultInstance()) return this; + if (!other.getPlacement().isEmpty()) { + placement_ = other.placement_; + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getCanonicalFilter().isEmpty()) { + canonicalFilter_ = other.canonicalFilter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (facetSpecsBuilder_ == null) { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecs_.isEmpty()) { + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFacetSpecsIsMutable(); + facetSpecs_.addAll(other.facetSpecs_); + } + onChanged(); + } + } else { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecsBuilder_.isEmpty()) { + facetSpecsBuilder_.dispose(); + facetSpecsBuilder_ = null; + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + facetSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetSpecsFieldBuilder() + : null; + } else { + facetSpecsBuilder_.addAllMessages(other.facetSpecs_); + } + } + } + if (other.hasDynamicFacetSpec()) { + mergeDynamicFacetSpec(other.getDynamicFacetSpec()); + } + if (other.hasBoostSpec()) { + mergeBoostSpec(other.getBoostSpec()); + } + if (other.hasQueryExpansionSpec()) { + mergeQueryExpansionSpec(other.getQueryExpansionSpec()); + } + if (other.relevanceThreshold_ != 0) { + setRelevanceThresholdValue(other.getRelevanceThresholdValue()); + } + if (!other.variantRollupKeys_.isEmpty()) { + if (variantRollupKeys_.isEmpty()) { + variantRollupKeys_ = other.variantRollupKeys_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.addAll(other.variantRollupKeys_); + } + onChanged(); + } + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + if (other.searchMode_ != 0) { + setSearchModeValue(other.getSearchModeValue()); + } + if (other.hasPersonalizationSpec()) { + mergePersonalizationSpec(other.getPersonalizationSpec()); + } + 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.v2alpha.SearchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.SearchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placement_ = ""; + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placement to set. + * @return This builder for chaining. + */ + public Builder setPlacement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placement_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlacement() { + + placement_ = getDefaultInstance().getPlacement(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for placement to set. + * @return This builder for chaining. + */ + public Builder setPlacementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placement_ = value; + onChanged(); + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return The userInfo. + */ + public com.google.cloud.retail.v2alpha.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2alpha.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public Builder mergeUserInfo(com.google.cloud.retail.v2alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.retail.v2alpha.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2alpha.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + + private int offset_; + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
+     * unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
+     * unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
+     * unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object canonicalFilter_ = ""; + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalFilter() { + + canonicalFilter_ = getDefaultInstance().getCanonicalFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The bytes for canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalFilter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.util.List facetSpecs_ = + java.util.Collections.emptyList(); + + private void ensureFacetSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList( + facetSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder> + facetSpecsBuilder_; + + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsList() { + if (facetSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facetSpecs_); + } else { + return facetSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public int getFacetSpecsCount() { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.size(); + } else { + return facetSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, value); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs(com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addAllFacetSpecs( + java.lang.Iterable + values) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_); + onChanged(); + } else { + facetSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder clearFacetSpecs() { + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + facetSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder removeFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.remove(index); + onChanged(); + } else { + facetSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder getFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsOrBuilderList() { + if (facetSpecsBuilder_ != null) { + return facetSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facetSpecs_); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder() { + return getFacetSpecsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsBuilderList() { + return getFacetSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsFieldBuilder() { + if (facetSpecsBuilder_ == null) { + facetSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder>( + facetSpecs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + facetSpecs_ = null; + } + return facetSpecsBuilder_; + } + + private com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder> + dynamicFacetSpecBuilder_; + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Deprecated + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpecBuilder_ != null || dynamicFacetSpec_ != null; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return The dynamicFacetSpec. + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } else { + return dynamicFacetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicFacetSpec_ = value; + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder builderForValue) { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = builderForValue.build(); + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (dynamicFacetSpec_ != null) { + dynamicFacetSpec_ = + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.newBuilder( + dynamicFacetSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + dynamicFacetSpec_ = value; + } + onChanged(); + } else { + dynamicFacetSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + onChanged(); + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder + getDynamicFacetSpecBuilder() { + + onChanged(); + return getDynamicFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + if (dynamicFacetSpecBuilder_ != null) { + return dynamicFacetSpecBuilder_.getMessageOrBuilder(); + } else { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder> + getDynamicFacetSpecFieldBuilder() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder>( + getDynamicFacetSpec(), getParentForChildren(), isClean()); + dynamicFacetSpec_ = null; + } + return dynamicFacetSpecBuilder_; + } + + private com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec boostSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder> + boostSpecBuilder_; + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + public boolean hasBoostSpec() { + return boostSpecBuilder_ != null || boostSpec_ != null; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec getBoostSpec() { + if (boostSpecBuilder_ == null) { + return boostSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } else { + return boostSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec(com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boostSpec_ = value; + onChanged(); + } else { + boostSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder builderForValue) { + if (boostSpecBuilder_ == null) { + boostSpec_ = builderForValue.build(); + onChanged(); + } else { + boostSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder mergeBoostSpec(com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (boostSpec_ != null) { + boostSpec_ = + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.newBuilder(boostSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + boostSpec_ = value; + } + onChanged(); + } else { + boostSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder clearBoostSpec() { + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + onChanged(); + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder getBoostSpecBuilder() { + + onChanged(); + return getBoostSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder + getBoostSpecOrBuilder() { + if (boostSpecBuilder_ != null) { + return boostSpecBuilder_.getMessageOrBuilder(); + } else { + return boostSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder> + getBoostSpecFieldBuilder() { + if (boostSpecBuilder_ == null) { + boostSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder>( + getBoostSpec(), getParentForChildren(), isClean()); + boostSpec_ = null; + } + return boostSpecBuilder_; + } + + private com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder> + queryExpansionSpecBuilder_; + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + public boolean hasQueryExpansionSpec() { + return queryExpansionSpecBuilder_ != null || queryExpansionSpec_ != null; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + getQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } else { + return queryExpansionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionSpec_ = value; + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder builderForValue) { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder mergeQueryExpansionSpec( + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (queryExpansionSpec_ != null) { + queryExpansionSpec_ = + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.newBuilder( + queryExpansionSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionSpec_ = value; + } + onChanged(); + } else { + queryExpansionSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder clearQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + onChanged(); + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder + getQueryExpansionSpecBuilder() { + + onChanged(); + return getQueryExpansionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + if (queryExpansionSpecBuilder_ != null) { + return queryExpansionSpecBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder> + getQueryExpansionSpecFieldBuilder() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder>( + getQueryExpansionSpec(), getParentForChildren(), isClean()); + queryExpansionSpec_ = null; + } + return queryExpansionSpecBuilder_; + } + + private int relevanceThreshold_ = 0; + /** + * + * + *
+     * The relevance threshold of the search results.
+     * Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+     * which means only the most relevant results are shown, and the least number
+     * of results are returned. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The enum numeric value on the wire for relevanceThreshold. + */ + @java.lang.Override + public int getRelevanceThresholdValue() { + return relevanceThreshold_; + } + /** + * + * + *
+     * The relevance threshold of the search results.
+     * Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+     * which means only the most relevant results are shown, and the least number
+     * of results are returned. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @param value The enum numeric value on the wire for relevanceThreshold to set. + * @return This builder for chaining. + */ + public Builder setRelevanceThresholdValue(int value) { + + relevanceThreshold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relevance threshold of the search results.
+     * Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+     * which means only the most relevant results are shown, and the least number
+     * of results are returned. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The relevanceThreshold. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold + getRelevanceThreshold() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold result = + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.valueOf( + relevanceThreshold_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The relevance threshold of the search results.
+     * Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+     * which means only the most relevant results are shown, and the least number
+     * of results are returned. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @param value The relevanceThreshold to set. + * @return This builder for chaining. + */ + public Builder setRelevanceThreshold( + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold value) { + if (value == null) { + throw new NullPointerException(); + } + + relevanceThreshold_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relevance threshold of the search results.
+     * Defaults to
+     * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+     * which means only the most relevant results are shown, and the least number
+     * of results are returned. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return This builder for chaining. + */ + public Builder clearRelevanceThreshold() { + + relevanceThreshold_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList variantRollupKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVariantRollupKeysIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(variantRollupKeys_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index to set the value at. + * @param value The variantRollupKeys to set. + * @return This builder for chaining. + */ + public Builder setVariantRollupKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param values The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addAllVariantRollupKeys(java.lang.Iterable values) { + ensureVariantRollupKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variantRollupKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return This builder for chaining. + */ + public Builder clearVariantRollupKeys() { + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s or
+     * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+     * and de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+     * for
+     * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The bytes of the variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pageCategories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_.getUnmodifiableView(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index to set the value at. + * @param value The pageCategories to set. + * @return This builder for chaining. + */ + public Builder setPageCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param values The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addAllPageCategories(java.lang.Iterable values) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return This builder for chaining. + */ + public Builder clearPageCategories() { + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * the same as
+     * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The bytes of the pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + + private int searchMode_ = 0; + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @param value The enum numeric value on the wire for searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchModeValue(int value) { + + searchMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.SearchMode getSearchMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SearchRequest.SearchMode result = + com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.valueOf(searchMode_); + return result == null + ? com.google.cloud.retail.v2alpha.SearchRequest.SearchMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @param value The searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchMode(com.google.cloud.retail.v2alpha.SearchRequest.SearchMode value) { + if (value == null) { + throw new NullPointerException(); + } + + searchMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return This builder for chaining. + */ + public Builder clearSearchMode() { + + searchMode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalizationSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder> + personalizationSpecBuilder_; + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + public boolean hasPersonalizationSpec() { + return personalizationSpecBuilder_ != null || personalizationSpec_ != null; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return The personalizationSpec. + */ + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + getPersonalizationSpec() { + if (personalizationSpecBuilder_ == null) { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } else { + return personalizationSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public Builder setPersonalizationSpec( + com.google.cloud.retail.v2alpha.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.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public Builder setPersonalizationSpec( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder builderForValue) { + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = builderForValue.build(); + onChanged(); + } else { + personalizationSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public Builder mergePersonalizationSpec( + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec value) { + if (personalizationSpecBuilder_ == null) { + if (personalizationSpec_ != null) { + personalizationSpec_ = + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.newBuilder( + personalizationSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + personalizationSpec_ = value; + } + onChanged(); + } else { + personalizationSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public Builder clearPersonalizationSpec() { + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + onChanged(); + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder + getPersonalizationSpecBuilder() { + + onChanged(); + return getPersonalizationSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder() { + if (personalizationSpecBuilder_ != null) { + return personalizationSpecBuilder_.getMessageOrBuilder(); + } else { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder> + getPersonalizationSpecFieldBuilder() { + if (personalizationSpecBuilder_ == null) { + personalizationSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder>( + getPersonalizationSpec(), getParentForChildren(), isClean()); + personalizationSpec_ = null; + } + return personalizationSpecBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchRequest) + private static final com.google.cloud.retail.v2alpha.SearchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchRequest(); + } + + public static com.google.cloud.retail.v2alpha.SearchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchRequest(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.v2alpha.SearchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequestOrBuilder.java new file mode 100644 index 00000000..654314dd --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchRequestOrBuilder.java @@ -0,0 +1,1130 @@ +/* + * 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/v2alpha/search_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SearchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + java.lang.String getPlacement(); + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + com.google.protobuf.ByteString getPlacementBytes(); + + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + * + * @return The userInfo. + */ + com.google.cloud.retail.v2alpha.UserInfo getUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 5; + */ + com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
+   * return. If unspecified, defaults to a reasonable value. The maximum allowed
+   * value is 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the
+   * [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
+   * relevant) in search results. This field is only considered if
+   * [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
+   * unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + java.lang.String getCanonicalFilter(); + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + com.google.protobuf.ByteString getCanonicalFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List getFacetSpecsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpec getFacetSpecs(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + int getFacetSpecsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List + getFacetSpecsOrBuilderList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index); + + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Deprecated + boolean hasDynamicFacetSpec(); + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2alpha/search_service.proto;l=536 + * @return The dynamicFacetSpec. + */ + @java.lang.Deprecated + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec(); + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder(); + + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + boolean hasBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec getBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.BoostSpec boost_spec = 13; + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder(); + + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + boolean hasQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec getQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder(); + + /** + * + * + *
+   * The relevance threshold of the search results.
+   * Defaults to
+   * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+   * which means only the most relevant results are shown, and the least number
+   * of results are returned. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The enum numeric value on the wire for relevanceThreshold. + */ + int getRelevanceThresholdValue(); + /** + * + * + *
+   * The relevance threshold of the search results.
+   * Defaults to
+   * [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
+   * which means only the most relevant results are shown, and the least number
+   * of results are returned. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold relevance_threshold = 15; + * + * + * @return The relevanceThreshold. + */ + com.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold getRelevanceThreshold(); + + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + java.util.List getVariantRollupKeysList(); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + int getVariantRollupKeysCount(); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + java.lang.String getVariantRollupKeys(int index); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2alpha.Product]s or
+   * [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged
+   * and de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
+   * for
+   * [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + com.google.protobuf.ByteString getVariantRollupKeysBytes(int index); + + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + java.util.List getPageCategoriesList(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + int getPageCategoriesCount(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + java.lang.String getPageCategories(int index); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * the same as
+   * [UserEvent.page_categories][google.cloud.retail.v2alpha.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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + com.google.protobuf.ByteString getPageCategoriesBytes(int index); + + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + int getSearchModeValue(); + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + com.google.cloud.retail.v2alpha.SearchRequest.SearchMode getSearchMode(); + + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + boolean hasPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return The personalizationSpec. + */ + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec getPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponse.java new file mode 100644 index 00000000..19a8343c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponse.java @@ -0,0 +1,9549 @@ +/* + * 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/v2alpha/search_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response message for
+ * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse} + */ +public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchResponse) + SearchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResponse.newBuilder() to construct. + private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResponse() { + results_ = java.util.Collections.emptyList(); + facets_ = java.util.Collections.emptyList(); + correctedQuery_ = ""; + attributionToken_ = ""; + nextPageToken_ = ""; + redirectUri_ = ""; + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResponse( + 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)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + facets_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.parser(), + extensionRegistry)); + break; + } + case 24: + { + totalSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedQuery_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 58: + { + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder subBuilder = + null; + if (queryExpansionInfo_ != null) { + subBuilder = queryExpansionInfo_.toBuilder(); + } + queryExpansionInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionInfo_); + queryExpansionInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + redirectUri_ = s; + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + appliedControls_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + appliedControls_.add(s); + break; + } + case 114: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpec>(); + mutable_bitField0_ |= 0x00000008; + } + invalidConditionBoostSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .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)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + appliedControls_ = appliedControls_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.class, + com.google.cloud.retail.v2alpha.SearchResponse.Builder.class); + } + + public interface SearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchResponse.SearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return The product. + */ + com.google.cloud.retail.v2alpha.Product getProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + int getMatchingVariantCount(); + + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + int getMatchingVariantFieldsCount(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + boolean containsMatchingVariantFields(java.lang.String key); + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMatchingVariantFields(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + java.util.Map getMatchingVariantFieldsMap(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + + /* nullable */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.FieldMask defaultValue); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key); + + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + int getVariantRollupValuesCount(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + boolean containsVariantRollupValues(java.lang.String key); + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getVariantRollupValues(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + java.util.Map getVariantRollupValuesMap(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + + /* nullable */ + com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents the search results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.SearchResult} + */ + public static final class SearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchResponse.SearchResult) + SearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResult.newBuilder() to construct. + private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResult( + 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(); + + id_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + matchingVariantCount_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + matchingVariantFields__ = + input.readMessage( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + matchingVariantFields_ + .getMutableMap() + .put(matchingVariantFields__.getKey(), matchingVariantFields__.getValue()); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + variantRollupValues__ = + input.readMessage( + VariantRollupValuesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + variantRollupValues_ + .getMutableMap() + .put(variantRollupValues__.getKey(), variantRollupValues__.getValue()); + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+     * [Product][google.cloud.retail.v2alpha.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.Product product_; + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int MATCHING_VARIANT_COUNT_FIELD_NUMBER = 3; + private int matchingVariantCount_; + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + + public static final int MATCHING_VARIANT_FIELDS_FIELD_NUMBER = 4; + + private static final class MatchingVariantFieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.FieldMask.getDefaultInstance()); + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int VARIANT_ROLLUP_VALUES_FIELD_NUMBER = 5; + + private static final class VariantRollupValuesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+     * the rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + output.writeInt32(3, matchingVariantCount_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetMatchingVariantFields(), + MatchingVariantFieldsDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetVariantRollupValues(), + VariantRollupValuesDefaultEntryHolder.defaultEntry, + 5); + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, matchingVariantCount_); + } + for (java.util.Map.Entry entry : + internalGetMatchingVariantFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + matchingVariantFields__ = + MatchingVariantFieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, matchingVariantFields__); + } + for (java.util.Map.Entry entry : + internalGetVariantRollupValues().getMap().entrySet()) { + com.google.protobuf.MapEntry + variantRollupValues__ = + VariantRollupValuesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, variantRollupValues__); + } + 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.v2alpha.SearchResponse.SearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult other = + (com.google.cloud.retail.v2alpha.SearchResponse.SearchResult) obj; + + if (!getId().equals(other.getId())) return false; + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (getMatchingVariantCount() != other.getMatchingVariantCount()) return false; + if (!internalGetMatchingVariantFields().equals(other.internalGetMatchingVariantFields())) + return false; + if (!internalGetVariantRollupValues().equals(other.internalGetVariantRollupValues())) + 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + MATCHING_VARIANT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMatchingVariantCount(); + if (!internalGetMatchingVariantFields().getMap().isEmpty()) { + hash = (37 * hash) + MATCHING_VARIANT_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMatchingVariantFields().hashCode(); + } + if (!internalGetVariantRollupValues().getMap().isEmpty()) { + hash = (37 * hash) + VARIANT_ROLLUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + internalGetVariantRollupValues().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult 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 the search results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.SearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchResponse.SearchResult) + com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableMatchingVariantFields(); + case 5: + return internalGetMutableVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.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(); + id_ = ""; + + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + matchingVariantCount_ = 0; + + internalGetMutableMatchingVariantFields().clear(); + internalGetMutableVariantRollupValues().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult build() { + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult buildPartial() { + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult result = + new com.google.cloud.retail.v2alpha.SearchResponse.SearchResult(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.matchingVariantCount_ = matchingVariantCount_; + result.matchingVariantFields_ = internalGetMatchingVariantFields(); + result.matchingVariantFields_.makeImmutable(); + result.variantRollupValues_ = internalGetVariantRollupValues(); + result.variantRollupValues_.makeImmutable(); + 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.v2alpha.SearchResponse.SearchResult) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchResponse.SearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchResponse.SearchResult other) { + if (other + == com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.getMatchingVariantCount() != 0) { + setMatchingVariantCount(other.getMatchingVariantCount()); + } + internalGetMutableMatchingVariantFields() + .mergeFrom(other.internalGetMatchingVariantFields()); + internalGetMutableVariantRollupValues().mergeFrom(other.internalGetVariantRollupValues()); + 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.v2alpha.SearchResponse.SearchResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchResponse.SearchResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+       * [Product][google.cloud.retail.v2alpha.Product].
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+       * [Product][google.cloud.retail.v2alpha.Product].
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+       * [Product][google.cloud.retail.v2alpha.Product].
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+       * [Product][google.cloud.retail.v2alpha.Product].
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
+       * [Product][google.cloud.retail.v2alpha.Product].
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + * + * @return The product. + */ + public com.google.cloud.retail.v2alpha.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2alpha.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2alpha.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private int matchingVariantCount_; + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @param value The matchingVariantCount to set. + * @return This builder for chaining. + */ + public Builder setMatchingVariantCount(int value) { + + matchingVariantCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMatchingVariantCount() { + + matchingVariantCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + private com.google.protobuf.MapField + internalGetMutableMatchingVariantFields() { + onChanged(); + ; + if (matchingVariantFields_ == null) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + if (!matchingVariantFields_.isMutable()) { + matchingVariantFields_ = matchingVariantFields_.copy(); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMatchingVariantFields() { + internalGetMutableMatchingVariantFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder removeMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMatchingVariantFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableMatchingVariantFields() { + return internalGetMutableMatchingVariantFields().getMutableMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putMatchingVariantFields( + java.lang.String key, com.google.protobuf.FieldMask value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableMatchingVariantFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2alpha.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putAllMatchingVariantFields( + java.util.Map values) { + internalGetMutableMatchingVariantFields().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + private com.google.protobuf.MapField + internalGetMutableVariantRollupValues() { + onChanged(); + ; + if (variantRollupValues_ == null) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + if (!variantRollupValues_.isMutable()) { + variantRollupValues_ = variantRollupValues_.copy(); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map + getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearVariantRollupValues() { + internalGetMutableVariantRollupValues().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder removeVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableVariantRollupValues().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableVariantRollupValues() { + return internalGetMutableVariantRollupValues().getMutableMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putVariantRollupValues(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableVariantRollupValues().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that
+       * the rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putAllVariantRollupValues( + java.util.Map values) { + internalGetMutableVariantRollupValues().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchResponse.SearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchResponse.SearchResult) + private static final com.google.cloud.retail.v2alpha.SearchResponse.SearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchResponse.SearchResult(); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.SearchResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResult(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.v2alpha.SearchResponse.SearchResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FacetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchResponse.Facet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List getValuesList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue getValues(int index); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + int getValuesCount(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index); + + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + boolean getDynamicFacet(); + } + /** + * + * + *
+   * A facet result.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.Facet} + */ + public static final class Facet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchResponse.Facet) + FacetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Facet.newBuilder() to construct. + private Facet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Facet() { + key_ = ""; + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Facet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Facet( + 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(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue>(); + mutable_bitField0_ |= 0x00000001; + } + values_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.parser(), + extensionRegistry)); + break; + } + case 24: + { + dynamicFacet_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.class, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder.class); + } + + public interface FacetValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return The interval. + */ + com.google.cloud.retail.v2alpha.Interval getInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + long getCount(); + + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.FacetValueCase + getFacetValueCase(); + } + /** + * + * + *
+     * A facet value which contains value names and their count.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} + */ + public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + FacetValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetValue.newBuilder() to construct. + private FacetValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetValue( + 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(); + facetValueCase_ = 1; + facetValue_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.Interval.Builder subBuilder = null; + if (facetValueCase_ == 2) { + subBuilder = + ((com.google.cloud.retail.v2alpha.Interval) facetValue_).toBuilder(); + } + facetValue_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.Interval) facetValue_); + facetValue_ = subBuilder.buildPartial(); + } + facetValueCase_ = 2; + break; + } + case 24: + { + count_ = input.readInt64(); + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder.class); + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public enum FacetValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALUE(1), + INTERVAL(2), + FACETVALUE_NOT_SET(0); + private final int value; + + private FacetValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FacetValueCase valueOf(int value) { + return forNumber(value); + } + + public static FacetValueCase forNumber(int value) { + switch (value) { + case 1: + return VALUE; + case 2: + return INTERVAL; + case 0: + return FACETVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public static final int VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + 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(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 2; + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getInterval() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Interval) facetValue_; + } + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalOrBuilder() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Interval) facetValue_; + } + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + + public static final int COUNT_FIELD_NUMBER = 3; + private long count_; + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + 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 (facetValueCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetValue_); + } + if (facetValueCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2alpha.Interval) facetValue_); + } + if (count_ != 0L) { + output.writeInt64(3, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetValueCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetValue_); + } + if (facetValueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2alpha.Interval) facetValue_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); + } + 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.v2alpha.SearchResponse.Facet.FacetValue)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue other = + (com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) obj; + + if (getCount() != other.getCount()) return false; + if (!getFacetValueCase().equals(other.getFacetValueCase())) return false; + switch (facetValueCase_) { + case 1: + if (!getValue().equals(other.getValue())) return false; + break; + case 2: + if (!getInterval().equals(other.getInterval())) return false; + break; + case 0: + default: + } + 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + switch (facetValueCase_) { + case 1: + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + break; + case 2: + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue 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; + } + /** + * + * + *
+       * A facet value which contains value names and their count.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.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(); + count_ = 0L; + + facetValueCase_ = 0; + facetValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue build() { + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue buildPartial() { + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue result = + new com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(this); + if (facetValueCase_ == 1) { + result.facetValue_ = facetValue_; + } + if (facetValueCase_ == 2) { + if (intervalBuilder_ == null) { + result.facetValue_ = facetValue_; + } else { + result.facetValue_ = intervalBuilder_.build(); + } + } + result.count_ = count_; + result.facetValueCase_ = facetValueCase_; + 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.v2alpha.SearchResponse.Facet.FacetValue) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue other) { + if (other + == com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance()) return this; + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + switch (other.getFacetValueCase()) { + case VALUE: + { + facetValueCase_ = 1; + facetValue_ = other.facetValue_; + onChanged(); + break; + } + case INTERVAL: + { + mergeInterval(other.getInterval()); + break; + } + case FACETVALUE_NOT_SET: + { + break; + } + } + 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.v2alpha.SearchResponse.Facet.FacetValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public Builder clearFacetValue() { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + if (facetValueCase_ == 1) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Interval getInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Interval) facetValue_; + } + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } else { + if (facetValueCase_ == 2) { + return intervalBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.retail.v2alpha.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetValue_ = value; + onChanged(); + } else { + intervalBuilder_.setMessage(value); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + public Builder setInterval( + com.google.cloud.retail.v2alpha.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + facetValue_ = builderForValue.build(); + onChanged(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + public Builder mergeInterval(com.google.cloud.retail.v2alpha.Interval value) { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2 + && facetValue_ != com.google.cloud.retail.v2alpha.Interval.getDefaultInstance()) { + facetValue_ = + com.google.cloud.retail.v2alpha.Interval.newBuilder( + (com.google.cloud.retail.v2alpha.Interval) facetValue_) + .mergeFrom(value) + .buildPartial(); + } else { + facetValue_ = value; + } + onChanged(); + } else { + if (facetValueCase_ == 2) { + intervalBuilder_.mergeFrom(value); + } else { + intervalBuilder_.setMessage(value); + } + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + public Builder clearInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + } else { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + } + intervalBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + public com.google.cloud.retail.v2alpha.Interval.Builder getIntervalBuilder() { + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.IntervalOrBuilder getIntervalOrBuilder() { + if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2alpha.Interval) facetValue_; + } + return com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2alpha.Interval interval = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + if (!(facetValueCase_ == 2)) { + facetValue_ = com.google.cloud.retail.v2alpha.Interval.getDefaultInstance(); + } + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Interval, + com.google.cloud.retail.v2alpha.Interval.Builder, + com.google.cloud.retail.v2alpha.IntervalOrBuilder>( + (com.google.cloud.retail.v2alpha.Interval) facetValue_, + getParentForChildren(), + isClean()); + facetValue_ = null; + } + facetValueCase_ = 2; + onChanged(); + ; + return intervalBuilder_; + } + + private long count_; + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) + private static final com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetValue(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.v2alpha.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 2; + private java.util.List values_; + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List + getValuesList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + return values_.get(index); + } + + public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; + private boolean dynamicFacet_; + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + + 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + output.writeBool(3, dynamicFacet_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dynamicFacet_); + } + 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.v2alpha.SearchResponse.Facet)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchResponse.Facet other = + (com.google.cloud.retail.v2alpha.SearchResponse.Facet) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (getDynamicFacet() != other.getDynamicFacet()) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (37 * hash) + DYNAMIC_FACET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDynamicFacet()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.Facet 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; + } + /** + * + * + *
+     * A facet result.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.Facet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchResponse.Facet) + com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.class, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchResponse.Facet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + valuesBuilder_.clear(); + } + dynamicFacet_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchResponse.Facet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet build() { + com.google.cloud.retail.v2alpha.SearchResponse.Facet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet buildPartial() { + com.google.cloud.retail.v2alpha.SearchResponse.Facet result = + new com.google.cloud.retail.v2alpha.SearchResponse.Facet(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + result.dynamicFacet_ = dynamicFacet_; + 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.v2alpha.SearchResponse.Facet) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchResponse.Facet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchResponse.Facet other) { + if (other == com.google.cloud.retail.v2alpha.SearchResponse.Facet.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getDynamicFacet() != false) { + setDynamicFacet(other.getDynamicFacet()); + } + 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.v2alpha.SearchResponse.Facet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchResponse.Facet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List + values_ = java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue>(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List + getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addAllValues( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue> + values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder + getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + private boolean dynamicFacet_; + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @param value The dynamicFacet to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacet(boolean value) { + + dynamicFacet_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacet() { + + dynamicFacet_ = 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.v2alpha.SearchResponse.Facet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchResponse.Facet) + private static final com.google.cloud.retail.v2alpha.SearchResponse.Facet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchResponse.Facet(); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.Facet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Facet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Facet(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.v2alpha.SearchResponse.Facet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + boolean getExpandedQuery(); + + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + long getPinnedResultCount(); + } + /** + * + * + *
+   * Information describing query expansion including whether expansion has
+   * occurred.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + QueryExpansionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionInfo.newBuilder() to construct. + private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionInfo( + 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 8: + { + expandedQuery_ = input.readBool(); + break; + } + case 16: + { + pinnedResultCount_ = input.readInt64(); + 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.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder.class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_; + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + + public static final int PINNED_RESULT_COUNT_FIELD_NUMBER = 2; + private long pinnedResultCount_; + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + + 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 (expandedQuery_ != false) { + output.writeBool(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + output.writeInt64(2, pinnedResultCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expandedQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pinnedResultCount_); + } + 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.v2alpha.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (getPinnedResultCount() != other.getPinnedResultCount()) 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) + EXPANDED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); + hash = (37 * hash) + PINNED_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPinnedResultCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo 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; + } + /** + * + * + *
+     * Information describing query expansion including whether expansion has
+     * occurred.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.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(); + expandedQuery_ = false; + + pinnedResultCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo buildPartial() { + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(this); + result.expandedQuery_ = expandedQuery_; + result.pinnedResultCount_ = pinnedResultCount_; + 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.v2alpha.SearchResponse.QueryExpansionInfo) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); + } + if (other.getPinnedResultCount() != 0L) { + setPinnedResultCount(other.getPinnedResultCount()); + } + 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.v2alpha.SearchResponse.QueryExpansionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean expandedQuery_; + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @param value The expandedQuery to set. + * @return This builder for chaining. + */ + public Builder setExpandedQuery(boolean value) { + + expandedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearExpandedQuery() { + + expandedQuery_ = false; + onChanged(); + return this; + } + + private long pinnedResultCount_; + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @param value The pinnedResultCount to set. + * @return This builder for chaining. + */ + public Builder setPinnedResultCount(long value) { + + pinnedResultCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinnedResultCount() { + + pinnedResultCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionInfo(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.v2alpha.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List results_; + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 2; + private java.util.List facets_; + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List getFacetsList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List + getFacetsOrBuilderList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public int getFacetsCount() { + return facets_.size(); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.Facet getFacets(int index) { + return facets_.get(index); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + return facets_.get(index); + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_; + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + public static final int CORRECTED_QUERY_FIELD_NUMBER = 4; + private volatile java.lang.Object correctedQuery_; + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + @java.lang.Override + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + 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(); + correctedQuery_ = s; + return s; + } + } + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionInfo() { + return queryExpansionInfo_ != null; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return getQueryExpansionInfo(); + } + + public static final int REDIRECT_URI_FIELD_NUMBER = 10; + private volatile java.lang.Object redirectUri_; + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + 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(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLIED_CONTROLS_FIELD_NUMBER = 12; + private com.google.protobuf.LazyStringList appliedControls_; + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + return appliedControls_; + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + public java.lang.String getAppliedControls(int index) { + return appliedControls_.get(index); + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { + return appliedControls_.getByteString(index); + } + + public static final int INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER = 14; + private java.util.List + invalidConditionBoostSpecs_; + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public java.util.List + getInvalidConditionBoostSpecsList() { + return invalidConditionBoostSpecs_; + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList() { + return invalidConditionBoostSpecs_; + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public int getInvalidConditionBoostSpecsCount() { + return invalidConditionBoostSpecs_.size(); + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index) { + return invalidConditionBoostSpecs_.get(index); + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index) { + return invalidConditionBoostSpecs_.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 { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + output.writeMessage(2, facets_.get(i)); + } + if (totalSize_ != 0) { + output.writeInt32(3, totalSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, correctedQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + output.writeMessage(7, getQueryExpansionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectUri_); + } + for (int i = 0; i < appliedControls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, appliedControls_.getRaw(i)); + } + for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { + output.writeMessage(14, invalidConditionBoostSpecs_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, facets_.get(i)); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, correctedQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getQueryExpansionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, redirectUri_); + } + { + int dataSize = 0; + for (int i = 0; i < appliedControls_.size(); i++) { + dataSize += computeStringSizeNoTag(appliedControls_.getRaw(i)); + } + size += dataSize; + size += 1 * getAppliedControlsList().size(); + } + for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, invalidConditionBoostSpecs_.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.v2alpha.SearchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SearchResponse other = + (com.google.cloud.retail.v2alpha.SearchResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getFacetsList().equals(other.getFacetsList())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } + if (!getRedirectUri().equals(other.getRedirectUri())) return false; + if (!getAppliedControlsList().equals(other.getAppliedControlsList())) return false; + if (!getInvalidConditionBoostSpecsList().equals(other.getInvalidConditionBoostSpecsList())) + 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 (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (getFacetsCount() > 0) { + hash = (37 * hash) + FACETS_FIELD_NUMBER; + hash = (53 * hash) + getFacetsList().hashCode(); + } + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedQuery().hashCode(); + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } + hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + if (getAppliedControlsCount() > 0) { + hash = (37 * hash) + APPLIED_CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getAppliedControlsList().hashCode(); + } + if (getInvalidConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getInvalidConditionBoostSpecsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.SearchResponse 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 message for
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SearchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SearchResponse) + com.google.cloud.retail.v2alpha.SearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SearchResponse.class, + com.google.cloud.retail.v2alpha.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SearchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + getFacetsFieldBuilder(); + getInvalidConditionBoostSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + facetsBuilder_.clear(); + } + totalSize_ = 0; + + correctedQuery_ = ""; + + attributionToken_ = ""; + + nextPageToken_ = ""; + + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + redirectUri_ = ""; + + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + invalidConditionBoostSpecsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.SearchServiceProto + .internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse build() { + com.google.cloud.retail.v2alpha.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchResponse buildPartial() { + com.google.cloud.retail.v2alpha.SearchResponse result = + new com.google.cloud.retail.v2alpha.SearchResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (facetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.facets_ = facets_; + } else { + result.facets_ = facetsBuilder_.build(); + } + result.totalSize_ = totalSize_; + result.correctedQuery_ = correctedQuery_; + result.attributionToken_ = attributionToken_; + result.nextPageToken_ = nextPageToken_; + if (queryExpansionInfoBuilder_ == null) { + result.queryExpansionInfo_ = queryExpansionInfo_; + } else { + result.queryExpansionInfo_ = queryExpansionInfoBuilder_.build(); + } + result.redirectUri_ = redirectUri_; + if (((bitField0_ & 0x00000004) != 0)) { + appliedControls_ = appliedControls_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.appliedControls_ = appliedControls_; + if (invalidConditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecs_; + } else { + result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecsBuilder_.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.v2alpha.SearchResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SearchResponse other) { + if (other == com.google.cloud.retail.v2alpha.SearchResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (facetsBuilder_ == null) { + if (!other.facets_.isEmpty()) { + if (facets_.isEmpty()) { + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFacetsIsMutable(); + facets_.addAll(other.facets_); + } + onChanged(); + } + } else { + if (!other.facets_.isEmpty()) { + if (facetsBuilder_.isEmpty()) { + facetsBuilder_.dispose(); + facetsBuilder_ = null; + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + facetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetsFieldBuilder() + : null; + } else { + facetsBuilder_.addAllMessages(other.facets_); + } + } + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (!other.getCorrectedQuery().isEmpty()) { + correctedQuery_ = other.correctedQuery_; + onChanged(); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + onChanged(); + } + if (!other.appliedControls_.isEmpty()) { + if (appliedControls_.isEmpty()) { + appliedControls_ = other.appliedControls_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAppliedControlsIsMutable(); + appliedControls_.addAll(other.appliedControls_); + } + onChanged(); + } + if (invalidConditionBoostSpecsBuilder_ == null) { + if (!other.invalidConditionBoostSpecs_.isEmpty()) { + if (invalidConditionBoostSpecs_.isEmpty()) { + invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.addAll(other.invalidConditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.invalidConditionBoostSpecs_.isEmpty()) { + if (invalidConditionBoostSpecsBuilder_.isEmpty()) { + invalidConditionBoostSpecsBuilder_.dispose(); + invalidConditionBoostSpecsBuilder_ = null; + invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + invalidConditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInvalidConditionBoostSpecsFieldBuilder() + : null; + } else { + invalidConditionBoostSpecsBuilder_.addAllMessages(other.invalidConditionBoostSpecs_); + } + } + } + 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.v2alpha.SearchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.SearchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList( + results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, com.google.cloud.retail.v2alpha.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder addResults(com.google.cloud.retail.v2alpha.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, com.google.cloud.retail.v2alpha.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder addAllResults( + java.lang.Iterable + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public java.util.List< + ? extends com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.util.List facets_ = + java.util.Collections.emptyList(); + + private void ensureFacetsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList(facets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder> + facetsBuilder_; + + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public java.util.List getFacetsList() { + if (facetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facets_); + } else { + return facetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public int getFacetsCount() { + if (facetsBuilder_ == null) { + return facets_.size(); + } else { + return facetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet getFacets(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.set(index, value); + onChanged(); + } else { + facetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.set(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(com.google.cloud.retail.v2alpha.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(value); + onChanged(); + } else { + facetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(index, value); + onChanged(); + } else { + facetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder addAllFacets( + java.lang.Iterable values) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facets_); + onChanged(); + } else { + facetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder clearFacets() { + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + facetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public Builder removeFacets(int index) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.remove(index); + onChanged(); + } else { + facetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder getFacetsBuilder( + int index) { + return getFacetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facets_); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder addFacetsBuilder() { + return getFacetsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder addFacetsBuilder( + int index) { + return getFacetsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2alpha.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.Facet, + com.google.cloud.retail.v2alpha.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder>( + facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + facets_ = null; + } + return facetsBuilder_; + } + + private int totalSize_; + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object correctedQuery_ = ""; + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedQuery() { + + correctedQuery_ = getDefaultInstance().getCorrectedQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The bytes for correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedQuery_ = value; + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + + private com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return queryExpansionInfoBuilder_ != null || queryExpansionInfo_ != null; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (queryExpansionInfo_ != null) { + queryExpansionInfo_ = + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.newBuilder( + queryExpansionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionInfo_ = value; + } + onChanged(); + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder clearQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + onChanged(); + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redirectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + + redirectUri_ = getDefaultInstance().getRedirectUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The bytes for redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redirectUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList appliedControls_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAppliedControlsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + appliedControls_ = new com.google.protobuf.LazyStringArrayList(appliedControls_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + return appliedControls_.getUnmodifiableView(); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + public java.lang.String getAppliedControls(int index) { + return appliedControls_.get(index); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { + return appliedControls_.getByteString(index); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index to set the value at. + * @param value The appliedControls to set. + * @return This builder for chaining. + */ + public Builder setAppliedControls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliedControlsIsMutable(); + appliedControls_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param value The appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAppliedControls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliedControlsIsMutable(); + appliedControls_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param values The appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAllAppliedControls(java.lang.Iterable values) { + ensureAppliedControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appliedControls_); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return This builder for chaining. + */ + public Builder clearAppliedControls() { + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param value The bytes of the appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAppliedControlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAppliedControlsIsMutable(); + appliedControls_.add(value); + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureInvalidConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec>( + invalidConditionBoostSpecs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + invalidConditionBoostSpecsBuilder_; + + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getInvalidConditionBoostSpecsList() { + if (invalidConditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } else { + return invalidConditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public int getInvalidConditionBoostSpecsCount() { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.size(); + } else { + return invalidConditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.get(index); + } else { + return invalidConditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder setInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.set(index, value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder setInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(index, value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addAllInvalidConditionBoostSpecs( + java.lang.Iterable< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + values) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidConditionBoostSpecs_); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder clearInvalidConditionBoostSpecs() { + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder removeInvalidConditionBoostSpecs(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.remove(index); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getInvalidConditionBoostSpecsBuilder(int index) { + return getInvalidConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.get(index); + } else { + return invalidConditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList() { + if (invalidConditionBoostSpecsBuilder_ != null) { + return invalidConditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addInvalidConditionBoostSpecsBuilder() { + return getInvalidConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addInvalidConditionBoostSpecsBuilder(int index) { + return getInvalidConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> + getInvalidConditionBoostSpecsBuilderList() { + return getInvalidConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsFieldBuilder() { + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder>( + invalidConditionBoostSpecs_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + invalidConditionBoostSpecs_ = null; + } + return invalidConditionBoostSpecsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.SearchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SearchResponse) + private static final com.google.cloud.retail.v2alpha.SearchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SearchResponse(); + } + + public static com.google.cloud.retail.v2alpha.SearchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResponse(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.v2alpha.SearchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponseOrBuilder.java new file mode 100644 index 00000000..dae37ddc --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchResponseOrBuilder.java @@ -0,0 +1,436 @@ +/* + * 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/v2alpha/search_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SearchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + java.util.List getResultsList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2alpha.SearchResponse.SearchResult getResults(int index); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + int getResultsCount(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2alpha.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + java.util.List getFacetsList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2alpha.SearchResponse.Facet getFacets(int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + int getFacetsCount(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + java.util.List + getFacetsOrBuilderList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2alpha.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index); + + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2alpha.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); + + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + java.lang.String getCorrectedQuery(); + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + com.google.protobuf.ByteString getCorrectedQueryBytes(); + + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + com.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); + + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + java.util.List getAppliedControlsList(); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + int getAppliedControlsCount(); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + java.lang.String getAppliedControls(int index); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + com.google.protobuf.ByteString getAppliedControlsBytes(int index); + + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + java.util.List + getInvalidConditionBoostSpecsList(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + int getInvalidConditionBoostSpecsCount(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceProto.java new file mode 100644 index 00000000..6632bd44 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceProto.java @@ -0,0 +1,424 @@ +/* + * 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/v2alpha/search_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class SearchServiceProto { + private SearchServiceProto() {} + + 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_v2alpha_SearchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/retail/v2alpha/search_ser" + + "vice.proto\022\033google.cloud.retail.v2alpha\032" + + "\034google/api/annotations.proto\032\027google/ap" + + "i/client.proto\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032(goog" + + "le/cloud/retail/v2alpha/common.proto\032)go" + + "ogle/cloud/retail/v2alpha/product.proto\032" + + " google/protobuf/field_mask.proto\032\034googl" + + "e/protobuf/struct.proto\"\361\021\n\rSearchReques" + + "t\022\026\n\tplacement\030\001 \001(\tB\003\340A\002\0221\n\006branch\030\002 \001(" + + "\tB!\372A\036\n\034retail.googleapis.com/Branch\022\r\n\005" + + "query\030\003 \001(\t\022\027\n\nvisitor_id\030\004 \001(\tB\003\340A\002\0228\n\t" + + "user_info\030\005 \001(\0132%.google.cloud.retail.v2" + + "alpha.UserInfo\022\021\n\tpage_size\030\007 \001(\005\022\022\n\npag" + + "e_token\030\010 \001(\t\022\016\n\006offset\030\t \001(\005\022\016\n\006filter\030" + + "\n \001(\t\022\030\n\020canonical_filter\030\034 \001(\t\022\020\n\010order" + + "_by\030\013 \001(\t\022I\n\013facet_specs\030\014 \003(\01324.google." + + "cloud.retail.v2alpha.SearchRequest.Facet" + + "Spec\022[\n\022dynamic_facet_spec\030\025 \001(\0132;.googl" + + "e.cloud.retail.v2alpha.SearchRequest.Dyn" + + "amicFacetSpecB\002\030\001\022H\n\nboost_spec\030\r \001(\01324." + + "google.cloud.retail.v2alpha.SearchReques" + + "t.BoostSpec\022[\n\024query_expansion_spec\030\016 \001(" + + "\0132=.google.cloud.retail.v2alpha.SearchRe" + + "quest.QueryExpansionSpec\022Z\n\023relevance_th" + + "reshold\030\017 \001(\0162=.google.cloud.retail.v2al" + + "pha.SearchRequest.RelevanceThreshold\022\033\n\023" + + "variant_rollup_keys\030\021 \003(\t\022\027\n\017page_catego" + + "ries\030\027 \003(\t\022J\n\013search_mode\030\037 \001(\01625.google" + + ".cloud.retail.v2alpha.SearchRequest.Sear" + + "chMode\022\\\n\024personalization_spec\030 \001(\0132>.g" + + "oogle.cloud.retail.v2alpha.SearchRequest" + + ".PersonalizationSpec\032\351\002\n\tFacetSpec\022U\n\tfa" + + "cet_key\030\001 \001(\0132=.google.cloud.retail.v2al" + + "pha.SearchRequest.FacetSpec.FacetKeyB\003\340A" + + "\002\022\r\n\005limit\030\002 \001(\005\022\034\n\024excluded_filter_keys" + + "\030\003 \003(\t\022\037\n\027enable_dynamic_position\030\004 \001(\010\032" + + "\266\001\n\010FacetKey\022\020\n\003key\030\001 \001(\tB\003\340A\002\0228\n\tinterv" + + "als\030\002 \003(\0132%.google.cloud.retail.v2alpha." + + "Interval\022\031\n\021restricted_values\030\003 \003(\t\022\020\n\010p" + + "refixes\030\010 \003(\t\022\020\n\010contains\030\t \003(\t\022\020\n\010order" + + "_by\030\004 \001(\t\022\r\n\005query\030\005 \001(\t\032\233\001\n\020DynamicFace" + + "tSpec\022N\n\004mode\030\001 \001(\0162@.google.cloud.retai" + + "l.v2alpha.SearchRequest.DynamicFacetSpec" + + ".Mode\"7\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\014\n\010D" + + "ISABLED\020\001\022\013\n\007ENABLED\020\002\032\363\001\n\tBoostSpec\022f\n\025" + + "condition_boost_specs\030\001 \003(\0132G.google.clo" + + "ud.retail.v2alpha.SearchRequest.BoostSpe" + + "c.ConditionBoostSpec\022\'\n\032skip_boost_spec_" + + "validation\030\002 \001(\010H\000\210\001\001\0326\n\022ConditionBoostS" + + "pec\022\021\n\tcondition\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002B\035\n" + + "\033_skip_boost_spec_validation\032\320\001\n\022QueryEx" + + "pansionSpec\022Z\n\tcondition\030\001 \001(\0162G.google." + + "cloud.retail.v2alpha.SearchRequest.Query" + + "ExpansionSpec.Condition\022\036\n\026pin_unexpande" + + "d_results\030\002 \001(\010\">\n\tCondition\022\031\n\025CONDITIO" + + "N_UNSPECIFIED\020\000\022\014\n\010DISABLED\020\001\022\010\n\004AUTO\020\003\032" + + "\236\001\n\023PersonalizationSpec\022Q\n\004mode\030\001 \001(\0162C." + + "google.cloud.retail.v2alpha.SearchReques" + + "t.PersonalizationSpec.Mode\"4\n\004Mode\022\024\n\020MO" + + "DE_UNSPECIFIED\020\000\022\010\n\004AUTO\020\001\022\014\n\010DISABLED\020\002" + + "\"d\n\022RelevanceThreshold\022#\n\037RELEVANCE_THRE" + + "SHOLD_UNSPECIFIED\020\000\022\010\n\004HIGH\020\001\022\n\n\006MEDIUM\020" + + "\002\022\007\n\003LOW\020\003\022\n\n\006LOWEST\020\004\"[\n\nSearchMode\022\033\n\027" + + "SEARCH_MODE_UNSPECIFIED\020\000\022\027\n\023PRODUCT_SEA" + + "RCH_ONLY\020\001\022\027\n\023FACETED_SEARCH_ONLY\020\002\"\306\n\n\016" + + "SearchResponse\022I\n\007results\030\001 \003(\01328.google" + + ".cloud.retail.v2alpha.SearchResponse.Sea" + + "rchResult\022A\n\006facets\030\002 \003(\01321.google.cloud" + + ".retail.v2alpha.SearchResponse.Facet\022\022\n\n" + + "total_size\030\003 \001(\005\022\027\n\017corrected_query\030\004 \001(" + + "\t\022\031\n\021attribution_token\030\005 \001(\t\022\027\n\017next_pag" + + "e_token\030\006 \001(\t\022\\\n\024query_expansion_info\030\007 " + + "\001(\0132>.google.cloud.retail.v2alpha.Search" + + "Response.QueryExpansionInfo\022\024\n\014redirect_" + + "uri\030\n \001(\t\022\030\n\020applied_controls\030\014 \003(\t\022n\n\035i" + + "nvalid_condition_boost_specs\030\016 \003(\0132G.goo" + + "gle.cloud.retail.v2alpha.SearchRequest.B" + + "oostSpec.ConditionBoostSpec\032\207\004\n\014SearchRe" + + "sult\022\n\n\002id\030\001 \001(\t\0225\n\007product\030\002 \001(\0132$.goog" + + "le.cloud.retail.v2alpha.Product\022\036\n\026match" + + "ing_variant_count\030\003 \001(\005\022t\n\027matching_vari" + + "ant_fields\030\004 \003(\0132S.google.cloud.retail.v" + + "2alpha.SearchResponse.SearchResult.Match" + + "ingVariantFieldsEntry\022p\n\025variant_rollup_" + + "values\030\005 \003(\0132Q.google.cloud.retail.v2alp" + + "ha.SearchResponse.SearchResult.VariantRo" + + "llupValuesEntry\032X\n\032MatchingVariantFields" + + "Entry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.goog" + + "le.protobuf.FieldMask:\0028\001\032R\n\030VariantRoll" + + "upValuesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(" + + "\0132\026.google.protobuf.Value:\0028\001\032\361\001\n\005Facet\022" + + "\013\n\003key\030\001 \001(\t\022L\n\006values\030\002 \003(\0132<.google.cl" + + "oud.retail.v2alpha.SearchResponse.Facet." + + "FacetValue\022\025\n\rdynamic_facet\030\003 \001(\010\032v\n\nFac" + + "etValue\022\017\n\005value\030\001 \001(\tH\000\0229\n\010interval\030\002 \001" + + "(\0132%.google.cloud.retail.v2alpha.Interva" + + "lH\000\022\r\n\005count\030\003 \001(\003B\r\n\013facet_value\032I\n\022Que" + + "ryExpansionInfo\022\026\n\016expanded_query\030\001 \001(\010\022" + + "\033\n\023pinned_result_count\030\002 \001(\0032\225\002\n\rSearchS" + + "ervice\022\270\001\n\006Search\022*.google.cloud.retail." + + "v2alpha.SearchRequest\032+.google.cloud.ret" + + "ail.v2alpha.SearchResponse\"U\202\323\344\223\002O\"J/v2a" + + "lpha/{placement=projects/*/locations/*/c" + + "atalogs/*/placements/*}:search:\001*\032I\312A\025re" + + "tail.googleapis.com\322A.https://www.google" + + "apis.com/auth/cloud-platformB\340\001\n\037com.goo" + + "gle.cloud.retail.v2alphaB\022SearchServiceP" + + "rotoP\001ZAgoogle.golang.org/genproto/googl" + + "eapis/cloud/retail/v2alpha;retail\242\002\006RETA" + + "IL\252\002\033Google.Cloud.Retail.V2Alpha\312\002\033Googl" + + "e\\Cloud\\Retail\\V2alpha\352\002\036Google::Cloud::" + + "Retail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_SearchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor, + new java.lang.String[] { + "Placement", + "Branch", + "Query", + "VisitorId", + "UserInfo", + "PageSize", + "PageToken", + "Offset", + "Filter", + "CanonicalFilter", + "OrderBy", + "FacetSpecs", + "DynamicFacetSpec", + "BoostSpec", + "QueryExpansionSpec", + "RelevanceThreshold", + "VariantRollupKeys", + "PageCategories", + "SearchMode", + "PersonalizationSpec", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor, + new java.lang.String[] { + "FacetKey", "Limit", "ExcludedFilterKeys", "EnableDynamicPosition", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_FacetSpec_FacetKey_descriptor, + new java.lang.String[] { + "Key", "Intervals", "RestrictedValues", "Prefixes", "Contains", "OrderBy", "Query", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_DynamicFacetSpec_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor, + new java.lang.String[] { + "ConditionBoostSpecs", "SkipBoostSpecValidation", "SkipBoostSpecValidation", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor, + new java.lang.String[] { + "Condition", "Boost", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_QueryExpansionSpec_descriptor, + new java.lang.String[] { + "Condition", "PinUnexpandedResults", + }); + internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchRequest_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchRequest_PersonalizationSpec_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_SearchResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor, + new java.lang.String[] { + "Results", + "Facets", + "TotalSize", + "CorrectedQuery", + "AttributionToken", + "NextPageToken", + "QueryExpansionInfo", + "RedirectUri", + "AppliedControls", + "InvalidConditionBoostSpecs", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor, + new java.lang.String[] { + "Id", + "Product", + "MatchingVariantCount", + "MatchingVariantFields", + "VariantRollupValues", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor, + new java.lang.String[] { + "Key", "Values", "DynamicFacet", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_Facet_FacetValue_descriptor, + new java.lang.String[] { + "Value", "Interval", "Count", "FacetValue", + }); + internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor = + internal_static_google_cloud_retail_v2alpha_SearchResponse_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_SearchResponse_QueryExpansionInfo_descriptor, + new java.lang.String[] { + "ExpandedQuery", "PinnedResultCount", + }); + 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.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchSolutionUseCase.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchSolutionUseCase.java new file mode 100644 index 00000000..2a5fdbd5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SearchSolutionUseCase.java @@ -0,0 +1,185 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The use case of Cloud Retail Search.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SearchSolutionUseCase} + */ +public enum SearchSolutionUseCase implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The value when it's unspecified. Defaults to
+   * [SEARCH][].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + */ + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED(0), + /** + * + * + *
+   * Search use case. Expects the traffic has a non-empty
+   * [query][google.cloud.retail.v2alpha.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + */ + SEARCH_SOLUTION_USE_CASE_SEARCH(1), + /** + * + * + *
+   * Browse use case. Expects the traffic has an empty
+   * [query][google.cloud.retail.v2alpha.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + */ + SEARCH_SOLUTION_USE_CASE_BROWSE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The value when it's unspecified. Defaults to
+   * [SEARCH][].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + */ + public static final int SEARCH_SOLUTION_USE_CASE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Search use case. Expects the traffic has a non-empty
+   * [query][google.cloud.retail.v2alpha.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + */ + public static final int SEARCH_SOLUTION_USE_CASE_SEARCH_VALUE = 1; + /** + * + * + *
+   * Browse use case. Expects the traffic has an empty
+   * [query][google.cloud.retail.v2alpha.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + */ + public static final int SEARCH_SOLUTION_USE_CASE_BROWSE_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 SearchSolutionUseCase 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 SearchSolutionUseCase forNumber(int value) { + switch (value) { + case 0: + return SEARCH_SOLUTION_USE_CASE_UNSPECIFIED; + case 1: + return SEARCH_SOLUTION_USE_CASE_SEARCH; + case 2: + return SEARCH_SOLUTION_USE_CASE_BROWSE; + 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 SearchSolutionUseCase findValueByNumber(int number) { + return SearchSolutionUseCase.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.v2alpha.CommonProto.getDescriptor().getEnumTypes().get(2); + } + + private static final SearchSolutionUseCase[] VALUES = values(); + + public static SearchSolutionUseCase 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 SearchSolutionUseCase(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SearchSolutionUseCase) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfig.java new file mode 100644 index 00000000..aa078dee --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfig.java @@ -0,0 +1,6143 @@ +/* + * 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/v2alpha/serving_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * 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.v2alpha.ServingConfig} + */ +public final class ServingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ServingConfig) + ServingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServingConfig.newBuilder() to construct. + private ServingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServingConfig() { + name_ = ""; + displayName_ = ""; + modelId_ = ""; + priceRerankingLevel_ = ""; + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + diversityLevel_ = ""; + enableCategoryFilterLevel_ = ""; + solutionTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServingConfig( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + modelId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + priceRerankingLevel_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + facetControlIds_.add(s); + break; + } + case 50: + { + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder subBuilder = + null; + if (dynamicFacetSpec_ != null) { + subBuilder = dynamicFacetSpec_.toBuilder(); + } + dynamicFacetSpec_ = + input.readMessage( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicFacetSpec_); + dynamicFacetSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + boostControlIds_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + diversityLevel_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + filterControlIds_.add(s); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + redirectControlIds_.add(s); + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + onewaySynonymsControlIds_.add(s); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000040; + } + doNotAssociateControlIds_.add(s); + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + replacementControlIds_.add(s); + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + ignoreControlIds_.add(s); + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + enableCategoryFilterLevel_ = s; + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + twowaySynonymsControlIds_.add(s); + break; + } + case 152: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + solutionTypes_.add(rawValue); + break; + } + case 154: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + solutionTypes_.add(rawValue); + } + input.popLimit(oldLimit); + 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)) { + facetControlIds_ = facetControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = boostControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = filterControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = redirectControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = onewaySynonymsControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = doNotAssociateControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = replacementControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = ignoreControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = twowaySynonymsControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigProto + .internal_static_google_cloud_retail_v2alpha_ServingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigProto + .internal_static_google_cloud_retail_v2alpha_ServingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ServingConfig.class, + com.google.cloud.retail.v2alpha.ServingConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * 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 human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * 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 MODEL_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object modelId_; + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + @java.lang.Override + public java.lang.String getModelId() { + java.lang.Object ref = modelId_; + 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(); + modelId_ = s; + return s; + } + } + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelIdBytes() { + java.lang.Object ref = modelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_RERANKING_LEVEL_FIELD_NUMBER = 4; + private volatile java.lang.Object priceRerankingLevel_; + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + @java.lang.Override + public java.lang.String getPriceRerankingLevel() { + java.lang.Object ref = priceRerankingLevel_; + 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(); + priceRerankingLevel_ = s; + return s; + } + } + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPriceRerankingLevelBytes() { + java.lang.Object ref = priceRerankingLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + priceRerankingLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FACET_CONTROL_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList facetControlIds_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + public com.google.protobuf.ProtocolStringList getFacetControlIdsList() { + return facetControlIds_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + public int getFacetControlIdsCount() { + return facetControlIds_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + public java.lang.String getFacetControlIds(int index) { + return facetControlIds_.get(index); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + public com.google.protobuf.ByteString getFacetControlIdsBytes(int index) { + return facetControlIds_.getByteString(index); + } + + public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 6; + private com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Override + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpec_ != null; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return The dynamicFacetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + return getDynamicFacetSpec(); + } + + public static final int BOOST_CONTROL_IDS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList boostControlIds_; + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + public com.google.protobuf.ProtocolStringList getBoostControlIdsList() { + return boostControlIds_; + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + public int getBoostControlIdsCount() { + return boostControlIds_.size(); + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + public java.lang.String getBoostControlIds(int index) { + return boostControlIds_.get(index); + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + public com.google.protobuf.ByteString getBoostControlIdsBytes(int index) { + return boostControlIds_.getByteString(index); + } + + public static final int FILTER_CONTROL_IDS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList filterControlIds_; + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + public com.google.protobuf.ProtocolStringList getFilterControlIdsList() { + return filterControlIds_; + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + public int getFilterControlIdsCount() { + return filterControlIds_.size(); + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + public java.lang.String getFilterControlIds(int index) { + return filterControlIds_.get(index); + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + public com.google.protobuf.ByteString getFilterControlIdsBytes(int index) { + return filterControlIds_.getByteString(index); + } + + public static final int REDIRECT_CONTROL_IDS_FIELD_NUMBER = 10; + private com.google.protobuf.LazyStringList redirectControlIds_; + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + public com.google.protobuf.ProtocolStringList getRedirectControlIdsList() { + return redirectControlIds_; + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + public int getRedirectControlIdsCount() { + return redirectControlIds_.size(); + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + public java.lang.String getRedirectControlIds(int index) { + return redirectControlIds_.get(index); + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + public com.google.protobuf.ByteString getRedirectControlIdsBytes(int index) { + return redirectControlIds_.getByteString(index); + } + + public static final int TWOWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER = 18; + private com.google.protobuf.LazyStringList twowaySynonymsControlIds_; + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getTwowaySynonymsControlIdsList() { + return twowaySynonymsControlIds_; + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + public int getTwowaySynonymsControlIdsCount() { + return twowaySynonymsControlIds_.size(); + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + public java.lang.String getTwowaySynonymsControlIds(int index) { + return twowaySynonymsControlIds_.get(index); + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index) { + return twowaySynonymsControlIds_.getByteString(index); + } + + public static final int ONEWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER = 12; + private com.google.protobuf.LazyStringList onewaySynonymsControlIds_; + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getOnewaySynonymsControlIdsList() { + return onewaySynonymsControlIds_; + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + public int getOnewaySynonymsControlIdsCount() { + return onewaySynonymsControlIds_.size(); + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + public java.lang.String getOnewaySynonymsControlIds(int index) { + return onewaySynonymsControlIds_.get(index); + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index) { + return onewaySynonymsControlIds_.getByteString(index); + } + + public static final int DO_NOT_ASSOCIATE_CONTROL_IDS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList doNotAssociateControlIds_; + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateControlIdsList() { + return doNotAssociateControlIds_; + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + public int getDoNotAssociateControlIdsCount() { + return doNotAssociateControlIds_.size(); + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + public java.lang.String getDoNotAssociateControlIds(int index) { + return doNotAssociateControlIds_.get(index); + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index) { + return doNotAssociateControlIds_.getByteString(index); + } + + public static final int REPLACEMENT_CONTROL_IDS_FIELD_NUMBER = 14; + private com.google.protobuf.LazyStringList replacementControlIds_; + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + public com.google.protobuf.ProtocolStringList getReplacementControlIdsList() { + return replacementControlIds_; + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + public int getReplacementControlIdsCount() { + return replacementControlIds_.size(); + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + public java.lang.String getReplacementControlIds(int index) { + return replacementControlIds_.get(index); + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + public com.google.protobuf.ByteString getReplacementControlIdsBytes(int index) { + return replacementControlIds_.getByteString(index); + } + + public static final int IGNORE_CONTROL_IDS_FIELD_NUMBER = 15; + private com.google.protobuf.LazyStringList ignoreControlIds_; + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + public com.google.protobuf.ProtocolStringList getIgnoreControlIdsList() { + return ignoreControlIds_; + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + public int getIgnoreControlIdsCount() { + return ignoreControlIds_.size(); + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + public java.lang.String getIgnoreControlIds(int index) { + return ignoreControlIds_.get(index); + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + public com.google.protobuf.ByteString getIgnoreControlIdsBytes(int index) { + return ignoreControlIds_.getByteString(index); + } + + public static final int DIVERSITY_LEVEL_FIELD_NUMBER = 8; + private volatile java.lang.Object diversityLevel_; + /** + * + * + *
+   * 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + @java.lang.Override + public java.lang.String getDiversityLevel() { + java.lang.Object ref = diversityLevel_; + 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(); + diversityLevel_ = s; + return s; + } + } + /** + * + * + *
+   * 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiversityLevelBytes() { + java.lang.Object ref = diversityLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diversityLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.
+   * If not specified, we enable it by default.
+   *  Allowed values are:
+   * * '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
+   *   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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + @java.lang.Override + public java.lang.String getEnableCategoryFilterLevel() { + java.lang.Object ref = enableCategoryFilterLevel_; + 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(); + enableCategoryFilterLevel_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enableCategoryFilterLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOLUTION_TYPES_FIELD_NUMBER = 19; + private java.util.List solutionTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType> + solutionTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>() { + public com.google.cloud.retail.v2alpha.SolutionType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2alpha.SolutionType result = + com.google.cloud.retail.v2alpha.SolutionType.valueOf(from); + return result == null + ? com.google.cloud.retail.v2alpha.SolutionType.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + @java.lang.Override + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(index)); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesValueList() { + return solutionTypes_; + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + @java.lang.Override + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(index); + } + + private int solutionTypesMemoizedSerializedSize; + + 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 { + getSerializedSize(); + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, modelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(priceRerankingLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, priceRerankingLevel_); + } + for (int i = 0; i < facetControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, facetControlIds_.getRaw(i)); + } + if (dynamicFacetSpec_ != null) { + output.writeMessage(6, getDynamicFacetSpec()); + } + for (int i = 0; i < boostControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, boostControlIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diversityLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, diversityLevel_); + } + for (int i = 0; i < filterControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, filterControlIds_.getRaw(i)); + } + for (int i = 0; i < redirectControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectControlIds_.getRaw(i)); + } + for (int i = 0; i < onewaySynonymsControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 12, onewaySynonymsControlIds_.getRaw(i)); + } + for (int i = 0; i < doNotAssociateControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 13, doNotAssociateControlIds_.getRaw(i)); + } + for (int i = 0; i < replacementControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 14, replacementControlIds_.getRaw(i)); + } + for (int i = 0; i < ignoreControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, ignoreControlIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enableCategoryFilterLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, enableCategoryFilterLevel_); + } + for (int i = 0; i < twowaySynonymsControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 18, twowaySynonymsControlIds_.getRaw(i)); + } + if (getSolutionTypesList().size() > 0) { + output.writeUInt32NoTag(154); + output.writeUInt32NoTag(solutionTypesMemoizedSerializedSize); + } + for (int i = 0; i < solutionTypes_.size(); i++) { + output.writeEnumNoTag(solutionTypes_.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, modelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(priceRerankingLevel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, priceRerankingLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < facetControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(facetControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getFacetControlIdsList().size(); + } + if (dynamicFacetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDynamicFacetSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < boostControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(boostControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getBoostControlIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diversityLevel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, diversityLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < filterControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(filterControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getFilterControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < redirectControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(redirectControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getRedirectControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < onewaySynonymsControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(onewaySynonymsControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getOnewaySynonymsControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < doNotAssociateControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(doNotAssociateControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getDoNotAssociateControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < replacementControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(replacementControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getReplacementControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(ignoreControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getIgnoreControlIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enableCategoryFilterLevel_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(16, enableCategoryFilterLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < twowaySynonymsControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(twowaySynonymsControlIds_.getRaw(i)); + } + size += dataSize; + size += 2 * getTwowaySynonymsControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < solutionTypes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(solutionTypes_.get(i)); + } + size += dataSize; + if (!getSolutionTypesList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + solutionTypesMemoizedSerializedSize = dataSize; + } + 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.v2alpha.ServingConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ServingConfig other = + (com.google.cloud.retail.v2alpha.ServingConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getModelId().equals(other.getModelId())) return false; + if (!getPriceRerankingLevel().equals(other.getPriceRerankingLevel())) return false; + if (!getFacetControlIdsList().equals(other.getFacetControlIdsList())) return false; + if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false; + if (hasDynamicFacetSpec()) { + if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false; + } + if (!getBoostControlIdsList().equals(other.getBoostControlIdsList())) return false; + if (!getFilterControlIdsList().equals(other.getFilterControlIdsList())) return false; + if (!getRedirectControlIdsList().equals(other.getRedirectControlIdsList())) return false; + if (!getTwowaySynonymsControlIdsList().equals(other.getTwowaySynonymsControlIdsList())) + return false; + if (!getOnewaySynonymsControlIdsList().equals(other.getOnewaySynonymsControlIdsList())) + return false; + if (!getDoNotAssociateControlIdsList().equals(other.getDoNotAssociateControlIdsList())) + return false; + if (!getReplacementControlIdsList().equals(other.getReplacementControlIdsList())) return false; + if (!getIgnoreControlIdsList().equals(other.getIgnoreControlIdsList())) return false; + if (!getDiversityLevel().equals(other.getDiversityLevel())) return false; + if (!getEnableCategoryFilterLevel().equals(other.getEnableCategoryFilterLevel())) return false; + if (!solutionTypes_.equals(other.solutionTypes_)) 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) + MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getModelId().hashCode(); + hash = (37 * hash) + PRICE_RERANKING_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getPriceRerankingLevel().hashCode(); + if (getFacetControlIdsCount() > 0) { + hash = (37 * hash) + FACET_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getFacetControlIdsList().hashCode(); + } + if (hasDynamicFacetSpec()) { + hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getDynamicFacetSpec().hashCode(); + } + if (getBoostControlIdsCount() > 0) { + hash = (37 * hash) + BOOST_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getBoostControlIdsList().hashCode(); + } + if (getFilterControlIdsCount() > 0) { + hash = (37 * hash) + FILTER_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getFilterControlIdsList().hashCode(); + } + if (getRedirectControlIdsCount() > 0) { + hash = (37 * hash) + REDIRECT_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getRedirectControlIdsList().hashCode(); + } + if (getTwowaySynonymsControlIdsCount() > 0) { + hash = (37 * hash) + TWOWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTwowaySynonymsControlIdsList().hashCode(); + } + if (getOnewaySynonymsControlIdsCount() > 0) { + hash = (37 * hash) + ONEWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getOnewaySynonymsControlIdsList().hashCode(); + } + if (getDoNotAssociateControlIdsCount() > 0) { + hash = (37 * hash) + DO_NOT_ASSOCIATE_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateControlIdsList().hashCode(); + } + if (getReplacementControlIdsCount() > 0) { + hash = (37 * hash) + REPLACEMENT_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getReplacementControlIdsList().hashCode(); + } + if (getIgnoreControlIdsCount() > 0) { + hash = (37 * hash) + IGNORE_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreControlIdsList().hashCode(); + } + hash = (37 * hash) + DIVERSITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getDiversityLevel().hashCode(); + hash = (37 * hash) + ENABLE_CATEGORY_FILTER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getEnableCategoryFilterLevel().hashCode(); + if (getSolutionTypesCount() > 0) { + hash = (37 * hash) + SOLUTION_TYPES_FIELD_NUMBER; + hash = (53 * hash) + solutionTypes_.hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.ServingConfig 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; + } + /** + * + * + *
+   * 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.v2alpha.ServingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ServingConfig) + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigProto + .internal_static_google_cloud_retail_v2alpha_ServingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigProto + .internal_static_google_cloud_retail_v2alpha_ServingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ServingConfig.class, + com.google.cloud.retail.v2alpha.ServingConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ServingConfig.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_ = ""; + + displayName_ = ""; + + modelId_ = ""; + + priceRerankingLevel_ = ""; + + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + diversityLevel_ = ""; + + enableCategoryFilterLevel_ = ""; + + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ServingConfigProto + .internal_static_google_cloud_retail_v2alpha_ServingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig build() { + com.google.cloud.retail.v2alpha.ServingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig buildPartial() { + com.google.cloud.retail.v2alpha.ServingConfig result = + new com.google.cloud.retail.v2alpha.ServingConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.modelId_ = modelId_; + result.priceRerankingLevel_ = priceRerankingLevel_; + if (((bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = facetControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.facetControlIds_ = facetControlIds_; + if (dynamicFacetSpecBuilder_ == null) { + result.dynamicFacetSpec_ = dynamicFacetSpec_; + } else { + result.dynamicFacetSpec_ = dynamicFacetSpecBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = boostControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.boostControlIds_ = boostControlIds_; + if (((bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = filterControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.filterControlIds_ = filterControlIds_; + if (((bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = redirectControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.redirectControlIds_ = redirectControlIds_; + if (((bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = twowaySynonymsControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.twowaySynonymsControlIds_ = twowaySynonymsControlIds_; + if (((bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = onewaySynonymsControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.onewaySynonymsControlIds_ = onewaySynonymsControlIds_; + if (((bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = doNotAssociateControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.doNotAssociateControlIds_ = doNotAssociateControlIds_; + if (((bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = replacementControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.replacementControlIds_ = replacementControlIds_; + if (((bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = ignoreControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.ignoreControlIds_ = ignoreControlIds_; + result.diversityLevel_ = diversityLevel_; + result.enableCategoryFilterLevel_ = enableCategoryFilterLevel_; + if (((bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.solutionTypes_ = solutionTypes_; + 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.v2alpha.ServingConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.ServingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ServingConfig other) { + if (other == com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getModelId().isEmpty()) { + modelId_ = other.modelId_; + onChanged(); + } + if (!other.getPriceRerankingLevel().isEmpty()) { + priceRerankingLevel_ = other.priceRerankingLevel_; + onChanged(); + } + if (!other.facetControlIds_.isEmpty()) { + if (facetControlIds_.isEmpty()) { + facetControlIds_ = other.facetControlIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFacetControlIdsIsMutable(); + facetControlIds_.addAll(other.facetControlIds_); + } + onChanged(); + } + if (other.hasDynamicFacetSpec()) { + mergeDynamicFacetSpec(other.getDynamicFacetSpec()); + } + if (!other.boostControlIds_.isEmpty()) { + if (boostControlIds_.isEmpty()) { + boostControlIds_ = other.boostControlIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureBoostControlIdsIsMutable(); + boostControlIds_.addAll(other.boostControlIds_); + } + onChanged(); + } + if (!other.filterControlIds_.isEmpty()) { + if (filterControlIds_.isEmpty()) { + filterControlIds_ = other.filterControlIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFilterControlIdsIsMutable(); + filterControlIds_.addAll(other.filterControlIds_); + } + onChanged(); + } + if (!other.redirectControlIds_.isEmpty()) { + if (redirectControlIds_.isEmpty()) { + redirectControlIds_ = other.redirectControlIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.addAll(other.redirectControlIds_); + } + onChanged(); + } + if (!other.twowaySynonymsControlIds_.isEmpty()) { + if (twowaySynonymsControlIds_.isEmpty()) { + twowaySynonymsControlIds_ = other.twowaySynonymsControlIds_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.addAll(other.twowaySynonymsControlIds_); + } + onChanged(); + } + if (!other.onewaySynonymsControlIds_.isEmpty()) { + if (onewaySynonymsControlIds_.isEmpty()) { + onewaySynonymsControlIds_ = other.onewaySynonymsControlIds_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.addAll(other.onewaySynonymsControlIds_); + } + onChanged(); + } + if (!other.doNotAssociateControlIds_.isEmpty()) { + if (doNotAssociateControlIds_.isEmpty()) { + doNotAssociateControlIds_ = other.doNotAssociateControlIds_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.addAll(other.doNotAssociateControlIds_); + } + onChanged(); + } + if (!other.replacementControlIds_.isEmpty()) { + if (replacementControlIds_.isEmpty()) { + replacementControlIds_ = other.replacementControlIds_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.addAll(other.replacementControlIds_); + } + onChanged(); + } + if (!other.ignoreControlIds_.isEmpty()) { + if (ignoreControlIds_.isEmpty()) { + ignoreControlIds_ = other.ignoreControlIds_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.addAll(other.ignoreControlIds_); + } + onChanged(); + } + if (!other.getDiversityLevel().isEmpty()) { + diversityLevel_ = other.diversityLevel_; + onChanged(); + } + if (!other.getEnableCategoryFilterLevel().isEmpty()) { + enableCategoryFilterLevel_ = other.enableCategoryFilterLevel_; + onChanged(); + } + if (!other.solutionTypes_.isEmpty()) { + if (solutionTypes_.isEmpty()) { + solutionTypes_ = other.solutionTypes_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureSolutionTypesIsMutable(); + solutionTypes_.addAll(other.solutionTypes_); + } + 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.v2alpha.ServingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.ServingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 java.lang.Object modelId_ = ""; + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + public java.lang.String getModelId() { + java.lang.Object ref = modelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + public com.google.protobuf.ByteString getModelIdBytes() { + java.lang.Object ref = modelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @param value The modelId to set. + * @return This builder for chaining. + */ + public Builder setModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + modelId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearModelId() { + + modelId_ = getDefaultInstance().getModelId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @param value The bytes for modelId to set. + * @return This builder for chaining. + */ + public Builder setModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + modelId_ = value; + onChanged(); + return this; + } + + private java.lang.Object priceRerankingLevel_ = ""; + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + public java.lang.String getPriceRerankingLevel() { + java.lang.Object ref = priceRerankingLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + priceRerankingLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + public com.google.protobuf.ByteString getPriceRerankingLevelBytes() { + java.lang.Object ref = priceRerankingLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + priceRerankingLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @param value The priceRerankingLevel to set. + * @return This builder for chaining. + */ + public Builder setPriceRerankingLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + priceRerankingLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return This builder for chaining. + */ + public Builder clearPriceRerankingLevel() { + + priceRerankingLevel_ = getDefaultInstance().getPriceRerankingLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @param value The bytes for priceRerankingLevel to set. + * @return This builder for chaining. + */ + public Builder setPriceRerankingLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + priceRerankingLevel_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList facetControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFacetControlIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = new com.google.protobuf.LazyStringArrayList(facetControlIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + public com.google.protobuf.ProtocolStringList getFacetControlIdsList() { + return facetControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + public int getFacetControlIdsCount() { + return facetControlIds_.size(); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + public java.lang.String getFacetControlIds(int index) { + return facetControlIds_.get(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + public com.google.protobuf.ByteString getFacetControlIdsBytes(int index) { + return facetControlIds_.getByteString(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index to set the value at. + * @param value The facetControlIds to set. + * @return This builder for chaining. + */ + public Builder setFacetControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetControlIdsIsMutable(); + facetControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param value The facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addFacetControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetControlIdsIsMutable(); + facetControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param values The facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllFacetControlIds(java.lang.Iterable values) { + ensureFacetControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return This builder for chaining. + */ + public Builder clearFacetControlIds() { + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param value The bytes of the facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addFacetControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFacetControlIdsIsMutable(); + facetControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder> + dynamicFacetSpecBuilder_; + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return Whether the dynamicFacetSpec field is set. + */ + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpecBuilder_ != null || dynamicFacetSpec_ != null; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return The dynamicFacetSpec. + */ + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } else { + return dynamicFacetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicFacetSpec_ = value; + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder builderForValue) { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = builderForValue.build(); + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder mergeDynamicFacetSpec( + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (dynamicFacetSpec_ != null) { + dynamicFacetSpec_ = + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.newBuilder( + dynamicFacetSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + dynamicFacetSpec_ = value; + } + onChanged(); + } else { + dynamicFacetSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder clearDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + onChanged(); + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder + getDynamicFacetSpecBuilder() { + + onChanged(); + return getDynamicFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + if (dynamicFacetSpecBuilder_ != null) { + return dynamicFacetSpecBuilder_.getMessageOrBuilder(); + } else { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder> + getDynamicFacetSpecFieldBuilder() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder>( + getDynamicFacetSpec(), getParentForChildren(), isClean()); + dynamicFacetSpec_ = null; + } + return dynamicFacetSpecBuilder_; + } + + private com.google.protobuf.LazyStringList boostControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBoostControlIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = new com.google.protobuf.LazyStringArrayList(boostControlIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + public com.google.protobuf.ProtocolStringList getBoostControlIdsList() { + return boostControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + public int getBoostControlIdsCount() { + return boostControlIds_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + public java.lang.String getBoostControlIds(int index) { + return boostControlIds_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + public com.google.protobuf.ByteString getBoostControlIdsBytes(int index) { + return boostControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index to set the value at. + * @param value The boostControlIds to set. + * @return This builder for chaining. + */ + public Builder setBoostControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoostControlIdsIsMutable(); + boostControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param value The boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addBoostControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoostControlIdsIsMutable(); + boostControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param values The boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllBoostControlIds(java.lang.Iterable values) { + ensureBoostControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, boostControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return This builder for chaining. + */ + public Builder clearBoostControlIds() { + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param value The bytes of the boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addBoostControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBoostControlIdsIsMutable(); + boostControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList filterControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFilterControlIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = new com.google.protobuf.LazyStringArrayList(filterControlIds_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + public com.google.protobuf.ProtocolStringList getFilterControlIdsList() { + return filterControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + public int getFilterControlIdsCount() { + return filterControlIds_.size(); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + public java.lang.String getFilterControlIds(int index) { + return filterControlIds_.get(index); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + public com.google.protobuf.ByteString getFilterControlIdsBytes(int index) { + return filterControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index to set the value at. + * @param value The filterControlIds to set. + * @return This builder for chaining. + */ + public Builder setFilterControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilterControlIdsIsMutable(); + filterControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param value The filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addFilterControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilterControlIdsIsMutable(); + filterControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param values The filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllFilterControlIds(java.lang.Iterable values) { + ensureFilterControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filterControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return This builder for chaining. + */ + public Builder clearFilterControlIds() { + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param value The bytes of the filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addFilterControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFilterControlIdsIsMutable(); + filterControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList redirectControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRedirectControlIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = new com.google.protobuf.LazyStringArrayList(redirectControlIds_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + public com.google.protobuf.ProtocolStringList getRedirectControlIdsList() { + return redirectControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + public int getRedirectControlIdsCount() { + return redirectControlIds_.size(); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + public java.lang.String getRedirectControlIds(int index) { + return redirectControlIds_.get(index); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + public com.google.protobuf.ByteString getRedirectControlIdsBytes(int index) { + return redirectControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index to set the value at. + * @param value The redirectControlIds to set. + * @return This builder for chaining. + */ + public Builder setRedirectControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param value The redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addRedirectControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param values The redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllRedirectControlIds(java.lang.Iterable values) { + ensureRedirectControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, redirectControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return This builder for chaining. + */ + public Builder clearRedirectControlIds() { + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param value The bytes of the redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addRedirectControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList twowaySynonymsControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTwowaySynonymsControlIdsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = + new com.google.protobuf.LazyStringArrayList(twowaySynonymsControlIds_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getTwowaySynonymsControlIdsList() { + return twowaySynonymsControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + public int getTwowaySynonymsControlIdsCount() { + return twowaySynonymsControlIds_.size(); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + public java.lang.String getTwowaySynonymsControlIds(int index) { + return twowaySynonymsControlIds_.get(index); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index) { + return twowaySynonymsControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index to set the value at. + * @param value The twowaySynonymsControlIds to set. + * @return This builder for chaining. + */ + public Builder setTwowaySynonymsControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param value The twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addTwowaySynonymsControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param values The twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllTwowaySynonymsControlIds(java.lang.Iterable values) { + ensureTwowaySynonymsControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, twowaySynonymsControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return This builder for chaining. + */ + public Builder clearTwowaySynonymsControlIds() { + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param value The bytes of the twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addTwowaySynonymsControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList onewaySynonymsControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOnewaySynonymsControlIdsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = + new com.google.protobuf.LazyStringArrayList(onewaySynonymsControlIds_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getOnewaySynonymsControlIdsList() { + return onewaySynonymsControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + public int getOnewaySynonymsControlIdsCount() { + return onewaySynonymsControlIds_.size(); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + public java.lang.String getOnewaySynonymsControlIds(int index) { + return onewaySynonymsControlIds_.get(index); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index) { + return onewaySynonymsControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index to set the value at. + * @param value The onewaySynonymsControlIds to set. + * @return This builder for chaining. + */ + public Builder setOnewaySynonymsControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param value The onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addOnewaySynonymsControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param values The onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllOnewaySynonymsControlIds(java.lang.Iterable values) { + ensureOnewaySynonymsControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onewaySynonymsControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return This builder for chaining. + */ + public Builder clearOnewaySynonymsControlIds() { + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param value The bytes of the onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addOnewaySynonymsControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList doNotAssociateControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDoNotAssociateControlIdsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = + new com.google.protobuf.LazyStringArrayList(doNotAssociateControlIds_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateControlIdsList() { + return doNotAssociateControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + public int getDoNotAssociateControlIdsCount() { + return doNotAssociateControlIds_.size(); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + public java.lang.String getDoNotAssociateControlIds(int index) { + return doNotAssociateControlIds_.get(index); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index) { + return doNotAssociateControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index to set the value at. + * @param value The doNotAssociateControlIds to set. + * @return This builder for chaining. + */ + public Builder setDoNotAssociateControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param value The doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param values The doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllDoNotAssociateControlIds(java.lang.Iterable values) { + ensureDoNotAssociateControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, doNotAssociateControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return This builder for chaining. + */ + public Builder clearDoNotAssociateControlIds() { + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param value The bytes of the doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList replacementControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureReplacementControlIdsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = + new com.google.protobuf.LazyStringArrayList(replacementControlIds_); + bitField0_ |= 0x00000080; + } + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + public com.google.protobuf.ProtocolStringList getReplacementControlIdsList() { + return replacementControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + public int getReplacementControlIdsCount() { + return replacementControlIds_.size(); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + public java.lang.String getReplacementControlIds(int index) { + return replacementControlIds_.get(index); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + public com.google.protobuf.ByteString getReplacementControlIdsBytes(int index) { + return replacementControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index to set the value at. + * @param value The replacementControlIds to set. + * @return This builder for chaining. + */ + public Builder setReplacementControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param value The replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addReplacementControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param values The replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllReplacementControlIds(java.lang.Iterable values) { + ensureReplacementControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replacementControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return This builder for chaining. + */ + public Builder clearReplacementControlIds() { + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param value The bytes of the replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addReplacementControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ignoreControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIgnoreControlIdsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = new com.google.protobuf.LazyStringArrayList(ignoreControlIds_); + bitField0_ |= 0x00000100; + } + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + public com.google.protobuf.ProtocolStringList getIgnoreControlIdsList() { + return ignoreControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + public int getIgnoreControlIdsCount() { + return ignoreControlIds_.size(); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + public java.lang.String getIgnoreControlIds(int index) { + return ignoreControlIds_.get(index); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + public com.google.protobuf.ByteString getIgnoreControlIdsBytes(int index) { + return ignoreControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index to set the value at. + * @param value The ignoreControlIds to set. + * @return This builder for chaining. + */ + public Builder setIgnoreControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param value The ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addIgnoreControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param values The ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreControlIds(java.lang.Iterable values) { + ensureIgnoreControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ignoreControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreControlIds() { + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param value The bytes of the ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addIgnoreControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object diversityLevel_ = ""; + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + public java.lang.String getDiversityLevel() { + java.lang.Object ref = diversityLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diversityLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + public com.google.protobuf.ByteString getDiversityLevelBytes() { + java.lang.Object ref = diversityLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diversityLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @param value The diversityLevel to set. + * @return This builder for chaining. + */ + public Builder setDiversityLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + diversityLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return This builder for chaining. + */ + public Builder clearDiversityLevel() { + + diversityLevel_ = getDefaultInstance().getDiversityLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @param value The bytes for diversityLevel to set. + * @return This builder for chaining. + */ + public Builder setDiversityLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + diversityLevel_ = value; + onChanged(); + return this; + } + + private java.lang.Object enableCategoryFilterLevel_ = ""; + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + public java.lang.String getEnableCategoryFilterLevel() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enableCategoryFilterLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enableCategoryFilterLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @param value The enableCategoryFilterLevel to set. + * @return This builder for chaining. + */ + public Builder setEnableCategoryFilterLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + enableCategoryFilterLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return This builder for chaining. + */ + public Builder clearEnableCategoryFilterLevel() { + + enableCategoryFilterLevel_ = getDefaultInstance().getEnableCategoryFilterLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @param value The bytes for enableCategoryFilterLevel to set. + * @return This builder for chaining. + */ + public Builder setEnableCategoryFilterLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + enableCategoryFilterLevel_ = value; + onChanged(); + return this; + } + + private java.util.List solutionTypes_ = java.util.Collections.emptyList(); + + private void ensureSolutionTypesIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(solutionTypes_); + bitField0_ |= 0x00000200; + } + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2alpha.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + public com.google.cloud.retail.v2alpha.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(index)); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index to set the value at. + * @param value The solutionTypes to set. + * @return This builder for chaining. + */ + public Builder setSolutionTypes(int index, com.google.cloud.retail.v2alpha.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypes(com.google.cloud.retail.v2alpha.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypes( + java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (com.google.cloud.retail.v2alpha.SolutionType value : values) { + solutionTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearSolutionTypes() { + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + public java.util.List getSolutionTypesValueList() { + return java.util.Collections.unmodifiableList(solutionTypes_); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(index); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + * @return This builder for chaining. + */ + public Builder setSolutionTypesValue(int index, int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypesValue(int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The enum numeric values on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypesValue(java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (int value : values) { + solutionTypes_.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.v2alpha.ServingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ServingConfig) + private static final com.google.cloud.retail.v2alpha.ServingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ServingConfig(); + } + + public static com.google.cloud.retail.v2alpha.ServingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServingConfig(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.v2alpha.ServingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigName.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigName.java new file mode 100644 index 00000000..7afbc108 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigName.java @@ -0,0 +1,269 @@ +/* + * 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.v2alpha; + +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 ServingConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_SERVING_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String servingConfig; + + @Deprecated + protected ServingConfigName() { + project = null; + location = null; + catalog = null; + servingConfig = null; + } + + private ServingConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + servingConfig = Preconditions.checkNotNull(builder.getServingConfig()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getServingConfig() { + return servingConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServingConfigName of( + String project, String location, String catalog, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setServingConfig(servingConfig) + .build(); + } + + public static String format( + String project, String location, String catalog, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + public static ServingConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_SERVING_CONFIG.validatedMatch( + formattedString, "ServingConfigName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("serving_config")); + } + + 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 (ServingConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_SERVING_CONFIG.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 (servingConfig != null) { + fieldMapBuilder.put("serving_config", servingConfig); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_SERVING_CONFIG.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "serving_config", + servingConfig); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ServingConfigName that = ((ServingConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.servingConfig, that.servingConfig); + } + 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(servingConfig); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}. + */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String servingConfig; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getServingConfig() { + return servingConfig; + } + + 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 setServingConfig(String servingConfig) { + this.servingConfig = servingConfig; + return this; + } + + private Builder(ServingConfigName servingConfigName) { + this.project = servingConfigName.project; + this.location = servingConfigName.location; + this.catalog = servingConfigName.catalog; + this.servingConfig = servingConfigName.servingConfig; + } + + public ServingConfigName build() { + return new ServingConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigOrBuilder.java new file mode 100644 index 00000000..8347fd13 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigOrBuilder.java @@ -0,0 +1,1160 @@ +/* + * 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/v2alpha/serving_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ServingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ServingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + java.lang.String getModelId(); + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + com.google.protobuf.ByteString getModelIdBytes(); + + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + java.lang.String getPriceRerankingLevel(); + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + com.google.protobuf.ByteString getPriceRerankingLevelBytes(); + + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + java.util.List getFacetControlIdsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + int getFacetControlIdsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + java.lang.String getFacetControlIds(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + com.google.protobuf.ByteString getFacetControlIdsBytes(int index); + + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return Whether the dynamicFacetSpec field is set. + */ + boolean hasDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return The dynamicFacetSpec. + */ + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec getDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * .google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + com.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder(); + + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + java.util.List getBoostControlIdsList(); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + int getBoostControlIdsCount(); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + java.lang.String getBoostControlIds(int index); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + com.google.protobuf.ByteString getBoostControlIdsBytes(int index); + + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + java.util.List getFilterControlIdsList(); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + int getFilterControlIdsCount(); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + java.lang.String getFilterControlIds(int index); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + com.google.protobuf.ByteString getFilterControlIdsBytes(int index); + + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + java.util.List getRedirectControlIdsList(); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + int getRedirectControlIdsCount(); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + java.lang.String getRedirectControlIds(int index); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + com.google.protobuf.ByteString getRedirectControlIdsBytes(int index); + + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + java.util.List getTwowaySynonymsControlIdsList(); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + int getTwowaySynonymsControlIdsCount(); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + java.lang.String getTwowaySynonymsControlIds(int index); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index); + + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + java.util.List getOnewaySynonymsControlIdsList(); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + int getOnewaySynonymsControlIdsCount(); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + java.lang.String getOnewaySynonymsControlIds(int index); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index); + + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + java.util.List getDoNotAssociateControlIdsList(); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + int getDoNotAssociateControlIdsCount(); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + java.lang.String getDoNotAssociateControlIds(int index); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index); + + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + java.util.List getReplacementControlIdsList(); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + int getReplacementControlIdsCount(); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + java.lang.String getReplacementControlIds(int index); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + com.google.protobuf.ByteString getReplacementControlIdsBytes(int index); + + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + java.util.List getIgnoreControlIdsList(); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + int getIgnoreControlIdsCount(); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + java.lang.String getIgnoreControlIds(int index); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + com.google.protobuf.ByteString getDiversityLevelBytes(); + + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + java.lang.String getEnableCategoryFilterLevel(); + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes(); + + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + java.util.List getSolutionTypesList(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + int getSolutionTypesCount(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + com.google.cloud.retail.v2alpha.SolutionType getSolutionTypes(int index); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + java.util.List getSolutionTypesValueList(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + int getSolutionTypesValue(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigProto.java new file mode 100644 index 00000000..34cfd94b --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigProto.java @@ -0,0 +1,121 @@ +/* + * 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/v2alpha/serving_config.proto + +package com.google.cloud.retail.v2alpha; + +public final class ServingConfigProto { + private ServingConfigProto() {} + + 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_v2alpha_ServingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ServingConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/retail/v2alpha/serving_co" + + "nfig.proto\022\033google.cloud.retail.v2alpha\032" + + "\037google/api/field_behavior.proto\032\031google" + + "/api/resource.proto\032(google/cloud/retail" + + "/v2alpha/common.proto\0320google/cloud/reta" + + "il/v2alpha/search_service.proto\"\366\005\n\rServ" + + "ingConfig\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\025pri" + + "ce_reranking_level\030\004 \001(\t\022\031\n\021facet_contro" + + "l_ids\030\005 \003(\t\022W\n\022dynamic_facet_spec\030\006 \001(\0132" + + ";.google.cloud.retail.v2alpha.SearchRequ" + + "est.DynamicFacetSpec\022\031\n\021boost_control_id" + + "s\030\007 \003(\t\022\032\n\022filter_control_ids\030\t \003(\t\022\034\n\024r" + + "edirect_control_ids\030\n \003(\t\022#\n\033twoway_syno" + + "nyms_control_ids\030\022 \003(\t\022#\n\033oneway_synonym" + + "s_control_ids\030\014 \003(\t\022$\n\034do_not_associate_" + + "control_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\017diversity_level\030\010 \001(\t\022$\n\034enable_catego" + + "ry_filter_level\030\020 \001(\t\022I\n\016solution_types\030" + + "\023 \003(\0162).google.cloud.retail.v2alpha.Solu" + + "tionTypeB\006\340A\002\340A\005:\205\001\352A\201\001\n#retail.googleap" + + "is.com/ServingConfig\022Zprojects/{project}" + + "/locations/{location}/catalogs/{catalog}" + + "/servingConfigs/{serving_config}B\340\001\n\037com" + + ".google.cloud.retail.v2alphaB\022ServingCon" + + "figProtoP\001ZAgoogle.golang.org/genproto/g" + + "oogleapis/cloud/retail/v2alpha;retail\242\002\006" + + "RETAIL\252\002\033Google.Cloud.Retail.V2Alpha\312\002\033G" + + "oogle\\Cloud\\Retail\\V2alpha\352\002\036Google::Clo" + + "ud::Retail::V2alphab\006proto3" + }; + 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.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.SearchServiceProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_ServingConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_ServingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ServingConfig_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "ModelId", + "PriceRerankingLevel", + "FacetControlIds", + "DynamicFacetSpec", + "BoostControlIds", + "FilterControlIds", + "RedirectControlIds", + "TwowaySynonymsControlIds", + "OnewaySynonymsControlIds", + "DoNotAssociateControlIds", + "ReplacementControlIds", + "IgnoreControlIds", + "DiversityLevel", + "EnableCategoryFilterLevel", + "SolutionTypes", + }); + 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.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.SearchServiceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceProto.java new file mode 100644 index 00000000..e38ed1d4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceProto.java @@ -0,0 +1,250 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class ServingConfigServiceProto { + private ServingConfigServiceProto() {} + + 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_v2alpha_CreateServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_AddControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n8google/cloud/retail/v2alpha/serving_co" + + "nfig_service.proto\022\033google.cloud.retail." + + "v2alpha\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\0320google/cloud/retail/v2alpha/serving_" + + "config.proto\032\033google/protobuf/empty.prot" + + "o\032 google/protobuf/field_mask.proto\"\274\001\n\032" + + "CreateServingConfigRequest\0225\n\006parent\030\001 \001" + + "(\tB%\340A\002\372A\037\n\035retail.googleapis.com/Catalo" + + "g\022G\n\016serving_config\030\002 \001(\0132*.google.cloud" + + ".retail.v2alpha.ServingConfigB\003\340A\002\022\036\n\021se" + + "rving_config_id\030\003 \001(\tB\003\340A\002\"\226\001\n\032UpdateSer" + + "vingConfigRequest\022G\n\016serving_config\030\001 \001(" + + "\0132*.google.cloud.retail.v2alpha.ServingC" + + "onfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\"W\n\032DeleteServingConf" + + "igRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#retail." + + "googleapis.com/ServingConfig\"T\n\027GetServi" + + "ngConfigRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#r" + + "etail.googleapis.com/ServingConfig\"\203\001\n\031L" + + "istServingConfigsRequest\0225\n\006parent\030\001 \001(\t" + + "B%\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\"z\n\032ListServingConfigsResponse\022C" + + "\n\017serving_configs\030\001 \003(\0132*.google.cloud.r" + + "etail.v2alpha.ServingConfig\022\027\n\017next_page" + + "_token\030\002 \001(\t\"q\n\021AddControlRequest\022C\n\016ser" + + "ving_config\030\001 \001(\tB+\340A\002\372A%\n#retail.google" + + "apis.com/ServingConfig\022\027\n\ncontrol_id\030\002 \001" + + "(\tB\003\340A\002\"t\n\024RemoveControlRequest\022C\n\016servi" + + "ng_config\030\001 \001(\tB+\340A\002\372A%\n#retail.googleap" + + "is.com/ServingConfig\022\027\n\ncontrol_id\030\002 \001(\t" + + "B\003\340A\0022\227\r\n\024ServingConfigService\022\201\002\n\023Creat" + + "eServingConfig\0227.google.cloud.retail.v2a" + + "lpha.CreateServingConfigRequest\032*.google" + + ".cloud.retail.v2alpha.ServingConfig\"\204\001\202\323" + + "\344\223\002T\"B/v2alpha/{parent=projects/*/locati" + + "ons/*/catalogs/*}/servingConfigs:\016servin" + + "g_config\332A\'parent,serving_config,serving" + + "_config_id\022\271\001\n\023DeleteServingConfig\0227.goo" + + "gle.cloud.retail.v2alpha.DeleteServingCo" + + "nfigRequest\032\026.google.protobuf.Empty\"Q\202\323\344" + + "\223\002D*B/v2alpha/{name=projects/*/locations" + + "/*/catalogs/*/servingConfigs/*}\332A\004name\022\203" + + "\002\n\023UpdateServingConfig\0227.google.cloud.re" + + "tail.v2alpha.UpdateServingConfigRequest\032" + + "*.google.cloud.retail.v2alpha.ServingCon" + + "fig\"\206\001\202\323\344\223\002c2Q/v2alpha/{serving_config.n" + + "ame=projects/*/locations/*/catalogs/*/se" + + "rvingConfigs/*}:\016serving_config\332A\032servin" + + "g_config,update_mask\022\307\001\n\020GetServingConfi" + + "g\0224.google.cloud.retail.v2alpha.GetServi" + + "ngConfigRequest\032*.google.cloud.retail.v2" + + "alpha.ServingConfig\"Q\202\323\344\223\002D\022B/v2alpha/{n" + + "ame=projects/*/locations/*/catalogs/*/se" + + "rvingConfigs/*}\332A\004name\022\332\001\n\022ListServingCo" + + "nfigs\0226.google.cloud.retail.v2alpha.List" + + "ServingConfigsRequest\0327.google.cloud.ret" + + "ail.v2alpha.ListServingConfigsResponse\"S" + + "\202\323\344\223\002D\022B/v2alpha/{parent=projects/*/loca" + + "tions/*/catalogs/*}/servingConfigs\332A\006par" + + "ent\022\335\001\n\nAddControl\022..google.cloud.retail" + + ".v2alpha.AddControlRequest\032*.google.clou" + + "d.retail.v2alpha.ServingConfig\"s\202\323\344\223\002\\\"W" + + "/v2alpha/{serving_config=projects/*/loca" + + "tions/*/catalogs/*/servingConfigs/*}:add" + + "Control:\001*\332A\016serving_config\022\346\001\n\rRemoveCo" + + "ntrol\0221.google.cloud.retail.v2alpha.Remo" + + "veControlRequest\032*.google.cloud.retail.v" + + "2alpha.ServingConfig\"v\202\323\344\223\002_\"Z/v2alpha/{" + + "serving_config=projects/*/locations/*/ca" + + "talogs/*/servingConfigs/*}:removeControl" + + ":\001*\332A\016serving_config\032I\312A\025retail.googleap" + + "is.com\322A.https://www.googleapis.com/auth" + + "/cloud-platformB\347\001\n\037com.google.cloud.ret" + + "ail.v2alphaB\031ServingConfigServiceProtoP\001" + + "ZAgoogle.golang.org/genproto/googleapis/" + + "cloud/retail/v2alpha;retail\242\002\006RETAIL\252\002\033G" + + "oogle.Cloud.Retail.V2Alpha\312\002\033Google\\Clou" + + "d\\Retail\\V2alpha\352\002\036Google::Cloud::Retail" + + "::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ServingConfigProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CreateServingConfigRequest_descriptor, + new java.lang.String[] { + "Parent", "ServingConfig", "ServingConfigId", + }); + internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_DeleteServingConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_GetServingConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListServingConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ListServingConfigsResponse_descriptor, + new java.lang.String[] { + "ServingConfigs", "NextPageToken", + }); + internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_AddControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_AddControlRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "ControlId", + }); + internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RemoveControlRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "ControlId", + }); + 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); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ServingConfigProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequest.java new file mode 100644 index 00000000..851135c0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequest.java @@ -0,0 +1,1165 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message to set a specified branch as new default_branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetDefaultBranchRequest} + */ +public final class SetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SetDefaultBranchRequest) + SetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultBranchRequest.newBuilder() to construct. + private SetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultBranchRequest() { + catalog_ = ""; + branchId_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultBranchRequest( + 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(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branchId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = s; + break; + } + case 32: + { + force_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object branchId_; + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + @java.lang.Override + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + 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(); + branchId_ = s; + return s; + } + } + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + 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(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_; + /** + * + * + *
+   * If set to true, it permits switching to a branch with
+   * [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id]
+   * even if it has no sufficient active products.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branchId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branchId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + 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.v2alpha.SetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest other = + (com.google.cloud.retail.v2alpha.SetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getBranchId().equals(other.getBranchId())) return false; + if (!getNote().equals(other.getNote())) return false; + if (getForce() != other.getForce()) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + BRANCH_ID_FIELD_NUMBER; + hash = (53 * hash) + getBranchId().hashCode(); + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to set a specified branch as new default_branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SetDefaultBranchRequest) + com.google.cloud.retail.v2alpha.SetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.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(); + catalog_ = ""; + + branchId_ = ""; + + note_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetDefaultBranchRequest build() { + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2alpha.SetDefaultBranchRequest result = + new com.google.cloud.retail.v2alpha.SetDefaultBranchRequest(this); + result.catalog_ = catalog_; + result.branchId_ = branchId_; + result.note_ = note_; + result.force_ = force_; + 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.v2alpha.SetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.SetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2alpha.SetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getBranchId().isEmpty()) { + branchId_ = other.branchId_; + onChanged(); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.v2alpha.SetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object branchId_ = ""; + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branchId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranchId() { + + branchId_ = getDefaultInstance().getBranchId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branchId_ = value; + onChanged(); + return this; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = 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.v2alpha.SetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SetDefaultBranchRequest) + private static final com.google.cloud.retail.v2alpha.SetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2alpha.SetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultBranchRequest(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.v2alpha.SetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..8a32929c --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + java.lang.String getBranchId(); + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + com.google.protobuf.ByteString getBranchIdBytes(); + + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); + + /** + * + * + *
+   * If set to true, it permits switching to a branch with
+   * [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id]
+   * even if it has no sufficient active products.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadata.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadata.java new file mode 100644 index 00000000..a9e4515a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadata.java @@ -0,0 +1,462 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Metadata related to the progress of the SetInventory operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryMetadata} + */ +public final class SetInventoryMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SetInventoryMetadata) + SetInventoryMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryMetadata.newBuilder() to construct. + private SetInventoryMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryMetadata( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryMetadata.class, + com.google.cloud.retail.v2alpha.SetInventoryMetadata.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.v2alpha.SetInventoryMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SetInventoryMetadata other = + (com.google.cloud.retail.v2alpha.SetInventoryMetadata) 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.v2alpha.SetInventoryMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.SetInventoryMetadata 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 related to the progress of the SetInventory operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SetInventoryMetadata) + com.google.cloud.retail.v2alpha.SetInventoryMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryMetadata.class, + com.google.cloud.retail.v2alpha.SetInventoryMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SetInventoryMetadata.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SetInventoryMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryMetadata build() { + com.google.cloud.retail.v2alpha.SetInventoryMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryMetadata buildPartial() { + com.google.cloud.retail.v2alpha.SetInventoryMetadata result = + new com.google.cloud.retail.v2alpha.SetInventoryMetadata(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.v2alpha.SetInventoryMetadata) { + return mergeFrom((com.google.cloud.retail.v2alpha.SetInventoryMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SetInventoryMetadata other) { + if (other == com.google.cloud.retail.v2alpha.SetInventoryMetadata.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.v2alpha.SetInventoryMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SetInventoryMetadata) 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.v2alpha.SetInventoryMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SetInventoryMetadata) + private static final com.google.cloud.retail.v2alpha.SetInventoryMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SetInventoryMetadata(); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryMetadata(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.v2alpha.SetInventoryMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadataOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadataOrBuilder.java new file mode 100644 index 00000000..dad86fe6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryMetadataOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SetInventoryMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SetInventoryMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequest.java new file mode 100644 index 00000000..14738eb4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequest.java @@ -0,0 +1,1981 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryRequest} + */ +public final class SetInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SetInventoryRequest) + SetInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryRequest.newBuilder() to construct. + private SetInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryRequest( + 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.v2alpha.Product.Builder subBuilder = null; + if (inventory_ != null) { + subBuilder = inventory_.toBuilder(); + } + inventory_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inventory_); + inventory_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (setMask_ != null) { + subBuilder = setMask_.toBuilder(); + } + setMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setMask_); + setMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + allowMissing_ = 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryRequest.class, + com.google.cloud.retail.v2alpha.SetInventoryRequest.Builder.class); + } + + public static final int INVENTORY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Product inventory_; + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + @java.lang.Override + public boolean hasInventory() { + return inventory_ != null; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getInventory() { + return inventory_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : inventory_; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getInventoryOrBuilder() { + return getInventory(); + } + + public static final int SET_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask setMask_; + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + @java.lang.Override + public boolean hasSetMask() { + return setMask_ != null; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getSetMask() { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + return getSetMask(); + } + + public static final int SET_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with
+   * name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found,
+   * the inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2alpha.Product] is created. If set
+   * to false, a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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 (inventory_ != null) { + output.writeMessage(1, getInventory()); + } + if (setMask_ != null) { + output.writeMessage(2, getSetMask()); + } + if (setTime_ != null) { + output.writeMessage(3, getSetTime()); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inventory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInventory()); + } + if (setMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetMask()); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSetTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + 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.v2alpha.SetInventoryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SetInventoryRequest other = + (com.google.cloud.retail.v2alpha.SetInventoryRequest) obj; + + if (hasInventory() != other.hasInventory()) return false; + if (hasInventory()) { + if (!getInventory().equals(other.getInventory())) return false; + } + if (hasSetMask() != other.hasSetMask()) return false; + if (hasSetMask()) { + if (!getSetMask().equals(other.getSetMask())) return false; + } + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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 (hasInventory()) { + hash = (37 * hash) + INVENTORY_FIELD_NUMBER; + hash = (53 * hash) + getInventory().hashCode(); + } + if (hasSetMask()) { + hash = (37 * hash) + SET_MASK_FIELD_NUMBER; + hash = (53 * hash) + getSetMask().hashCode(); + } + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.SetInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SetInventoryRequest) + com.google.cloud.retail.v2alpha.SetInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryRequest.class, + com.google.cloud.retail.v2alpha.SetInventoryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SetInventoryRequest.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 (inventoryBuilder_ == null) { + inventory_ = null; + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + if (setMaskBuilder_ == null) { + setMask_ = null; + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SetInventoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryRequest build() { + com.google.cloud.retail.v2alpha.SetInventoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryRequest buildPartial() { + com.google.cloud.retail.v2alpha.SetInventoryRequest result = + new com.google.cloud.retail.v2alpha.SetInventoryRequest(this); + if (inventoryBuilder_ == null) { + result.inventory_ = inventory_; + } else { + result.inventory_ = inventoryBuilder_.build(); + } + if (setMaskBuilder_ == null) { + result.setMask_ = setMask_; + } else { + result.setMask_ = setMaskBuilder_.build(); + } + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.SetInventoryRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.SetInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SetInventoryRequest other) { + if (other == com.google.cloud.retail.v2alpha.SetInventoryRequest.getDefaultInstance()) + return this; + if (other.hasInventory()) { + mergeInventory(other.getInventory()); + } + if (other.hasSetMask()) { + mergeSetMask(other.getSetMask()); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.SetInventoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SetInventoryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Product inventory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + inventoryBuilder_; + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + public boolean hasInventory() { + return inventoryBuilder_ != null || inventory_ != null; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + public com.google.cloud.retail.v2alpha.Product getInventory() { + if (inventoryBuilder_ == null) { + return inventory_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : inventory_; + } else { + return inventoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2alpha.Product value) { + if (inventoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inventory_ = value; + onChanged(); + } else { + inventoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (inventoryBuilder_ == null) { + inventory_ = builderForValue.build(); + onChanged(); + } else { + inventoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInventory(com.google.cloud.retail.v2alpha.Product value) { + if (inventoryBuilder_ == null) { + if (inventory_ != null) { + inventory_ = + com.google.cloud.retail.v2alpha.Product.newBuilder(inventory_) + .mergeFrom(value) + .buildPartial(); + } else { + inventory_ = value; + } + onChanged(); + } else { + inventoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInventory() { + if (inventoryBuilder_ == null) { + inventory_ = null; + onChanged(); + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getInventoryBuilder() { + + onChanged(); + return getInventoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getInventoryOrBuilder() { + if (inventoryBuilder_ != null) { + return inventoryBuilder_.getMessageOrBuilder(); + } else { + return inventory_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : inventory_; + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product] named in
+     * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+     * existing inventory information, the provided inventory information will be
+     * merged while respecting the last update time for each inventory field,
+     * using the provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getInventoryFieldBuilder() { + if (inventoryBuilder_ == null) { + inventoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + getInventory(), getParentForChildren(), isClean()); + inventory_ = null; + } + return inventoryBuilder_; + } + + private com.google.protobuf.FieldMask setMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + setMaskBuilder_; + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + public boolean hasSetMask() { + return setMaskBuilder_ != null || setMask_ != null; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + public com.google.protobuf.FieldMask getSetMask() { + if (setMaskBuilder_ == null) { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } else { + return setMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setMask_ = value; + onChanged(); + } else { + setMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (setMaskBuilder_ == null) { + setMask_ = builderForValue.build(); + onChanged(); + } else { + setMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder mergeSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (setMask_ != null) { + setMask_ = + com.google.protobuf.FieldMask.newBuilder(setMask_).mergeFrom(value).buildPartial(); + } else { + setMask_ = value; + } + onChanged(); + } else { + setMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder clearSetMask() { + if (setMaskBuilder_ == null) { + setMask_ = null; + onChanged(); + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getSetMaskBuilder() { + + onChanged(); + return getSetMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + if (setMaskBuilder_ != null) { + return setMaskBuilder_.getMessageOrBuilder(); + } else { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getSetMaskFieldBuilder() { + if (setMaskBuilder_ == null) { + setMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getSetMask(), getParentForChildren(), isClean()); + setMask_ = null; + } + return setMaskBuilder_; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with
+     * name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2alpha.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with
+     * name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2alpha.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with
+     * name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2alpha.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2alpha.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.SetInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SetInventoryRequest) + private static final com.google.cloud.retail.v2alpha.SetInventoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SetInventoryRequest(); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryRequest(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.v2alpha.SetInventoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequestOrBuilder.java new file mode 100644 index 00000000..272b5383 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryRequestOrBuilder.java @@ -0,0 +1,298 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SetInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SetInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + boolean hasInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + com.google.cloud.retail.v2alpha.Product getInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product] named in
+   * [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update has
+   * existing inventory information, the provided inventory information will be
+   * merged while respecting the last update time for each inventory field,
+   * using the provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2alpha.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getInventoryOrBuilder(); + + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + boolean hasSetMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + com.google.protobuf.FieldMask getSetMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder(); + + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with
+   * name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found,
+   * the inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2alpha.Product] is created. If set
+   * to false, a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2alpha.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponse.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponse.java new file mode 100644 index 00000000..b27674c4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponse.java @@ -0,0 +1,462 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the SetInventoryRequest.  Currently empty because
+ * there is no meaningful response populated from the [SetInventory][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryResponse} + */ +public final class SetInventoryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.SetInventoryResponse) + SetInventoryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryResponse.newBuilder() to construct. + private SetInventoryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryResponse( + 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryResponse.class, + com.google.cloud.retail.v2alpha.SetInventoryResponse.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.v2alpha.SetInventoryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.SetInventoryResponse other = + (com.google.cloud.retail.v2alpha.SetInventoryResponse) 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.v2alpha.SetInventoryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.SetInventoryResponse 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 SetInventoryRequest.  Currently empty because
+   * there is no meaningful response populated from the [SetInventory][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.SetInventoryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.SetInventoryResponse) + com.google.cloud.retail.v2alpha.SetInventoryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.SetInventoryResponse.class, + com.google.cloud.retail.v2alpha.SetInventoryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.SetInventoryResponse.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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_SetInventoryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.SetInventoryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryResponse build() { + com.google.cloud.retail.v2alpha.SetInventoryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.SetInventoryResponse buildPartial() { + com.google.cloud.retail.v2alpha.SetInventoryResponse result = + new com.google.cloud.retail.v2alpha.SetInventoryResponse(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.v2alpha.SetInventoryResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.SetInventoryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.SetInventoryResponse other) { + if (other == com.google.cloud.retail.v2alpha.SetInventoryResponse.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.v2alpha.SetInventoryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.SetInventoryResponse) 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.v2alpha.SetInventoryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.SetInventoryResponse) + private static final com.google.cloud.retail.v2alpha.SetInventoryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.SetInventoryResponse(); + } + + public static com.google.cloud.retail.v2alpha.SetInventoryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryResponse(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.v2alpha.SetInventoryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponseOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponseOrBuilder.java new file mode 100644 index 00000000..1eb1e952 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SetInventoryResponseOrBuilder.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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface SetInventoryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.SetInventoryResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SolutionType.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SolutionType.java new file mode 100644 index 00000000..3af05eb0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/SolutionType.java @@ -0,0 +1,176 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The type of solution.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2alpha.SolutionType} + */ +public enum SolutionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default value.
+   * 
+ * + * SOLUTION_TYPE_UNSPECIFIED = 0; + */ + SOLUTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Used for Recommendations AI.
+   * 
+ * + * SOLUTION_TYPE_RECOMMENDATION = 1; + */ + SOLUTION_TYPE_RECOMMENDATION(1), + /** + * + * + *
+   * Used for Retail Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + SOLUTION_TYPE_SEARCH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Default value.
+   * 
+ * + * SOLUTION_TYPE_UNSPECIFIED = 0; + */ + public static final int SOLUTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Used for Recommendations AI.
+   * 
+ * + * SOLUTION_TYPE_RECOMMENDATION = 1; + */ + public static final int SOLUTION_TYPE_RECOMMENDATION_VALUE = 1; + /** + * + * + *
+   * Used for Retail Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + public static final int SOLUTION_TYPE_SEARCH_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 SolutionType 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 SolutionType forNumber(int value) { + switch (value) { + case 0: + return SOLUTION_TYPE_UNSPECIFIED; + case 1: + return SOLUTION_TYPE_RECOMMENDATION; + case 2: + return SOLUTION_TYPE_SEARCH; + 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 SolutionType findValueByNumber(int number) { + return SolutionType.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.v2alpha.CommonProto.getDescriptor().getEnumTypes().get(1); + } + + private static final SolutionType[] VALUES = values(); + + public static SolutionType 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 SolutionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2alpha.SolutionType) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequest.java new file mode 100644 index 00000000..96987a66 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequest.java @@ -0,0 +1,1102 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} + */ +public final class UpdateAttributesConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + UpdateAttributesConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAttributesConfigRequest.newBuilder() to construct. + private UpdateAttributesConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAttributesConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAttributesConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAttributesConfigRequest( + 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.v2alpha.AttributesConfig.Builder subBuilder = null; + if (attributesConfig_ != null) { + subBuilder = attributesConfig_.toBuilder(); + } + attributesConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.AttributesConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attributesConfig_); + attributesConfig_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.AttributesConfig attributesConfig_; + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + @java.lang.Override + public boolean hasAttributesConfig() { + return attributesConfig_ != null; + } + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributesConfig getAttributesConfig() { + return attributesConfig_ == null + ? com.google.cloud.retail.v2alpha.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder getAttributesConfigOrBuilder() { + return getAttributesConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (attributesConfig_ != null) { + output.writeMessage(1, getAttributesConfig()); + } + 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 (attributesConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAttributesConfig()); + } + 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.v2alpha.UpdateAttributesConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest other = + (com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) obj; + + if (hasAttributesConfig() != other.hasAttributesConfig()) return false; + if (hasAttributesConfig()) { + if (!getAttributesConfig().equals(other.getAttributesConfig())) 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 (hasAttributesConfig()) { + hash = (37 * hash) + ATTRIBUTES_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAttributesConfig().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.v2alpha.UpdateAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest 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.UpdateAttributesConfig][google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.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 (attributesConfigBuilder_ == null) { + attributesConfig_ = null; + } else { + attributesConfig_ = null; + attributesConfigBuilder_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest build() { + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest result = + new com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(this); + if (attributesConfigBuilder_ == null) { + result.attributesConfig_ = attributesConfig_; + } else { + result.attributesConfig_ = attributesConfigBuilder_.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.v2alpha.UpdateAttributesConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest other) { + if (other + == com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.getDefaultInstance()) + return this; + if (other.hasAttributesConfig()) { + mergeAttributesConfig(other.getAttributesConfig()); + } + 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.v2alpha.UpdateAttributesConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.AttributesConfig attributesConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.AttributesConfig, + com.google.cloud.retail.v2alpha.AttributesConfig.Builder, + com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder> + attributesConfigBuilder_; + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + public boolean hasAttributesConfig() { + return attributesConfigBuilder_ != null || attributesConfig_ != null; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + public com.google.cloud.retail.v2alpha.AttributesConfig getAttributesConfig() { + if (attributesConfigBuilder_ == null) { + return attributesConfig_ == null + ? com.google.cloud.retail.v2alpha.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } else { + return attributesConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributesConfig(com.google.cloud.retail.v2alpha.AttributesConfig value) { + if (attributesConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributesConfig_ = value; + onChanged(); + } else { + attributesConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributesConfig( + com.google.cloud.retail.v2alpha.AttributesConfig.Builder builderForValue) { + if (attributesConfigBuilder_ == null) { + attributesConfig_ = builderForValue.build(); + onChanged(); + } else { + attributesConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttributesConfig(com.google.cloud.retail.v2alpha.AttributesConfig value) { + if (attributesConfigBuilder_ == null) { + if (attributesConfig_ != null) { + attributesConfig_ = + com.google.cloud.retail.v2alpha.AttributesConfig.newBuilder(attributesConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + attributesConfig_ = value; + } + onChanged(); + } else { + attributesConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAttributesConfig() { + if (attributesConfigBuilder_ == null) { + attributesConfig_ = null; + onChanged(); + } else { + attributesConfig_ = null; + attributesConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.AttributesConfig.Builder getAttributesConfigBuilder() { + + onChanged(); + return getAttributesConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder + getAttributesConfigOrBuilder() { + if (attributesConfigBuilder_ != null) { + return attributesConfigBuilder_.getMessageOrBuilder(); + } else { + return attributesConfig_ == null + ? com.google.cloud.retail.v2alpha.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.AttributesConfig, + com.google.cloud.retail.v2alpha.AttributesConfig.Builder, + com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder> + getAttributesConfigFieldBuilder() { + if (attributesConfigBuilder_ == null) { + attributesConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.AttributesConfig, + com.google.cloud.retail.v2alpha.AttributesConfig.Builder, + com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder>( + getAttributesConfig(), getParentForChildren(), isClean()); + attributesConfig_ = null; + } + return attributesConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.v2alpha.UpdateAttributesConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + private static final com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAttributesConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAttributesConfigRequest(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.v2alpha.UpdateAttributesConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequestOrBuilder.java new file mode 100644 index 00000000..73bc36f1 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateAttributesConfigRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateAttributesConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + boolean hasAttributesConfig(); + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + com.google.cloud.retail.v2alpha.AttributesConfig getAttributesConfig(); + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.AttributesConfigOrBuilder getAttributesConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequest.java new file mode 100644 index 00000000..1c1fc255 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequest.java @@ -0,0 +1,1131 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.UpdateCatalog][google.cloud.retail.v2alpha.CatalogService.UpdateCatalog]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateCatalogRequest} + */ +public final class UpdateCatalogRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateCatalogRequest) + UpdateCatalogRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCatalogRequest.newBuilder() to construct. + private UpdateCatalogRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCatalogRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCatalogRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCatalogRequest( + 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.v2alpha.Catalog.Builder subBuilder = null; + if (catalog_ != null) { + subBuilder = catalog_.toBuilder(); + } + catalog_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Catalog.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalog_); + catalog_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest.class, + com.google.cloud.retail.v2alpha.UpdateCatalogRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Catalog catalog_; + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + @java.lang.Override + public boolean hasCatalog() { + return catalog_ != null; + } + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Catalog getCatalog() { + return catalog_ == null + ? com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance() + : catalog_; + } + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogOrBuilder() { + return getCatalog(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (catalog_ != null) { + output.writeMessage(1, getCatalog()); + } + 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 (catalog_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCatalog()); + } + 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.v2alpha.UpdateCatalogRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateCatalogRequest other = + (com.google.cloud.retail.v2alpha.UpdateCatalogRequest) obj; + + if (hasCatalog() != other.hasCatalog()) return false; + if (hasCatalog()) { + if (!getCatalog().equals(other.getCatalog())) 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 (hasCatalog()) { + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().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.v2alpha.UpdateCatalogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UpdateCatalogRequest 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.UpdateCatalog][google.cloud.retail.v2alpha.CatalogService.UpdateCatalog]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateCatalogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateCatalogRequest) + com.google.cloud.retail.v2alpha.UpdateCatalogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateCatalogRequest.class, + com.google.cloud.retail.v2alpha.UpdateCatalogRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateCatalogRequest.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 (catalogBuilder_ == null) { + catalog_ = null; + } else { + catalog_ = null; + catalogBuilder_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCatalogRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateCatalogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCatalogRequest build() { + com.google.cloud.retail.v2alpha.UpdateCatalogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCatalogRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateCatalogRequest result = + new com.google.cloud.retail.v2alpha.UpdateCatalogRequest(this); + if (catalogBuilder_ == null) { + result.catalog_ = catalog_; + } else { + result.catalog_ = catalogBuilder_.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.v2alpha.UpdateCatalogRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateCatalogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateCatalogRequest other) { + if (other == com.google.cloud.retail.v2alpha.UpdateCatalogRequest.getDefaultInstance()) + return this; + if (other.hasCatalog()) { + mergeCatalog(other.getCatalog()); + } + 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.v2alpha.UpdateCatalogRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateCatalogRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Catalog catalog_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder> + catalogBuilder_; + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + public boolean hasCatalog() { + return catalogBuilder_ != null || catalog_ != null; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + public com.google.cloud.retail.v2alpha.Catalog getCatalog() { + if (catalogBuilder_ == null) { + return catalog_ == null + ? com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance() + : catalog_; + } else { + return catalogBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalog(com.google.cloud.retail.v2alpha.Catalog value) { + if (catalogBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalog_ = value; + onChanged(); + } else { + catalogBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalog(com.google.cloud.retail.v2alpha.Catalog.Builder builderForValue) { + if (catalogBuilder_ == null) { + catalog_ = builderForValue.build(); + onChanged(); + } else { + catalogBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalog(com.google.cloud.retail.v2alpha.Catalog value) { + if (catalogBuilder_ == null) { + if (catalog_ != null) { + catalog_ = + com.google.cloud.retail.v2alpha.Catalog.newBuilder(catalog_) + .mergeFrom(value) + .buildPartial(); + } else { + catalog_ = value; + } + onChanged(); + } else { + catalogBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalog() { + if (catalogBuilder_ == null) { + catalog_ = null; + onChanged(); + } else { + catalog_ = null; + catalogBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Catalog.Builder getCatalogBuilder() { + + onChanged(); + return getCatalogFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogOrBuilder() { + if (catalogBuilder_ != null) { + return catalogBuilder_.getMessageOrBuilder(); + } else { + return catalog_ == null + ? com.google.cloud.retail.v2alpha.Catalog.getDefaultInstance() + : catalog_; + } + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder> + getCatalogFieldBuilder() { + if (catalogBuilder_ == null) { + catalogBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Catalog, + com.google.cloud.retail.v2alpha.Catalog.Builder, + com.google.cloud.retail.v2alpha.CatalogOrBuilder>( + getCatalog(), getParentForChildren(), isClean()); + catalog_ = null; + } + return catalogBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.v2alpha.UpdateCatalogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateCatalogRequest) + private static final com.google.cloud.retail.v2alpha.UpdateCatalogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateCatalogRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateCatalogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCatalogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCatalogRequest(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.v2alpha.UpdateCatalogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequestOrBuilder.java new file mode 100644 index 00000000..3087e181 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCatalogRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateCatalogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateCatalogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + boolean hasCatalog(); + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + com.google.cloud.retail.v2alpha.Catalog getCatalog(); + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.CatalogOrBuilder getCatalogOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2alpha.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequest.java new file mode 100644 index 00000000..05d10ea0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequest.java @@ -0,0 +1,1198 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for
+ * [CatalogService.UpdateCompletionConfig][google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} + */ +public final class UpdateCompletionConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + UpdateCompletionConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCompletionConfigRequest.newBuilder() to construct. + private UpdateCompletionConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCompletionConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCompletionConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCompletionConfigRequest( + 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.v2alpha.CompletionConfig.Builder subBuilder = null; + if (completionConfig_ != null) { + subBuilder = completionConfig_.toBuilder(); + } + completionConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completionConfig_); + completionConfig_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.Builder.class); + } + + public static final int COMPLETION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.CompletionConfig completionConfig_; + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + @java.lang.Override + public boolean hasCompletionConfig() { + return completionConfig_ != null; + } + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionConfig getCompletionConfig() { + return completionConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionConfig.getDefaultInstance() + : completionConfig_; + } + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder getCompletionConfigOrBuilder() { + return getCompletionConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (completionConfig_ != null) { + output.writeMessage(1, getCompletionConfig()); + } + 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 (completionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCompletionConfig()); + } + 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.v2alpha.UpdateCompletionConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest other = + (com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) obj; + + if (hasCompletionConfig() != other.hasCompletionConfig()) return false; + if (hasCompletionConfig()) { + if (!getCompletionConfig().equals(other.getCompletionConfig())) 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 (hasCompletionConfig()) { + hash = (37 * hash) + COMPLETION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getCompletionConfig().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.v2alpha.UpdateCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest 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.UpdateCompletionConfig][google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.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 (completionConfigBuilder_ == null) { + completionConfig_ = null; + } else { + completionConfig_ = null; + completionConfigBuilder_ = 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.v2alpha.CatalogServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest build() { + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest result = + new com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(this); + if (completionConfigBuilder_ == null) { + result.completionConfig_ = completionConfig_; + } else { + result.completionConfig_ = completionConfigBuilder_.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.v2alpha.UpdateCompletionConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest other) { + if (other + == com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.getDefaultInstance()) + return this; + if (other.hasCompletionConfig()) { + mergeCompletionConfig(other.getCompletionConfig()); + } + 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.v2alpha.UpdateCompletionConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.CompletionConfig completionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionConfig, + com.google.cloud.retail.v2alpha.CompletionConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder> + completionConfigBuilder_; + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + public boolean hasCompletionConfig() { + return completionConfigBuilder_ != null || completionConfig_ != null; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + public com.google.cloud.retail.v2alpha.CompletionConfig getCompletionConfig() { + if (completionConfigBuilder_ == null) { + return completionConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionConfig.getDefaultInstance() + : completionConfig_; + } else { + return completionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCompletionConfig(com.google.cloud.retail.v2alpha.CompletionConfig value) { + if (completionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionConfig_ = value; + onChanged(); + } else { + completionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCompletionConfig( + com.google.cloud.retail.v2alpha.CompletionConfig.Builder builderForValue) { + if (completionConfigBuilder_ == null) { + completionConfig_ = builderForValue.build(); + onChanged(); + } else { + completionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCompletionConfig(com.google.cloud.retail.v2alpha.CompletionConfig value) { + if (completionConfigBuilder_ == null) { + if (completionConfig_ != null) { + completionConfig_ = + com.google.cloud.retail.v2alpha.CompletionConfig.newBuilder(completionConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + completionConfig_ = value; + } + onChanged(); + } else { + completionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCompletionConfig() { + if (completionConfigBuilder_ == null) { + completionConfig_ = null; + onChanged(); + } else { + completionConfig_ = null; + completionConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionConfig.Builder getCompletionConfigBuilder() { + + onChanged(); + return getCompletionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder + getCompletionConfigOrBuilder() { + if (completionConfigBuilder_ != null) { + return completionConfigBuilder_.getMessageOrBuilder(); + } else { + return completionConfig_ == null + ? com.google.cloud.retail.v2alpha.CompletionConfig.getDefaultInstance() + : completionConfig_; + } + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionConfig, + com.google.cloud.retail.v2alpha.CompletionConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder> + getCompletionConfigFieldBuilder() { + if (completionConfigBuilder_ == null) { + completionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionConfig, + com.google.cloud.retail.v2alpha.CompletionConfig.Builder, + com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder>( + getCompletionConfig(), getParentForChildren(), isClean()); + completionConfig_ = null; + } + return completionConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.v2alpha.UpdateCompletionConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + private static final com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCompletionConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCompletionConfigRequest(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.v2alpha.UpdateCompletionConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequestOrBuilder.java new file mode 100644 index 00000000..9d85ddf5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateCompletionConfigRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * 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/v2alpha/catalog_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateCompletionConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + boolean hasCompletionConfig(); + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + com.google.cloud.retail.v2alpha.CompletionConfig getCompletionConfig(); + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.CompletionConfigOrBuilder getCompletionConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequest.java new file mode 100644 index 00000000..40b0c00a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequest.java @@ -0,0 +1,1079 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for UpdateControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateControlRequest} + */ +public final class UpdateControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateControlRequest) + UpdateControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateControlRequest.newBuilder() to construct. + private UpdateControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateControlRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateControlRequest( + 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.v2alpha.Control.Builder subBuilder = null; + if (control_ != null) { + subBuilder = control_.toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Control.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(control_); + control_ = 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateControlRequest.class, + com.google.cloud.retail.v2alpha.UpdateControlRequest.Builder.class); + } + + public static final int CONTROL_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Control control_; + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + @java.lang.Override + public boolean hasControl() { + return control_ != null; + } + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Control getControl() { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder() { + return getControl(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (control_ != null) { + output.writeMessage(1, getControl()); + } + 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 (control_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getControl()); + } + 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.v2alpha.UpdateControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateControlRequest other = + (com.google.cloud.retail.v2alpha.UpdateControlRequest) obj; + + if (hasControl() != other.hasControl()) return false; + if (hasControl()) { + if (!getControl().equals(other.getControl())) 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 (hasControl()) { + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getControl().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.v2alpha.UpdateControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UpdateControlRequest 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 UpdateControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateControlRequest) + com.google.cloud.retail.v2alpha.UpdateControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateControlRequest.class, + com.google.cloud.retail.v2alpha.UpdateControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateControlRequest.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 (controlBuilder_ == null) { + control_ = null; + } else { + control_ = null; + controlBuilder_ = 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.v2alpha.ControlServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateControlRequest build() { + com.google.cloud.retail.v2alpha.UpdateControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateControlRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateControlRequest result = + new com.google.cloud.retail.v2alpha.UpdateControlRequest(this); + if (controlBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = controlBuilder_.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.v2alpha.UpdateControlRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateControlRequest other) { + if (other == com.google.cloud.retail.v2alpha.UpdateControlRequest.getDefaultInstance()) + return this; + if (other.hasControl()) { + mergeControl(other.getControl()); + } + 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.v2alpha.UpdateControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Control control_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + controlBuilder_; + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + public boolean hasControl() { + return controlBuilder_ != null || control_ != null; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + public com.google.cloud.retail.v2alpha.Control getControl() { + if (controlBuilder_ == null) { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } else { + return controlBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2alpha.Control value) { + if (controlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + controlBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2alpha.Control.Builder builderForValue) { + if (controlBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + controlBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeControl(com.google.cloud.retail.v2alpha.Control value) { + if (controlBuilder_ == null) { + if (control_ != null) { + control_ = + com.google.cloud.retail.v2alpha.Control.newBuilder(control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + controlBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearControl() { + if (controlBuilder_ == null) { + control_ = null; + onChanged(); + } else { + control_ = null; + controlBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Control.Builder getControlBuilder() { + + onChanged(); + return getControlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder() { + if (controlBuilder_ != null) { + return controlBuilder_.getMessageOrBuilder(); + } else { + return control_ == null + ? com.google.cloud.retail.v2alpha.Control.getDefaultInstance() + : control_; + } + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder> + getControlFieldBuilder() { + if (controlBuilder_ == null) { + controlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Control, + com.google.cloud.retail.v2alpha.Control.Builder, + com.google.cloud.retail.v2alpha.ControlOrBuilder>( + getControl(), getParentForChildren(), isClean()); + control_ = null; + } + return controlBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.v2alpha.UpdateControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateControlRequest) + private static final com.google.cloud.retail.v2alpha.UpdateControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateControlRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateControlRequest(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.v2alpha.UpdateControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequestOrBuilder.java new file mode 100644 index 00000000..bfd91656 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateControlRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/v2alpha/control_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + boolean hasControl(); + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + com.google.cloud.retail.v2alpha.Control getControl(); + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ControlOrBuilder getControlOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2alpha.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2alpha.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequest.java new file mode 100644 index 00000000..10d71a16 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequest.java @@ -0,0 +1,1273 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for [UpdateProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateProductRequest} + */ +public final class UpdateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateProductRequest) + UpdateProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateProductRequest.newBuilder() to construct. + private UpdateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateProductRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateProductRequest( + 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.v2alpha.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2alpha.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = 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; + } + case 24: + { + allowMissing_ = 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.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateProductRequest.class, + com.google.cloud.retail.v2alpha.UpdateProductRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.Product product_; + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, a new [Product][google.cloud.retail.v2alpha.Product] will be
+   * created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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 (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + 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.v2alpha.UpdateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateProductRequest other = + (com.google.cloud.retail.v2alpha.UpdateProductRequest) obj; + + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UpdateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [UpdateProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateProductRequest) + com.google.cloud.retail.v2alpha.UpdateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateProductRequest.class, + com.google.cloud.retail.v2alpha.UpdateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateProductRequest.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ProductServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateProductRequest build() { + com.google.cloud.retail.v2alpha.UpdateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateProductRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateProductRequest result = + new com.google.cloud.retail.v2alpha.UpdateProductRequest(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.v2alpha.UpdateProductRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateProductRequest other) { + if (other == com.google.cloud.retail.v2alpha.UpdateProductRequest.getDefaultInstance()) + return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.v2alpha.UpdateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2alpha.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2alpha.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2alpha.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2alpha.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2alpha.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+     * not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.Product, + com.google.cloud.retail.v2alpha.Product.Builder, + com.google.cloud.retail.v2alpha.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, a new [Product][google.cloud.retail.v2alpha.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, a new [Product][google.cloud.retail.v2alpha.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+     * not found, a new [Product][google.cloud.retail.v2alpha.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.v2alpha.UpdateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateProductRequest) + private static final com.google.cloud.retail.v2alpha.UpdateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateProductRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProductRequest(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.v2alpha.UpdateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequestOrBuilder.java new file mode 100644 index 00000000..7130a777 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateProductRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/v2alpha/product_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2alpha.Product getProduct(); + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
+   * not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2alpha.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is
+   * not found, a new [Product][google.cloud.retail.v2alpha.Product] will be
+   * created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequest.java new file mode 100644 index 00000000..ace41026 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequest.java @@ -0,0 +1,1081 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request for UpdateServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateServingConfigRequest} + */ +public final class UpdateServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UpdateServingConfigRequest) + UpdateServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServingConfigRequest.newBuilder() to construct. + private UpdateServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServingConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServingConfigRequest( + 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.v2alpha.ServingConfig.Builder subBuilder = null; + if (servingConfig_ != null) { + subBuilder = servingConfig_.toBuilder(); + } + servingConfig_ = + input.readMessage( + com.google.cloud.retail.v2alpha.ServingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(servingConfig_); + servingConfig_ = 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2alpha.ServingConfig servingConfig_; + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + @java.lang.Override + public boolean hasServingConfig() { + return servingConfig_ != null; + } + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfig() { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder() { + return getServingConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (servingConfig_ != null) { + output.writeMessage(1, getServingConfig()); + } + 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 (servingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getServingConfig()); + } + 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.v2alpha.UpdateServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest other = + (com.google.cloud.retail.v2alpha.UpdateServingConfigRequest) obj; + + if (hasServingConfig() != other.hasServingConfig()) return false; + if (hasServingConfig()) { + if (!getServingConfig().equals(other.getServingConfig())) 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 (hasServingConfig()) { + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().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.v2alpha.UpdateServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest 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 UpdateServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UpdateServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UpdateServingConfigRequest) + com.google.cloud.retail.v2alpha.UpdateServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.class, + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.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 (servingConfigBuilder_ == null) { + servingConfig_ = null; + } else { + servingConfig_ = null; + servingConfigBuilder_ = 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.v2alpha.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2alpha_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateServingConfigRequest build() { + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UpdateServingConfigRequest buildPartial() { + com.google.cloud.retail.v2alpha.UpdateServingConfigRequest result = + new com.google.cloud.retail.v2alpha.UpdateServingConfigRequest(this); + if (servingConfigBuilder_ == null) { + result.servingConfig_ = servingConfig_; + } else { + result.servingConfig_ = servingConfigBuilder_.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.v2alpha.UpdateServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.UpdateServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UpdateServingConfigRequest other) { + if (other == com.google.cloud.retail.v2alpha.UpdateServingConfigRequest.getDefaultInstance()) + return this; + if (other.hasServingConfig()) { + mergeServingConfig(other.getServingConfig()); + } + 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.v2alpha.UpdateServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UpdateServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2alpha.ServingConfig servingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + servingConfigBuilder_; + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + public boolean hasServingConfig() { + return servingConfigBuilder_ != null || servingConfig_ != null; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + public com.google.cloud.retail.v2alpha.ServingConfig getServingConfig() { + if (servingConfigBuilder_ == null) { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } else { + return servingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig(com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + onChanged(); + } else { + servingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig( + com.google.cloud.retail.v2alpha.ServingConfig.Builder builderForValue) { + if (servingConfigBuilder_ == null) { + servingConfig_ = builderForValue.build(); + onChanged(); + } else { + servingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServingConfig(com.google.cloud.retail.v2alpha.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (servingConfig_ != null) { + servingConfig_ = + com.google.cloud.retail.v2alpha.ServingConfig.newBuilder(servingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + servingConfig_ = value; + } + onChanged(); + } else { + servingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServingConfig() { + if (servingConfigBuilder_ == null) { + servingConfig_ = null; + onChanged(); + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ServingConfig.Builder getServingConfigBuilder() { + + onChanged(); + return getServingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder() { + if (servingConfigBuilder_ != null) { + return servingConfigBuilder_.getMessageOrBuilder(); + } else { + return servingConfig_ == null + ? com.google.cloud.retail.v2alpha.ServingConfig.getDefaultInstance() + : servingConfig_; + } + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder> + getServingConfigFieldBuilder() { + if (servingConfigBuilder_ == null) { + servingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ServingConfig, + com.google.cloud.retail.v2alpha.ServingConfig.Builder, + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder>( + getServingConfig(), getParentForChildren(), isClean()); + servingConfig_ = null; + } + return servingConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.v2alpha.UpdateServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UpdateServingConfigRequest) + private static final com.google.cloud.retail.v2alpha.UpdateServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UpdateServingConfigRequest(); + } + + public static com.google.cloud.retail.v2alpha.UpdateServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServingConfigRequest(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.v2alpha.UpdateServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..10f060d0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UpdateServingConfigRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/v2alpha/serving_config_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface UpdateServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UpdateServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + boolean hasServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + com.google.cloud.retail.v2alpha.ServingConfig getServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.ServingConfigOrBuilder getServingConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEvent.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEvent.java new file mode 100644 index 00000000..e04da86d --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEvent.java @@ -0,0 +1,6368 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * UserEvent captures all metadata information Retail API needs to know about
+ * how end users interact with customers' website.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEvent} + */ +public final class UserEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UserEvent) + UserEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEvent.newBuilder() to construct. + private UserEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEvent() { + eventType_ = ""; + visitorId_ = ""; + sessionId_ = ""; + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + attributionToken_ = ""; + productDetails_ = java.util.Collections.emptyList(); + cartId_ = ""; + searchQuery_ = ""; + filter_ = ""; + orderBy_ = ""; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + uri_ = ""; + referrerUri_ = ""; + pageViewId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEvent( + 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(); + + eventType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (eventTime_ != null) { + subBuilder = eventTime_.toBuilder(); + } + eventTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTime_); + eventTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + experimentIds_.add(s); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + productDetails_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.ProductDetail.parser(), extensionRegistry)); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + cartId_ = s; + break; + } + case 74: + { + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder subBuilder = null; + if (purchaseTransaction_ != null) { + subBuilder = purchaseTransaction_.toBuilder(); + } + purchaseTransaction_ = + input.readMessage( + com.google.cloud.retail.v2alpha.PurchaseTransaction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(purchaseTransaction_); + purchaseTransaction_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + searchQuery_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + pageCategories_.add(s); + break; + } + case 98: + { + com.google.cloud.retail.v2alpha.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + + referrerUri_ = s; + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageViewId_ = s; + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 144: + { + offset_ = input.readInt32(); + break; + } + case 170: + { + java.lang.String s = input.readStringRequireUtf8(); + + sessionId_ = s; + break; + } + case 178: + { + com.google.cloud.retail.v2alpha.CompletionDetail.Builder subBuilder = null; + if (completionDetail_ != null) { + subBuilder = completionDetail_.toBuilder(); + } + completionDetail_ = + input.readMessage( + com.google.cloud.retail.v2alpha.CompletionDetail.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completionDetail_); + completionDetail_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEvent.class, + com.google.cloud.retail.v2alpha.UserEvent.Builder.class); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + @java.lang.Override + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + 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(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SESSION_ID_FIELD_NUMBER = 21; + private volatile java.lang.Object sessionId_; + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + @java.lang.Override + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + 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(); + sessionId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp eventTime_; + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + @java.lang.Override + public boolean hasEventTime() { + return eventTime_ != null; + } + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEventTime() { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + return getEventTime(); + } + + public static final int EXPERIMENT_IDS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList experimentIds_; + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_; + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_DETAILS_FIELD_NUMBER = 6; + private java.util.List productDetails_; + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + @java.lang.Override + public java.util.List getProductDetailsList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + @java.lang.Override + public java.util.List + getProductDetailsOrBuilderList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + @java.lang.Override + public int getProductDetailsCount() { + return productDetails_.size(); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductDetail getProductDetails(int index) { + return productDetails_.get(index); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ProductDetailOrBuilder getProductDetailsOrBuilder( + int index) { + return productDetails_.get(index); + } + + public static final int COMPLETION_DETAIL_FIELD_NUMBER = 22; + private com.google.cloud.retail.v2alpha.CompletionDetail completionDetail_; + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + @java.lang.Override + public boolean hasCompletionDetail() { + return completionDetail_ != null; + } + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDetail getCompletionDetail() { + return completionDetail_ == null + ? com.google.cloud.retail.v2alpha.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { + return getCompletionDetail(); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 7; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2alpha.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CART_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object cartId_; + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + @java.lang.Override + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + 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(); + cartId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PURCHASE_TRANSACTION_FIELD_NUMBER = 9; + private com.google.cloud.retail.v2alpha.PurchaseTransaction purchaseTransaction_; + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + @java.lang.Override + public boolean hasPurchaseTransaction() { + return purchaseTransaction_ != null; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurchaseTransaction getPurchaseTransaction() { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2alpha.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + return getPurchaseTransaction(); + } + + public static final int SEARCH_QUERY_FIELD_NUMBER = 10; + private volatile java.lang.Object searchQuery_; + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + @java.lang.Override + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + 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(); + searchQuery_ = s; + return s; + } + } + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 16; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 17; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 18; + private int offset_; + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See
+   * [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset]
+   * for definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 11; + private com.google.protobuf.LazyStringList pageCategories_; + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + + public static final int USER_INFO_FIELD_NUMBER = 12; + private com.google.cloud.retail.v2alpha.UserInfo userInfo_; + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int URI_FIELD_NUMBER = 13; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERRER_URI_FIELD_NUMBER = 14; + private volatile java.lang.Object referrerUri_; + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + @java.lang.Override + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + 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(); + referrerUri_ = s; + return s; + } + } + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_VIEW_ID_FIELD_NUMBER = 15; + private volatile java.lang.Object pageViewId_; + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + @java.lang.Override + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + 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(); + pageViewId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = 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(eventType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, visitorId_); + } + if (eventTime_ != null) { + output.writeMessage(3, getEventTime()); + } + for (int i = 0; i < experimentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, experimentIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); + } + for (int i = 0; i < productDetails_.size(); i++) { + output.writeMessage(6, productDetails_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 7); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, cartId_); + } + if (purchaseTransaction_ != null) { + output.writeMessage(9, getPurchaseTransaction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, searchQuery_); + } + for (int i = 0; i < pageCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, pageCategories_.getRaw(i)); + } + if (userInfo_ != null) { + output.writeMessage(12, getUserInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, referrerUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, pageViewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, orderBy_); + } + if (offset_ != 0) { + output.writeInt32(18, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 21, sessionId_); + } + if (completionDetail_ != null) { + output.writeMessage(22, getCompletionDetail()); + } + 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(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, visitorId_); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEventTime()); + } + { + int dataSize = 0; + for (int i = 0; i < experimentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(experimentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getExperimentIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); + } + for (int i = 0; i < productDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, productDetails_.get(i)); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, attributes__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, cartId_); + } + if (purchaseTransaction_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPurchaseTransaction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, searchQuery_); + } + { + int dataSize = 0; + for (int i = 0; i < pageCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); + } + size += dataSize; + size += 1 * getPageCategoriesList().size(); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUserInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, referrerUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, pageViewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, orderBy_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, sessionId_); + } + if (completionDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCompletionDetail()); + } + 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.v2alpha.UserEvent)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UserEvent other = + (com.google.cloud.retail.v2alpha.UserEvent) obj; + + if (!getEventType().equals(other.getEventType())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getSessionId().equals(other.getSessionId())) return false; + if (hasEventTime() != other.hasEventTime()) return false; + if (hasEventTime()) { + if (!getEventTime().equals(other.getEventTime())) return false; + } + if (!getExperimentIdsList().equals(other.getExperimentIdsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; + if (hasCompletionDetail() != other.hasCompletionDetail()) return false; + if (hasCompletionDetail()) { + if (!getCompletionDetail().equals(other.getCompletionDetail())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getCartId().equals(other.getCartId())) return false; + if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; + if (hasPurchaseTransaction()) { + if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) return false; + } + if (!getSearchQuery().equals(other.getSearchQuery())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (!getUri().equals(other.getUri())) return false; + if (!getReferrerUri().equals(other.getReferrerUri())) return false; + if (!getPageViewId().equals(other.getPageViewId())) 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) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + if (getExperimentIdsCount() > 0) { + hash = (37 * hash) + EXPERIMENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getExperimentIdsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getProductDetailsCount() > 0) { + hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getProductDetailsList().hashCode(); + } + if (hasCompletionDetail()) { + hash = (37 * hash) + COMPLETION_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getCompletionDetail().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + CART_ID_FIELD_NUMBER; + hash = (53 * hash) + getCartId().hashCode(); + if (hasPurchaseTransaction()) { + hash = (37 * hash) + PURCHASE_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getPurchaseTransaction().hashCode(); + } + hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSearchQuery().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + REFERRER_URI_FIELD_NUMBER; + hash = (53 * hash) + getReferrerUri().hashCode(); + hash = (37 * hash) + PAGE_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getPageViewId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UserEvent 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; + } + /** + * + * + *
+   * UserEvent captures all metadata information Retail API needs to know about
+   * how end users interact with customers' website.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UserEvent) + com.google.cloud.retail.v2alpha.UserEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEvent.class, + com.google.cloud.retail.v2alpha.UserEvent.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UserEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + eventType_ = ""; + + visitorId_ = ""; + + sessionId_ = ""; + + if (eventTimeBuilder_ == null) { + eventTime_ = null; + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + attributionToken_ = ""; + + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + productDetailsBuilder_.clear(); + } + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } + internalGetMutableAttributes().clear(); + cartId_ = ""; + + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + searchQuery_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + offset_ = 0; + + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + uri_ = ""; + + referrerUri_ = ""; + + pageViewId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventProto + .internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent build() { + com.google.cloud.retail.v2alpha.UserEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent buildPartial() { + com.google.cloud.retail.v2alpha.UserEvent result = + new com.google.cloud.retail.v2alpha.UserEvent(this); + int from_bitField0_ = bitField0_; + result.eventType_ = eventType_; + result.visitorId_ = visitorId_; + result.sessionId_ = sessionId_; + if (eventTimeBuilder_ == null) { + result.eventTime_ = eventTime_; + } else { + result.eventTime_ = eventTimeBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.experimentIds_ = experimentIds_; + result.attributionToken_ = attributionToken_; + if (productDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.productDetails_ = productDetails_; + } else { + result.productDetails_ = productDetailsBuilder_.build(); + } + if (completionDetailBuilder_ == null) { + result.completionDetail_ = completionDetail_; + } else { + result.completionDetail_ = completionDetailBuilder_.build(); + } + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.cartId_ = cartId_; + if (purchaseTransactionBuilder_ == null) { + result.purchaseTransaction_ = purchaseTransaction_; + } else { + result.purchaseTransaction_ = purchaseTransactionBuilder_.build(); + } + result.searchQuery_ = searchQuery_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + result.offset_ = offset_; + if (((bitField0_ & 0x00000008) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.pageCategories_ = pageCategories_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.uri_ = uri_; + result.referrerUri_ = referrerUri_; + result.pageViewId_ = pageViewId_; + 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.v2alpha.UserEvent) { + return mergeFrom((com.google.cloud.retail.v2alpha.UserEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UserEvent other) { + if (other == com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance()) return this; + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + onChanged(); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (!other.experimentIds_.isEmpty()) { + if (experimentIds_.isEmpty()) { + experimentIds_ = other.experimentIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExperimentIdsIsMutable(); + experimentIds_.addAll(other.experimentIds_); + } + onChanged(); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (productDetailsBuilder_ == null) { + if (!other.productDetails_.isEmpty()) { + if (productDetails_.isEmpty()) { + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureProductDetailsIsMutable(); + productDetails_.addAll(other.productDetails_); + } + onChanged(); + } + } else { + if (!other.productDetails_.isEmpty()) { + if (productDetailsBuilder_.isEmpty()) { + productDetailsBuilder_.dispose(); + productDetailsBuilder_ = null; + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + productDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductDetailsFieldBuilder() + : null; + } else { + productDetailsBuilder_.addAllMessages(other.productDetails_); + } + } + } + if (other.hasCompletionDetail()) { + mergeCompletionDetail(other.getCompletionDetail()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.getCartId().isEmpty()) { + cartId_ = other.cartId_; + onChanged(); + } + if (other.hasPurchaseTransaction()) { + mergePurchaseTransaction(other.getPurchaseTransaction()); + } + if (!other.getSearchQuery().isEmpty()) { + searchQuery_ = other.searchQuery_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getReferrerUri().isEmpty()) { + referrerUri_ = other.referrerUri_; + onChanged(); + } + if (!other.getPageViewId().isEmpty()) { + pageViewId_ = other.pageViewId_; + 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.v2alpha.UserEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.UserEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private java.lang.Object sessionId_ = ""; + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sessionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + + sessionId_ = getDefaultInstance().getSessionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sessionId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp eventTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder setEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTime_ = value; + onChanged(); + } else { + eventTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (eventTimeBuilder_ == null) { + eventTime_ = builderForValue.build(); + onChanged(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder mergeEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (eventTime_ != null) { + eventTime_ = + com.google.protobuf.Timestamp.newBuilder(eventTime_).mergeFrom(value).buildPartial(); + } else { + eventTime_ = value; + } + onChanged(); + } else { + eventTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder clearEventTime() { + if (eventTimeBuilder_ == null) { + eventTime_ = null; + onChanged(); + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + if (eventTimeBuilder_ != null) { + return eventTimeBuilder_.getMessageOrBuilder(); + } else { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEventTimeFieldBuilder() { + if (eventTimeBuilder_ == null) { + eventTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEventTime(), getParentForChildren(), isClean()); + eventTime_ = null; + } + return eventTimeBuilder_; + } + + private com.google.protobuf.LazyStringList experimentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExperimentIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(experimentIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index to set the value at. + * @param value The experimentIds to set. + * @return This builder for chaining. + */ + public Builder setExperimentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param value The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param values The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addAllExperimentIds(java.lang.Iterable values) { + ensureExperimentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, experimentIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearExperimentIds() { + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param value The bytes of the experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.util.List productDetails_ = + java.util.Collections.emptyList(); + + private void ensureProductDetailsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList(productDetails_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductDetail, + com.google.cloud.retail.v2alpha.ProductDetail.Builder, + com.google.cloud.retail.v2alpha.ProductDetailOrBuilder> + productDetailsBuilder_; + + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public java.util.List getProductDetailsList() { + if (productDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productDetails_); + } else { + return productDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public int getProductDetailsCount() { + if (productDetailsBuilder_ == null) { + return productDetails_.size(); + } else { + return productDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2alpha.ProductDetail getProductDetails(int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder setProductDetails( + int index, com.google.cloud.retail.v2alpha.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.set(index, value); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder setProductDetails( + int index, com.google.cloud.retail.v2alpha.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder addProductDetails(com.google.cloud.retail.v2alpha.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + int index, com.google.cloud.retail.v2alpha.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(index, value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + com.google.cloud.retail.v2alpha.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + int index, com.google.cloud.retail.v2alpha.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder addAllProductDetails( + java.lang.Iterable values) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); + onChanged(); + } else { + productDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder clearProductDetails() { + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + productDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public Builder removeProductDetails(int index) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.remove(index); + onChanged(); + } else { + productDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2alpha.ProductDetail.Builder getProductDetailsBuilder( + int index) { + return getProductDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2alpha.ProductDetailOrBuilder getProductDetailsOrBuilder( + int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public java.util.List + getProductDetailsOrBuilderList() { + if (productDetailsBuilder_ != null) { + return productDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productDetails_); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2alpha.ProductDetail.Builder addProductDetailsBuilder() { + return getProductDetailsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2alpha.ProductDetail.Builder addProductDetailsBuilder( + int index) { + return getProductDetailsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + public java.util.List + getProductDetailsBuilderList() { + return getProductDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductDetail, + com.google.cloud.retail.v2alpha.ProductDetail.Builder, + com.google.cloud.retail.v2alpha.ProductDetailOrBuilder> + getProductDetailsFieldBuilder() { + if (productDetailsBuilder_ == null) { + productDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.ProductDetail, + com.google.cloud.retail.v2alpha.ProductDetail.Builder, + com.google.cloud.retail.v2alpha.ProductDetailOrBuilder>( + productDetails_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + productDetails_ = null; + } + return productDetailsBuilder_; + } + + private com.google.cloud.retail.v2alpha.CompletionDetail completionDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDetail, + com.google.cloud.retail.v2alpha.CompletionDetail.Builder, + com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder> + completionDetailBuilder_; + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + public boolean hasCompletionDetail() { + return completionDetailBuilder_ != null || completionDetail_ != null; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + public com.google.cloud.retail.v2alpha.CompletionDetail getCompletionDetail() { + if (completionDetailBuilder_ == null) { + return completionDetail_ == null + ? com.google.cloud.retail.v2alpha.CompletionDetail.getDefaultInstance() + : completionDetail_; + } else { + return completionDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail(com.google.cloud.retail.v2alpha.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionDetail_ = value; + onChanged(); + } else { + completionDetailBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail( + com.google.cloud.retail.v2alpha.CompletionDetail.Builder builderForValue) { + if (completionDetailBuilder_ == null) { + completionDetail_ = builderForValue.build(); + onChanged(); + } else { + completionDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public Builder mergeCompletionDetail(com.google.cloud.retail.v2alpha.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (completionDetail_ != null) { + completionDetail_ = + com.google.cloud.retail.v2alpha.CompletionDetail.newBuilder(completionDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + completionDetail_ = value; + } + onChanged(); + } else { + completionDetailBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public Builder clearCompletionDetail() { + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + onChanged(); + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2alpha.CompletionDetail.Builder getCompletionDetailBuilder() { + + onChanged(); + return getCompletionDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder + getCompletionDetailOrBuilder() { + if (completionDetailBuilder_ != null) { + return completionDetailBuilder_.getMessageOrBuilder(); + } else { + return completionDetail_ == null + ? com.google.cloud.retail.v2alpha.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDetail, + com.google.cloud.retail.v2alpha.CompletionDetail.Builder, + com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder> + getCompletionDetailFieldBuilder() { + if (completionDetailBuilder_ == null) { + completionDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.CompletionDetail, + com.google.cloud.retail.v2alpha.CompletionDetail.Builder, + com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder>( + getCompletionDetail(), getParentForChildren(), isClean()); + completionDetail_ = null; + } + return completionDetailBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2alpha.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2alpha.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object cartId_ = ""; + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cartId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @param value The cartId to set. + * @return This builder for chaining. + */ + public Builder setCartId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cartId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearCartId() { + + cartId_ = getDefaultInstance().getCartId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @param value The bytes for cartId to set. + * @return This builder for chaining. + */ + public Builder setCartIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cartId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.PurchaseTransaction purchaseTransaction_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PurchaseTransaction, + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder, + com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder> + purchaseTransactionBuilder_; + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + public boolean hasPurchaseTransaction() { + return purchaseTransactionBuilder_ != null || purchaseTransaction_ != null; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + public com.google.cloud.retail.v2alpha.PurchaseTransaction getPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2alpha.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } else { + return purchaseTransactionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public Builder setPurchaseTransaction( + com.google.cloud.retail.v2alpha.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + purchaseTransaction_ = value; + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public Builder setPurchaseTransaction( + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder builderForValue) { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = builderForValue.build(); + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public Builder mergePurchaseTransaction( + com.google.cloud.retail.v2alpha.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (purchaseTransaction_ != null) { + purchaseTransaction_ = + com.google.cloud.retail.v2alpha.PurchaseTransaction.newBuilder(purchaseTransaction_) + .mergeFrom(value) + .buildPartial(); + } else { + purchaseTransaction_ = value; + } + onChanged(); + } else { + purchaseTransactionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public Builder clearPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + onChanged(); + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder + getPurchaseTransactionBuilder() { + + onChanged(); + return getPurchaseTransactionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + public com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + if (purchaseTransactionBuilder_ != null) { + return purchaseTransactionBuilder_.getMessageOrBuilder(); + } else { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2alpha.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PurchaseTransaction, + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder, + com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder> + getPurchaseTransactionFieldBuilder() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.PurchaseTransaction, + com.google.cloud.retail.v2alpha.PurchaseTransaction.Builder, + com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder>( + getPurchaseTransaction(), getParentForChildren(), isClean()); + purchaseTransaction_ = null; + } + return purchaseTransactionBuilder_; + } + + private java.lang.Object searchQuery_ = ""; + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @param value The searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + searchQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return This builder for chaining. + */ + public Builder clearSearchQuery() { + + searchQuery_ = getDefaultInstance().getSearchQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @param value The bytes for searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + searchQuery_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private int offset_; + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See
+     * [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See
+     * [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See
+     * [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pageCategories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index to set the value at. + * @param value The pageCategories to set. + * @return This builder for chaining. + */ + public Builder setPageCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param value The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param values The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addAllPageCategories(java.lang.Iterable values) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return This builder for chaining. + */ + public Builder clearPageCategories() { + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param value The bytes of the pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return The userInfo. + */ + public com.google.cloud.retail.v2alpha.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public Builder setUserInfo(com.google.cloud.retail.v2alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public Builder setUserInfo(com.google.cloud.retail.v2alpha.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public Builder mergeUserInfo(com.google.cloud.retail.v2alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.retail.v2alpha.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public com.google.cloud.retail.v2alpha.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + public com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserInfo, + com.google.cloud.retail.v2alpha.UserInfo.Builder, + com.google.cloud.retail.v2alpha.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object referrerUri_ = ""; + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referrerUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @param value The referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referrerUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return This builder for chaining. + */ + public Builder clearReferrerUri() { + + referrerUri_ = getDefaultInstance().getReferrerUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @param value The bytes for referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referrerUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageViewId_ = ""; + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @param value The pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageViewId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return This builder for chaining. + */ + public Builder clearPageViewId() { + + pageViewId_ = getDefaultInstance().getPageViewId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @param value The bytes for pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageViewId_ = 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.v2alpha.UserEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UserEvent) + private static final com.google.cloud.retail.v2alpha.UserEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UserEvent(); + } + + public static com.google.cloud.retail.v2alpha.UserEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEvent(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.v2alpha.UserEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummary.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummary.java new file mode 100644 index 00000000..cfa48a1f --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummary.java @@ -0,0 +1,645 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * A summary of import result. The UserEventImportSummary summarizes
+ * the import status for user events.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventImportSummary} + */ +public final class UserEventImportSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UserEventImportSummary) + UserEventImportSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventImportSummary.newBuilder() to construct. + private UserEventImportSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventImportSummary() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventImportSummary(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventImportSummary( + 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 8: + { + joinedEventsCount_ = input.readInt64(); + break; + } + case 16: + { + unjoinedEventsCount_ = input.readInt64(); + 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventImportSummary.class, + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder.class); + } + + public static final int JOINED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long joinedEventsCount_; + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + + public static final int UNJOINED_EVENTS_COUNT_FIELD_NUMBER = 2; + private long unjoinedEventsCount_; + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + @java.lang.Override + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + + 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 (joinedEventsCount_ != 0L) { + output.writeInt64(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + output.writeInt64(2, unjoinedEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (joinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, unjoinedEventsCount_); + } + 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.v2alpha.UserEventImportSummary)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UserEventImportSummary other = + (com.google.cloud.retail.v2alpha.UserEventImportSummary) obj; + + if (getJoinedEventsCount() != other.getJoinedEventsCount()) return false; + if (getUnjoinedEventsCount() != other.getUnjoinedEventsCount()) 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) + JOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getJoinedEventsCount()); + hash = (37 * hash) + UNJOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUnjoinedEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.UserEventImportSummary 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; + } + /** + * + * + *
+   * A summary of import result. The UserEventImportSummary summarizes
+   * the import status for user events.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventImportSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UserEventImportSummary) + com.google.cloud.retail.v2alpha.UserEventImportSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventImportSummary.class, + com.google.cloud.retail.v2alpha.UserEventImportSummary.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UserEventImportSummary.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(); + joinedEventsCount_ = 0L; + + unjoinedEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventImportSummary_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventImportSummary getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UserEventImportSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventImportSummary build() { + com.google.cloud.retail.v2alpha.UserEventImportSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventImportSummary buildPartial() { + com.google.cloud.retail.v2alpha.UserEventImportSummary result = + new com.google.cloud.retail.v2alpha.UserEventImportSummary(this); + result.joinedEventsCount_ = joinedEventsCount_; + result.unjoinedEventsCount_ = unjoinedEventsCount_; + 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.v2alpha.UserEventImportSummary) { + return mergeFrom((com.google.cloud.retail.v2alpha.UserEventImportSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UserEventImportSummary other) { + if (other == com.google.cloud.retail.v2alpha.UserEventImportSummary.getDefaultInstance()) + return this; + if (other.getJoinedEventsCount() != 0L) { + setJoinedEventsCount(other.getJoinedEventsCount()); + } + if (other.getUnjoinedEventsCount() != 0L) { + setUnjoinedEventsCount(other.getUnjoinedEventsCount()); + } + 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.v2alpha.UserEventImportSummary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UserEventImportSummary) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long joinedEventsCount_; + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @param value The joinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setJoinedEventsCount(long value) { + + joinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearJoinedEventsCount() { + + joinedEventsCount_ = 0L; + onChanged(); + return this; + } + + private long unjoinedEventsCount_; + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + @java.lang.Override + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @param value The unjoinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setUnjoinedEventsCount(long value) { + + unjoinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnjoinedEventsCount() { + + unjoinedEventsCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.UserEventImportSummary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UserEventImportSummary) + private static final com.google.cloud.retail.v2alpha.UserEventImportSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UserEventImportSummary(); + } + + public static com.google.cloud.retail.v2alpha.UserEventImportSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventImportSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventImportSummary(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.v2alpha.UserEventImportSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummaryOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummaryOrBuilder.java new file mode 100644 index 00000000..45e514dd --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventImportSummaryOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface UserEventImportSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UserEventImportSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + long getJoinedEventsCount(); + + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + long getUnjoinedEventsCount(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSource.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSource.java new file mode 100644 index 00000000..6ce3bf10 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSource.java @@ -0,0 +1,1000 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The inline source for the input config for ImportUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventInlineSource} + */ +public final class UserEventInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UserEventInlineSource) + UserEventInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventInlineSource.newBuilder() to construct. + private UserEventInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventInlineSource() { + userEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventInlineSource( + 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)) { + userEvents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + userEvents_.add( + input.readMessage( + com.google.cloud.retail.v2alpha.UserEvent.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)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventInlineSource.class, + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder.class); + } + + public static final int USER_EVENTS_FIELD_NUMBER = 1; + private java.util.List userEvents_; + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getUserEventsList() { + return userEvents_; + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getUserEventsOrBuilderList() { + return userEvents_; + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getUserEventsCount() { + return userEvents_.size(); + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent getUserEvents(int index) { + return userEvents_.get(index); + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventsOrBuilder(int index) { + return userEvents_.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 { + for (int i = 0; i < userEvents_.size(); i++) { + output.writeMessage(1, userEvents_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < userEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, userEvents_.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.v2alpha.UserEventInlineSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UserEventInlineSource other = + (com.google.cloud.retail.v2alpha.UserEventInlineSource) obj; + + if (!getUserEventsList().equals(other.getUserEventsList())) 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 (getUserEventsCount() > 0) { + hash = (37 * hash) + USER_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.UserEventInlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inline source for the input config for ImportUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UserEventInlineSource) + com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventInlineSource.class, + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UserEventInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + userEventsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSource build() { + com.google.cloud.retail.v2alpha.UserEventInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSource buildPartial() { + com.google.cloud.retail.v2alpha.UserEventInlineSource result = + new com.google.cloud.retail.v2alpha.UserEventInlineSource(this); + int from_bitField0_ = bitField0_; + if (userEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEvents_ = userEvents_; + } else { + result.userEvents_ = userEventsBuilder_.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.v2alpha.UserEventInlineSource) { + return mergeFrom((com.google.cloud.retail.v2alpha.UserEventInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UserEventInlineSource other) { + if (other == com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance()) + return this; + if (userEventsBuilder_ == null) { + if (!other.userEvents_.isEmpty()) { + if (userEvents_.isEmpty()) { + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUserEventsIsMutable(); + userEvents_.addAll(other.userEvents_); + } + onChanged(); + } + } else { + if (!other.userEvents_.isEmpty()) { + if (userEventsBuilder_.isEmpty()) { + userEventsBuilder_.dispose(); + userEventsBuilder_ = null; + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + userEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUserEventsFieldBuilder() + : null; + } else { + userEventsBuilder_.addAllMessages(other.userEvents_); + } + } + } + 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.v2alpha.UserEventInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UserEventInlineSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List userEvents_ = + java.util.Collections.emptyList(); + + private void ensureUserEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + userEvents_ = + new java.util.ArrayList(userEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + userEventsBuilder_; + + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getUserEventsList() { + if (userEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(userEvents_); + } else { + return userEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getUserEventsCount() { + if (userEventsBuilder_ == null) { + return userEvents_.size(); + } else { + return userEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent getUserEvents(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents(int index, com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.set(index, value); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents( + int index, com.google.cloud.retail.v2alpha.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(value); + onChanged(); + } else { + userEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(int index, com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(index, value); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + com.google.cloud.retail.v2alpha.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + int index, com.google.cloud.retail.v2alpha.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllUserEvents( + java.lang.Iterable values) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, userEvents_); + onChanged(); + } else { + userEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvents() { + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + userEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeUserEvents(int index) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.remove(index); + onChanged(); + } else { + userEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent.Builder getUserEventsBuilder(int index) { + return getUserEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventsOrBuilder(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getUserEventsOrBuilderList() { + if (userEventsBuilder_ != null) { + return userEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(userEvents_); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent.Builder addUserEventsBuilder() { + return getUserEventsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent.Builder addUserEventsBuilder(int index) { + return getUserEventsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getUserEventsBuilderList() { + return getUserEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + getUserEventsFieldBuilder() { + if (userEventsBuilder_ == null) { + userEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder>( + userEvents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + userEvents_ = null; + } + return userEventsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.UserEventInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UserEventInlineSource) + private static final com.google.cloud.retail.v2alpha.UserEventInlineSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UserEventInlineSource(); + } + + public static com.google.cloud.retail.v2alpha.UserEventInlineSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventInlineSource(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.v2alpha.UserEventInlineSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSourceOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSourceOrBuilder.java new file mode 100644 index 00000000..28bfe9f9 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInlineSourceOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface UserEventInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UserEventInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getUserEventsList(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.UserEvent getUserEvents(int index); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getUserEventsCount(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getUserEventsOrBuilderList(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfig.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfig.java new file mode 100644 index 00000000..d4b11019 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfig.java @@ -0,0 +1,1532 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The input config source for user events.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventInputConfig} + */ +public final class UserEventInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UserEventInputConfig) + UserEventInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventInputConfig.newBuilder() to construct. + private UserEventInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventInputConfig( + 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.v2alpha.UserEventInlineSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.retail.v2alpha.UserEventInlineSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserEventInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.retail.v2alpha.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.retail.v2alpha.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2alpha.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = ((com.google.cloud.retail.v2alpha.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2alpha.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2alpha.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + 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.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventInputConfig.class, + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + USER_EVENT_INLINE_SOURCE(1), + GCS_SOURCE(2), + BIG_QUERY_SOURCE(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return USER_EVENT_INLINE_SOURCE; + case 2: + return GCS_SOURCE; + case 3: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int USER_EVENT_INLINE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + @java.lang.Override + public boolean hasUserEventInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSource getUserEventInlineSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2alpha.GcsSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2alpha.GcsSource) source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2alpha.BigQuerySource) source_); + } + 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.v2alpha.UserEventInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UserEventInputConfig other = + (com.google.cloud.retail.v2alpha.UserEventInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getUserEventInlineSource().equals(other.getUserEventInlineSource())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 3: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + USER_EVENT_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getUserEventInlineSource().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 3: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UserEventInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for user events.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserEventInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UserEventInputConfig) + com.google.cloud.retail.v2alpha.UserEventInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserEventInputConfig.class, + com.google.cloud.retail.v2alpha.UserEventInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UserEventInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ImportConfigProto + .internal_static_google_cloud_retail_v2alpha_UserEventInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UserEventInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInputConfig build() { + com.google.cloud.retail.v2alpha.UserEventInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInputConfig buildPartial() { + com.google.cloud.retail.v2alpha.UserEventInputConfig result = + new com.google.cloud.retail.v2alpha.UserEventInputConfig(this); + if (sourceCase_ == 1) { + if (userEventInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = userEventInlineSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.v2alpha.UserEventInputConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.UserEventInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UserEventInputConfig other) { + if (other == com.google.cloud.retail.v2alpha.UserEventInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case USER_EVENT_INLINE_SOURCE: + { + mergeUserEventInlineSource(other.getUserEventInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.v2alpha.UserEventInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.UserEventInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInlineSource, + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder, + com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder> + userEventInlineSourceBuilder_; + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + @java.lang.Override + public boolean hasUserEventInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSource getUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return userEventInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.retail.v2alpha.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder builderForValue) { + if (userEventInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEventInlineSource( + com.google.cloud.retail.v2alpha.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.UserEventInlineSource.newBuilder( + (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + userEventInlineSourceBuilder_.mergeFrom(value); + } else { + userEventInlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + userEventInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder + getUserEventInlineSourceBuilder() { + return getUserEventInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if ((sourceCase_ == 1) && (userEventInlineSourceBuilder_ != null)) { + return userEventInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInlineSource, + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder, + com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder> + getUserEventInlineSourceFieldBuilder() { + if (userEventInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2alpha.UserEventInlineSource.getDefaultInstance(); + } + userEventInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEventInlineSource, + com.google.cloud.retail.v2alpha.UserEventInlineSource.Builder, + com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder>( + (com.google.cloud.retail.v2alpha.UserEventInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return userEventInlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.retail.v2alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.retail.v2alpha.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsSource(com.google.cloud.retail.v2alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.GcsSource.newBuilder( + (com.google.cloud.retail.v2alpha.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2alpha.GcsSource) source_; + } + return com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.retail.v2alpha.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.GcsSource, + com.google.cloud.retail.v2alpha.GcsSource.Builder, + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder>( + (com.google.cloud.retail.v2alpha.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2alpha.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2alpha.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2alpha.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 3) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2alpha.BigQuerySource) source_; + } + return com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.retail.v2alpha.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.BigQuerySource, + com.google.cloud.retail.v2alpha.BigQuerySource.Builder, + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2alpha.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.UserEventInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UserEventInputConfig) + private static final com.google.cloud.retail.v2alpha.UserEventInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UserEventInputConfig(); + } + + public static com.google.cloud.retail.v2alpha.UserEventInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventInputConfig(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.v2alpha.UserEventInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfigOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfigOrBuilder.java new file mode 100644 index 00000000..c242bf84 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventInputConfigOrBuilder.java @@ -0,0 +1,151 @@ +/* + * 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/v2alpha/import_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface UserEventInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UserEventInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + boolean hasUserEventInlineSource(); + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + com.google.cloud.retail.v2alpha.UserEventInlineSource getUserEventInlineSource(); + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder(); + + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + com.google.cloud.retail.v2alpha.GcsSource getGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2alpha.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2alpha.UserEventInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventOrBuilder.java new file mode 100644 index 00000000..18a0dcdb --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventOrBuilder.java @@ -0,0 +1,1062 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +public interface UserEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UserEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + java.lang.String getSessionId(); + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); + + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + boolean hasEventTime(); + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + com.google.protobuf.Timestamp getEventTime(); + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + java.util.List getExperimentIdsList(); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + int getExperimentIdsCount(); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + java.lang.String getExperimentIds(int index); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + com.google.protobuf.ByteString getExperimentIdsBytes(int index); + + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + java.util.List getProductDetailsList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + com.google.cloud.retail.v2alpha.ProductDetail getProductDetails(int index); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + int getProductDetailsCount(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + java.util.List + getProductDetailsOrBuilderList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2alpha.ProductDetail product_details = 6; + */ + com.google.cloud.retail.v2alpha.ProductDetailOrBuilder getProductDetailsOrBuilder(int index); + + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + boolean hasCompletionDetail(); + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + com.google.cloud.retail.v2alpha.CompletionDetail getCompletionDetail(); + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2alpha.CompletionDetail completion_detail = 22; + */ + com.google.cloud.retail.v2alpha.CompletionDetailOrBuilder getCompletionDetailOrBuilder(); + + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + int getAttributesCount(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2alpha.CustomAttribute defaultValue); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2alpha.CustomAttribute> attributes = 7; + */ + com.google.cloud.retail.v2alpha.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + java.lang.String getCartId(); + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + com.google.protobuf.ByteString getCartIdBytes(); + + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + boolean hasPurchaseTransaction(); + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + com.google.cloud.retail.v2alpha.PurchaseTransaction getPurchaseTransaction(); + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2alpha.PurchaseTransaction purchase_transaction = 9; + */ + com.google.cloud.retail.v2alpha.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder(); + + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + java.lang.String getSearchQuery(); + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + com.google.protobuf.ByteString getSearchQueryBytes(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See
+   * [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset]
+   * for definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + java.util.List 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + com.google.protobuf.ByteString getPageCategoriesBytes(int index); + + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + * + * @return The userInfo. + */ + com.google.cloud.retail.v2alpha.UserInfo getUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2alpha.UserInfo user_info = 12; + */ + com.google.cloud.retail.v2alpha.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + java.lang.String getReferrerUri(); + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + com.google.protobuf.ByteString getReferrerUriBytes(); + + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + java.lang.String getPageViewId(); + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + com.google.protobuf.ByteString getPageViewIdBytes(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventProto.java new file mode 100644 index 00000000..12a93c85 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventProto.java @@ -0,0 +1,184 @@ +/* + * 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/v2alpha/user_event.proto + +package com.google.cloud.retail.v2alpha; + +public final class UserEventProto { + private UserEventProto() {} + + 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_v2alpha_UserEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ProductDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CompletionDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_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/v2alpha/user_event" + + ".proto\022\033google.cloud.retail.v2alpha\032\037goo" + + "gle/api/field_behavior.proto\032(google/clo" + + "ud/retail/v2alpha/common.proto\032)google/c" + + "loud/retail/v2alpha/product.proto\032\037googl" + + "e/protobuf/timestamp.proto\032\036google/proto" + + "buf/wrappers.proto\"\245\006\n\tUserEvent\022\027\n\neven" + + "t_type\030\001 \001(\tB\003\340A\002\022\027\n\nvisitor_id\030\002 \001(\tB\003\340" + + "A\002\022\022\n\nsession_id\030\025 \001(\t\022.\n\nevent_time\030\003 \001" + + "(\0132\032.google.protobuf.Timestamp\022\026\n\016experi" + + "ment_ids\030\004 \003(\t\022\031\n\021attribution_token\030\005 \001(" + + "\t\022C\n\017product_details\030\006 \003(\0132*.google.clou" + + "d.retail.v2alpha.ProductDetail\022H\n\021comple" + + "tion_detail\030\026 \001(\0132-.google.cloud.retail." + + "v2alpha.CompletionDetail\022J\n\nattributes\030\007" + + " \003(\01326.google.cloud.retail.v2alpha.UserE" + + "vent.AttributesEntry\022\017\n\007cart_id\030\010 \001(\t\022N\n" + + "\024purchase_transaction\030\t \001(\01320.google.clo" + + "ud.retail.v2alpha.PurchaseTransaction\022\024\n" + + "\014search_query\030\n \001(\t\022\016\n\006filter\030\020 \001(\t\022\020\n\010o" + + "rder_by\030\021 \001(\t\022\016\n\006offset\030\022 \001(\005\022\027\n\017page_ca" + + "tegories\030\013 \003(\t\0228\n\tuser_info\030\014 \001(\0132%.goog" + + "le.cloud.retail.v2alpha.UserInfo\022\013\n\003uri\030" + + "\r \001(\t\022\024\n\014referrer_uri\030\016 \001(\t\022\024\n\014page_view" + + "_id\030\017 \001(\t\032_\n\017AttributesEntry\022\013\n\003key\030\001 \001(" + + "\t\022;\n\005value\030\002 \001(\0132,.google.cloud.retail.v" + + "2alpha.CustomAttribute:\0028\001\"z\n\rProductDet" + + "ail\022:\n\007product\030\001 \001(\0132$.google.cloud.reta" + + "il.v2alpha.ProductB\003\340A\002\022-\n\010quantity\030\002 \001(" + + "\0132\033.google.protobuf.Int32Value\"p\n\020Comple" + + "tionDetail\022$\n\034completion_attribution_tok" + + "en\030\001 \001(\t\022\033\n\023selected_suggestion\030\002 \001(\t\022\031\n" + + "\021selected_position\030\003 \001(\005\"n\n\023PurchaseTran" + + "saction\022\n\n\002id\030\001 \001(\t\022\024\n\007revenue\030\002 \001(\002B\003\340A" + + "\002\022\013\n\003tax\030\003 \001(\002\022\014\n\004cost\030\004 \001(\002\022\032\n\rcurrency" + + "_code\030\005 \001(\tB\003\340A\002B\334\001\n\037com.google.cloud.re" + + "tail.v2alphaB\016UserEventProtoP\001ZAgoogle.g" + + "olang.org/genproto/googleapis/cloud/reta" + + "il/v2alpha;retail\242\002\006RETAIL\252\002\033Google.Clou" + + "d.Retail.V2Alpha\312\002\033Google\\Cloud\\Retail\\V" + + "2alpha\352\002\036Google::Cloud::Retail::V2alphab" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_UserEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor, + new java.lang.String[] { + "EventType", + "VisitorId", + "SessionId", + "EventTime", + "ExperimentIds", + "AttributionToken", + "ProductDetails", + "CompletionDetail", + "Attributes", + "CartId", + "PurchaseTransaction", + "SearchQuery", + "Filter", + "OrderBy", + "Offset", + "PageCategories", + "UserInfo", + "Uri", + "ReferrerUri", + "PageViewId", + }); + internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2alpha_UserEvent_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_UserEvent_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_ProductDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ProductDetail_descriptor, + new java.lang.String[] { + "Product", "Quantity", + }); + internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_CompletionDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CompletionDetail_descriptor, + new java.lang.String[] { + "CompletionAttributionToken", "SelectedSuggestion", "SelectedPosition", + }); + internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_PurchaseTransaction_descriptor, + new java.lang.String[] { + "Id", "Revenue", "Tax", "Cost", "CurrencyCode", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.retail.v2alpha.CommonProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ProductProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceProto.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceProto.java new file mode 100644 index 00000000..86d00369 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceProto.java @@ -0,0 +1,196 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class UserEventServiceProto { + private UserEventServiceProto() {} + + 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_v2alpha_WriteUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/retail/v2alpha/user_event" + + "_service.proto\022\033google.cloud.retail.v2al" + + "pha\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\031google/api/httpbody.proto\032\031" + + "google/api/resource.proto\032/google/cloud/" + + "retail/v2alpha/import_config.proto\032.goog" + + "le/cloud/retail/v2alpha/purge_config.pro" + + "to\032,google/cloud/retail/v2alpha/user_eve" + + "nt.proto\032#google/longrunning/operations." + + "proto\"m\n\025WriteUserEventRequest\022\023\n\006parent" + + "\030\001 \001(\tB\003\340A\002\022?\n\nuser_event\030\002 \001(\0132&.google" + + ".cloud.retail.v2alpha.UserEventB\003\340A\002\"a\n\027" + + "CollectUserEventRequest\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\003ets\030\004 \001(\003\"\203\002\n\027RejoinUserEventsRequ" + + "est\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022j\n\027user_event_r" + + "ejoin_scope\030\002 \001(\0162I.google.cloud.retail." + + "v2alpha.RejoinUserEventsRequest.UserEven" + + "tRejoinScope\"g\n\024UserEventRejoinScope\022\'\n#" + + "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED\020\000\022\021\n" + + "\rJOINED_EVENTS\020\001\022\023\n\017UNJOINED_EVENTS\020\002\">\n" + + "\030RejoinUserEventsResponse\022\"\n\032rejoined_us" + + "er_events_count\030\001 \001(\003\"\032\n\030RejoinUserEvent" + + "sMetadata2\212\n\n\020UserEventService\022\306\001\n\016Write" + + "UserEvent\0222.google.cloud.retail.v2alpha." + + "WriteUserEventRequest\032&.google.cloud.ret" + + "ail.v2alpha.UserEvent\"X\202\323\344\223\002R\"D/v2alpha/" + + "{parent=projects/*/locations/*/catalogs/" + + "*}/userEvents:write:\nuser_event\022\256\001\n\020Coll" + + "ectUserEvent\0224.google.cloud.retail.v2alp" + + "ha.CollectUserEventRequest\032\024.google.api." + + "HttpBody\"N\202\323\344\223\002H\022F/v2alpha/{parent=proje" + + "cts/*/locations/*/catalogs/*}/userEvents" + + ":collect\022\232\002\n\017PurgeUserEvents\0223.google.cl" + + "oud.retail.v2alpha.PurgeUserEventsReques" + + "t\032\035.google.longrunning.Operation\"\262\001\202\323\344\223\002" + + "I\"D/v2alpha/{parent=projects/*/locations" + + "/*/catalogs/*}/userEvents:purge:\001*\312A`\n3g" + + "oogle.cloud.retail.v2alpha.PurgeUserEven" + + "tsResponse\022)google.cloud.retail.v2alpha." + + "PurgeMetadata\022\237\002\n\020ImportUserEvents\0224.goo" + + "gle.cloud.retail.v2alpha.ImportUserEvent" + + "sRequest\032\035.google.longrunning.Operation\"" + + "\265\001\202\323\344\223\002J\"E/v2alpha/{parent=projects/*/lo" + + "cations/*/catalogs/*}/userEvents:import:" + + "\001*\312Ab\n4google.cloud.retail.v2alpha.Impor" + + "tUserEventsResponse\022*google.cloud.retail" + + ".v2alpha.ImportMetadata\022\361\001\n\020RejoinUserEv" + + "ents\0224.google.cloud.retail.v2alpha.Rejoi" + + "nUserEventsRequest\032\035.google.longrunning." + + "Operation\"\207\001\202\323\344\223\002J\"E/v2alpha/{parent=pro" + + "jects/*/locations/*/catalogs/*}/userEven" + + "ts:rejoin:\001*\312A4\n\030RejoinUserEventsRespons" + + "e\022\030RejoinUserEventsMetadata\032I\312A\025retail.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformB\343\001\n\037com.google.cl" + + "oud.retail.v2alphaB\025UserEventServiceProt" + + "oP\001ZAgoogle.golang.org/genproto/googleap" + + "is/cloud/retail/v2alpha;retail\242\002\006RETAIL\252" + + "\002\033Google.Cloud.Retail.V2Alpha\312\002\033Google\\C" + + "loud\\Retail\\V2alpha\352\002\036Google::Cloud::Ret" + + "ail::V2alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.HttpBodyProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(), + com.google.cloud.retail.v2alpha.PurgeConfigProto.getDescriptor(), + com.google.cloud.retail.v2alpha.UserEventProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", + }); + internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_CollectUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", "Uri", "Ets", + }); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEventRejoinScope", + }); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsResponse_descriptor, + new java.lang.String[] { + "RejoinedUserEventsCount", + }); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_RejoinUserEventsMetadata_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.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.HttpBodyProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ImportConfigProto.getDescriptor(); + com.google.cloud.retail.v2alpha.PurgeConfigProto.getDescriptor(); + com.google.cloud.retail.v2alpha.UserEventProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfo.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfo.java new file mode 100644 index 00000000..c34f6d96 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfo.java @@ -0,0 +1,1286 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Information of an end user.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserInfo} + */ +public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.UserInfo) + UserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserInfo.newBuilder() to construct. + private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserInfo() { + userId_ = ""; + ipAddress_ = ""; + userAgent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserInfo( + 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(); + + userId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 32: + { + directUserRequest_ = 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.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserInfo.class, + com.google.cloud.retail.v2alpha.UserInfo.Builder.class); + } + + public static final int USER_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object userId_; + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + 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(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_AGENT_FIELD_NUMBER = 3; + private volatile java.lang.Object userAgent_; + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + @java.lang.Override + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + 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(); + userAgent_ = s; + return s; + } + } + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIRECT_USER_REQUEST_FIELD_NUMBER = 4; + private boolean directUserRequest_; + /** + * + * + *
+   * True if the request is made directly from the end user, in which case the
+   * [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and
+   * [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be
+   * populated from the HTTP request. This flag should be set only if the API
+   * request is made directly from the end user such as a mobile app (and not if
+   * a gateway or a server is processing and pushing the user events).
+   * This should not be set when using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + + 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(userId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userAgent_); + } + if (directUserRequest_ != false) { + output.writeBool(4, directUserRequest_); + } + 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(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userAgent_); + } + if (directUserRequest_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, directUserRequest_); + } + 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.v2alpha.UserInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.UserInfo other = (com.google.cloud.retail.v2alpha.UserInfo) obj; + + if (!getUserId().equals(other.getUserId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (getDirectUserRequest() != other.getDirectUserRequest()) 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) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + DIRECT_USER_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectUserRequest()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.UserInfo 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; + } + /** + * + * + *
+   * Information of an end user.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.UserInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.UserInfo) + com.google.cloud.retail.v2alpha.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.UserInfo.class, + com.google.cloud.retail.v2alpha.UserInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.UserInfo.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(); + userId_ = ""; + + ipAddress_ = ""; + + userAgent_ = ""; + + directUserRequest_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.CommonProto + .internal_static_google_cloud_retail_v2alpha_UserInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfo build() { + com.google.cloud.retail.v2alpha.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserInfo buildPartial() { + com.google.cloud.retail.v2alpha.UserInfo result = + new com.google.cloud.retail.v2alpha.UserInfo(this); + result.userId_ = userId_; + result.ipAddress_ = ipAddress_; + result.userAgent_ = userAgent_; + result.directUserRequest_ = directUserRequest_; + 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.v2alpha.UserInfo) { + return mergeFrom((com.google.cloud.retail.v2alpha.UserInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.UserInfo other) { + if (other == com.google.cloud.retail.v2alpha.UserInfo.getDefaultInstance()) return this; + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (other.getDirectUserRequest() != false) { + setDirectUserRequest(other.getDirectUserRequest()); + } + 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.v2alpha.UserInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2alpha.UserInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + + userId_ = getDefaultInstance().getUserId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userId_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @param value The userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @param value The bytes for userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private boolean directUserRequest_; + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @param value The directUserRequest to set. + * @return This builder for chaining. + */ + public Builder setDirectUserRequest(boolean value) { + + directUserRequest_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @return This builder for chaining. + */ + public Builder clearDirectUserRequest() { + + directUserRequest_ = 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.v2alpha.UserInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.UserInfo) + private static final com.google.cloud.retail.v2alpha.UserInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.UserInfo(); + } + + public static com.google.cloud.retail.v2alpha.UserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserInfo(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.v2alpha.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfoOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfoOrBuilder.java new file mode 100644 index 00000000..0cc8a9d5 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/UserInfoOrBuilder.java @@ -0,0 +1,170 @@ +/* + * 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/v2alpha/common.proto + +package com.google.cloud.retail.v2alpha; + +public interface UserInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + com.google.protobuf.ByteString getUserAgentBytes(); + + /** + * + * + *
+   * True if the request is made directly from the end user, in which case the
+   * [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and
+   * [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be
+   * populated from the HTTP request. This flag should be set only if the API
+   * request is made directly from the end user such as a mobile app (and not if
+   * a gateway or a server is processing and pushing the user events).
+   * This should not be set when using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + boolean getDirectUserRequest(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequest.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequest.java new file mode 100644 index 00000000..6f6e46f2 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequest.java @@ -0,0 +1,947 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for WriteUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.WriteUserEventRequest} + */ +public final class WriteUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.WriteUserEventRequest) + WriteUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteUserEventRequest.newBuilder() to construct. + private WriteUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteUserEventRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteUserEventRequest( + 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.v2alpha.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.retail.v2alpha.UserEvent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = 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.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.WriteUserEventRequest.class, + com.google.cloud.retail.v2alpha.WriteUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.UserEvent userEvent_; + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + @java.lang.Override + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + 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 (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + 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 (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + 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.v2alpha.WriteUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.WriteUserEventRequest other = + (com.google.cloud.retail.v2alpha.WriteUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) 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 (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.WriteUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for WriteUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.WriteUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.WriteUserEventRequest) + com.google.cloud.retail.v2alpha.WriteUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.WriteUserEventRequest.class, + com.google.cloud.retail.v2alpha.WriteUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.WriteUserEventRequest.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 (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.UserEventServiceProto + .internal_static_google_cloud_retail_v2alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.WriteUserEventRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.WriteUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.WriteUserEventRequest build() { + com.google.cloud.retail.v2alpha.WriteUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.WriteUserEventRequest buildPartial() { + com.google.cloud.retail.v2alpha.WriteUserEventRequest result = + new com.google.cloud.retail.v2alpha.WriteUserEventRequest(this); + result.parent_ = parent_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.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.v2alpha.WriteUserEventRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.WriteUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.WriteUserEventRequest other) { + if (other == com.google.cloud.retail.v2alpha.WriteUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + 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.v2alpha.WriteUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2alpha.WriteUserEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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.v2alpha.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.retail.v2alpha.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2alpha.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.retail.v2alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.retail.v2alpha.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.retail.v2alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.UserEvent, + com.google.cloud.retail.v2alpha.UserEvent.Builder, + com.google.cloud.retail.v2alpha.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.WriteUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.WriteUserEventRequest) + private static final com.google.cloud.retail.v2alpha.WriteUserEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.WriteUserEventRequest(); + } + + public static com.google.cloud.retail.v2alpha.WriteUserEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteUserEventRequest(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.v2alpha.WriteUserEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequestOrBuilder.java b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequestOrBuilder.java new file mode 100644 index 00000000..df58c835 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/WriteUserEventRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/v2alpha/user_event_service.proto + +package com.google.cloud.retail.v2alpha; + +public interface WriteUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.WriteUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.retail.v2alpha.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.UserEventOrBuilder getUserEventOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog.proto new file mode 100644 index 00000000..9b3d8cb0 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog.proto @@ -0,0 +1,397 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/import_config.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "CatalogProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Configures what level the product should be uploaded with regards to +// how users will be send events and how predictions will be made. +message ProductLevelConfig { + // The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be + // ingested into the catalog. Acceptable values are: + // + // * `primary` (default): You can ingest + // [Product][google.cloud.retail.v2alpha.Product]s of all types. When + // ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will + // default to + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // if unset. + // * `variant`: You can only ingest + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s. + // This means + // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id] + // cannot be empty. + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // If this field is `variant` and + // [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field] + // is `itemGroupId`, an INVALID_ARGUMENT error is returned. + // + // See [Using product + // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + // for more details. + string ingestion_product_type = 1; + + // Which field of [Merchant Center + // Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + // imported as [Product.id][google.cloud.retail.v2alpha.Product.id]. + // Acceptable values are: + // + // * `offerId` (default): Import `offerId` as the product ID. + // * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + // API will choose one item from the ones with the same `itemGroupId`, and + // use it to represent the item group. + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // If this field is `itemGroupId` and + // [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type] + // is `variant`, an INVALID_ARGUMENT error is returned. + // + // See [Using product + // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + // for more details. + string merchant_center_product_id_field = 2; +} + +// Catalog level attribute config for an attribute. For example, if customers +// want to enable/disable facet for a specific attribute. +message CatalogAttribute { + // The type of an attribute. + enum AttributeType { + // The type of the attribute is unknown. + // + // Used when type cannot be derived from attribute that is not + // [in_use][google.cloud.retail.v2alpha.CatalogAttribute.in_use]. + UNKNOWN = 0; + + // Textual attribute. + TEXTUAL = 1; + + // Numerical attribute. + NUMERICAL = 2; + } + + // The status of the indexable option of a catalog attribute. + enum IndexableOption { + // Value used when unset. Defaults to + // [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED]. + INDEXABLE_OPTION_UNSPECIFIED = 0; + + // Indexable option enabled for an attribute. + INDEXABLE_ENABLED = 1; + + // Indexable option disabled for an attribute. + INDEXABLE_DISABLED = 2; + } + + // The status of the dynamic facetable option of a catalog attribute. + enum DynamicFacetableOption { + // Value used when unset. Defaults to + // [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED]. + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + + // Dynamic facetable option enabled for an attribute. + DYNAMIC_FACETABLE_ENABLED = 1; + + // Dynamic facetable option disabled for an attribute. + DYNAMIC_FACETABLE_DISABLED = 2; + } + + // The status of the searchable option of a catalog attribute. + enum SearchableOption { + // Value used when unset. Defaults to + // [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED]. + SEARCHABLE_OPTION_UNSPECIFIED = 0; + + // Searchable option enabled for an attribute. + SEARCHABLE_ENABLED = 1; + + // Searchable option disabled for an attribute. + SEARCHABLE_DISABLED = 2; + } + + // Required. Attribute name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Indicates whether this attribute has been used by any + // products. `True` if at least one + // [Product][google.cloud.retail.v2alpha.Product] is using this attribute in + // [Product.attributes][google.cloud.retail.v2alpha.Product.attributes]. + // Otherwise, this field is `False`. + // + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be + // pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][], + // or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s. + // + // Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that + // are not in use by products can be deleted. + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are + // in use by products cannot be deleted; however, their configuration + // properties will reset to default values upon removal request. + // + // After catalog changes, it takes about 10 minutes for this field to update. + bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of this attribute. This is derived from the attribute + // in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes]. + AttributeType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + // are indexed so that it can be filtered, faceted, or boosted in + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + IndexableOption indexable_option = 5; + + // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + // facet. Could only be DYNAMIC_FACETABLE_DISABLED if + // [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option] + // is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + DynamicFacetableOption dynamic_facetable_option = 6; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + // are searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + // will not be searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + // as there are no text values associated to numerical attributes. + SearchableOption searchable_option = 7; +} + +// Catalog level attribute config. +message AttributesConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/AttributesConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + }; + + // Required. Immutable. The fully qualified resource name of the attribute + // config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Enable attribute(s) config at catalog level. + // For example, indexable, dynamic_facetable, or searchable for each + // attribute. + // + // The key is catalog attribute's name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + // + // The maximum number of catalog attributes allowed in a request is 1000. + map catalog_attributes = 2; + + // Output only. The + // [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel] + // used for this catalog. + AttributeConfigLevel attribute_config_level = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Catalog level autocomplete config for customers to customize autocomplete +// feature's settings. +message CompletionConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/CompletionConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" + }; + + // Required. Immutable. Fully qualified name + // `projects/*/locations/*/catalogs/*/completionConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Specifies the matching order for autocomplete suggestions, e.g., a query + // consisting of 'sh' with 'out-of-order' specified would suggest "women's + // shoes", whereas a query of 'red s' with 'exact-prefix' specified would + // suggest "red shoes". Currently supported values: + // + // * 'out-of-order' + // * 'exact-prefix' + // + // Default value: 'exact-prefix'. + string matching_order = 2; + + // The maximum number of autocomplete suggestions returned per term. The + // maximum allowed max suggestions is 20. Default value is 20. If left unset + // or set to 0, then will fallback to default value. + int32 max_suggestions = 3; + + // The minimum number of characters needed to be typed in order to get + // suggestions. Default value is 2. If left unset or set to 0, then will + // fallback to default value. + int32 min_prefix_length = 4; + + // If set to true, the auto learning function is enabled. Auto learning uses + // user data to generate suggestions using ML techniques. Default value is + // false. Only after enabling auto learning can users use `cloud-retail` + // data in + // [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest]. + bool auto_learning = 11; + + // Output only. The input config for the import of the source data that + // contains the autocomplete phrases uploaded by the customer. + CompletionDataInputConfig suggestions_input_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the LRO corresponding to the latest suggestion terms + // list import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_suggestions_import_operation = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the / autocomplete denylist phrases uploaded by the customer. + CompletionDataInputConfig denylist_input_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest denylist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_denylist_import_operation = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the autocomplete allowlist phrases uploaded by the customer. + CompletionDataInputConfig allowlist_input_config = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest allowlist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_allowlist_import_operation = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a link between a Merchant Center account and a branch. +// Once a link is established, products from the linked merchant center account +// will be streamed to the linked branch. +message MerchantCenterLink { + // Required. The linked [Merchant center account + // id](https://developers.google.com/shopping-content/guides/accountstatuses). + // The account must be a standalone account or a sub-account of a MCA. + int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The branch id (e.g. 0/1/2) within this catalog that products from + // merchant_center_account_id are streamed to. When updating this field, an + // empty value will use the currently configured default branch. However, + // changing the default branch later on won't change the linked branch here. + // + // A single branch id can only have one linked merchant center account id. + 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 allowed string values: + // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory + // _ads", "Free_listings", "Free_local_listings" + // NOTE: The string values are case sensitive. + repeated string destinations = 3; + + // Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2 + // code. List of values can be found + // [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) + // under the `region` tag. If left blank no region filtering will be + // performed. + // + // Example value: `US`. + string region_code = 4; + + // Language of the title/description and other string attributes. Use language + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // ISO 639-1. + // + // This specifies the language of offers in Merchant Center that will be + // accepted. If empty no language filtering will be performed. + // + // Example value: `en`. + string language_code = 5; +} + +// Configures Merchant Center linking. +// Links contained in the config will be used to sync data from a Merchant +// Center account to a Cloud Retail branch. +message MerchantCenterLinkingConfig { + // Links between Merchant Center accounts and branches. + repeated MerchantCenterLink links = 1; +} + +// The catalog configuration. +message Catalog { + option (google.api.resource) = { + type: "retail.googleapis.com/Catalog" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}" + }; + + // Required. Immutable. The fully qualified resource name of the catalog. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The catalog display name. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string display_name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The product level configuration. + ProductLevelConfig product_level_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The Merchant Center linking configuration. + // Once a link is added, the data stream from Merchant Center to Cloud Retail + // will be enabled automatically. The requester must have access to the + // merchant center account in order to make changes to this field. + MerchantCenterLinkingConfig merchant_center_linking_config = 6; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog_service.proto new file mode 100644 index 00000000..6ecab725 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/catalog_service.proto @@ -0,0 +1,478 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/catalog.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "CatalogServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for managing catalog configuration. +service CatalogService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated + // with the project. + rpc ListCatalogs(ListCatalogsRequest) returns (ListCatalogsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*}/catalogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s. + rpc UpdateCatalog(UpdateCatalogRequest) returns (Catalog) { + option (google.api.http) = { + patch: "/v2alpha/{catalog.name=projects/*/locations/*/catalogs/*}" + body: "catalog" + }; + option (google.api.method_signature) = "catalog,update_mask"; + } + + // Set a specified branch id as default branch. API methods such as + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], + // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], + // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] + // will treat requests using "default_branch" to the actual branch id set as + // default. + // + // For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + // default, setting + // [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to + // `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + // to setting + // [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to + // `projects/*/locations/*/catalogs/*/branches/1`. + // + // Using multiple branches can be useful when developers would like + // to have a staging branch to test and verify for future usage. When it + // becomes ready, developers switch on the staging branch using this API while + // keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` + // as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] + // to route the traffic to this staging branch. + // + // CAUTION: If you have live predict/search traffic, switching the default + // branch could potentially cause outages if the ID space of the new branch is + // very different from the old one. + // + // More specifically: + // + // * PredictionService will only return product IDs from branch {newBranch}. + // * SearchService will only return product IDs from branch {newBranch} + // (if branch is not explicitly set). + // * UserEventService will only join events with products from branch + // {newBranch}. + rpc SetDefaultBranch(SetDefaultBranchRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch" + body: "*" + }; + option (google.api.method_signature) = "catalog"; + } + + // Get which branch is currently default branch set by + // [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] + // method under a specified parent catalog. + rpc GetDefaultBranch(GetDefaultBranchRequest) + returns (GetDefaultBranchResponse) { + option (google.api.http) = { + get: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch" + }; + option (google.api.method_signature) = "catalog"; + } + + // Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]. + rpc GetCompletionConfig(GetCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/completionConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s. + rpc UpdateCompletionConfig(UpdateCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + patch: "/v2alpha/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}" + body: "completion_config" + }; + option (google.api.method_signature) = "completion_config,update_mask"; + } + + // Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + rpc GetAttributesConfig(GetAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/attributesConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + // + // The catalog attributes in the request will be updated in the catalog, or + // inserted if they do not exist. Existing catalog attributes not included in + // the request will remain unchanged. Attributes that are assigned to + // products, but do not exist at the catalog level, are always included in the + // response. The product attribute is assigned default values for missing + // catalog attribute fields, e.g., searchable and dynamic facetable options. + rpc UpdateAttributesConfig(UpdateAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + patch: "/v2alpha/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}" + body: "attributes_config" + }; + option (google.api.method_signature) = "attributes_config,update_mask"; + } + + // Adds the specified + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to + // add already exists, an ALREADY_EXISTS error is returned. + rpc AddCatalogAttribute(AddCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute" + body: "*" + }; + } + + // Removes the specified + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to + // remove does not exist, a NOT_FOUND error is returned. + rpc RemoveCatalogAttribute(RemoveCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute" + body: "*" + }; + } + + // Replaces the specified + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by + // updating the catalog attribute with the same + // [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]. + // + // If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to + // replace does not exist, a NOT_FOUND error is returned. + rpc ReplaceCatalogAttribute(ReplaceCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute" + body: "*" + }; + } +} + +// Request for +// [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs] +// method. +message ListCatalogsRequest { + // Required. The account resource name with an associated location. + // + // If the caller does not have permission to list + // [Catalog][google.cloud.retail.v2alpha.Catalog]s under this location, + // regardless of whether or not this location exists, a PERMISSION_DENIED + // error is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of [Catalog][google.cloud.retail.v2alpha.Catalog]s to + // return. If unspecified, defaults to 50. The maximum allowed value is 1000. + // Values above 1000 will be coerced to 1000. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 page_size = 2; + + // A page token + // [ListCatalogsResponse.next_page_token][google.cloud.retail.v2alpha.ListCatalogsResponse.next_page_token], + // received from a previous + // [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 3; +} + +// Response for +// [CatalogService.ListCatalogs][google.cloud.retail.v2alpha.CatalogService.ListCatalogs] +// method. +message ListCatalogsResponse { + // All the customer's [Catalog][google.cloud.retail.v2alpha.Catalog]s. + repeated Catalog catalogs = 1; + + // A token that can be sent as + // [ListCatalogsRequest.page_token][google.cloud.retail.v2alpha.ListCatalogsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request for +// [CatalogService.UpdateCatalog][google.cloud.retail.v2alpha.CatalogService.UpdateCatalog] +// method. +message UpdateCatalogRequest { + // Required. The [Catalog][google.cloud.retail.v2alpha.Catalog] to update. + // + // If the caller does not have permission to update the + // [Catalog][google.cloud.retail.v2alpha.Catalog], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + // + // If the [Catalog][google.cloud.retail.v2alpha.Catalog] to update does not + // exist, a NOT_FOUND error is returned. + Catalog catalog = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Catalog][google.cloud.retail.v2alpha.Catalog] to update. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message to set a specified branch as new default_branch. +message SetDefaultBranchRequest { + // Full resource name of the catalog, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // The final component of the resource name of a branch. + // + // This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + // error is returned. + // + // If there are no sufficient active products in the targeted branch and + // [force][google.cloud.retail.v2alpha.SetDefaultBranchRequest.force] is not + // set, a FAILED_PRECONDITION error is returned. + string branch_id = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Some note on this request, this can be retrieved by + // [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch] + // before next valid default branch set occurs. + // + // This field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string note = 3; + + // If set to true, it permits switching to a branch with + // [branch_id][google.cloud.retail.v2alpha.SetDefaultBranchRequest.branch_id] + // even if it has no sufficient active products. + bool force = 4; +} + +// Request message to show which branch is currently the default branch. +message GetDefaultBranchRequest { + // The parent catalog resource name, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; +} + +// Response message of +// [CatalogService.GetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.GetDefaultBranch]. +message GetDefaultBranchResponse { + // Full resource name of the branch id currently set as default branch. + string branch = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // The time when this branch is set to default. + google.protobuf.Timestamp set_time = 2; + + // This corresponds to + // [SetDefaultBranchRequest.note][google.cloud.retail.v2alpha.SetDefaultBranchRequest.note] + // field, when this branch was set as default. + string note = 3; +} + +// Request for +// [CatalogService.GetCompletionConfig][google.cloud.retail.v2alpha.CatalogService.GetCompletionConfig] +// method. +message GetCompletionConfigRequest { + // Required. Full CompletionConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/CompletionConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateCompletionConfig][google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfig] +// method. +message UpdateCompletionConfigRequest { + // Required. The + // [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. + // + // If the caller does not have permission to update the + // [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig], then a + // PERMISSION_DENIED error is returned. + // + // If the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to + // update does not exist, a NOT_FOUND error is returned. + CompletionConfig completion_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig] to update. + // The following are the only supported fields: + // + // * [CompletionConfig.matching_order][google.cloud.retail.v2alpha.CompletionConfig.matching_order] + // * [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions] + // * [CompletionConfig.min_prefix_length][google.cloud.retail.v2alpha.CompletionConfig.min_prefix_length] + // * [CompletionConfig.auto_learning][google.cloud.retail.v2alpha.CompletionConfig.auto_learning] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.GetAttributesConfig][google.cloud.retail.v2alpha.CatalogService.GetAttributesConfig] +// method. +message GetAttributesConfigRequest { + // Required. Full AttributesConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/AttributesConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfig] +// method. +message UpdateAttributesConfigRequest { + // Required. The + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. + AttributesConfig attributes_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] to update. + // The following is the only supported field: + // + // * [AttributesConfig.catalog_attributes][google.cloud.retail.v2alpha.AttributesConfig.catalog_attributes] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.AddCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.AddCatalogAttribute] +// method. +message AddCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.RemoveCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttribute] +// method. +message RemoveCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 key of the + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove. + string key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute] +// method. +message ReplaceCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 updated + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to update. + // The following are NOT supported: + // + // * [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/common.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/common.proto new file mode 100644 index 00000000..ae33d3f6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/common.proto @@ -0,0 +1,761 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// At which level we offer configuration for attributes. +enum AttributeConfigLevel { + // Value used when unset. Defaults to + // [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2alpha.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + + // At this level, we honor the attribute configurations set in + // [Product.attributes][google.cloud.retail.v2alpha.Product.attributes]. + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + + // At this level, we honor the attribute configurations set in + // [CatalogConfig.attribute_configs][google.cloud.retail.v2alpha.CatalogConfig.attribute_configs]. + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; +} + +// The type of solution. +enum SolutionType { + // Default value. + SOLUTION_TYPE_UNSPECIFIED = 0; + + // Used for Recommendations AI. + SOLUTION_TYPE_RECOMMENDATION = 1; + + // Used for Retail Search. + SOLUTION_TYPE_SEARCH = 2; +} + +// The use case of Cloud Retail Search. +enum SearchSolutionUseCase { + // The value when it's unspecified. Defaults to + // [SEARCH][]. + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + + // Search use case. Expects the traffic has a non-empty + // [query][google.cloud.retail.v2alpha.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + + // Browse use case. Expects the traffic has an empty + // [query][google.cloud.retail.v2alpha.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_BROWSE = 2; +} + +// Metadata that is used to define a condition that triggers an action. +// A valid condition must specify at least one of 'query_terms' or +// 'products_filter'. If multiple fields are specified, the condition is met if +// all the fields are satisfied e.g. if a set of query terms and product_filter +// are set, then only items matching the product_filter for requests with a +// query matching the query terms wil get boosted. +message Condition { + // Query terms that we want to match on. + message QueryTerm { + // The value of the term to match on. + // 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. + string value = 1; + + // Whether this is supposed to be a full or partial match. + bool full_match = 2; + } + + // Used for time-dependent conditions. + // Example: Want to have rule applied for week long sale. + message TimeRange { + // Start of time range. Range is inclusive. + google.protobuf.Timestamp start_time = 1; + + // End of time range. Range is inclusive. + google.protobuf.Timestamp end_time = 2; + } + + // A list (up to 10 entries) of terms to match the query on. If not + // specified, match all queries. + // If many query terms are specified, the condition + // is matched if any of the terms is a match (i.e. using the OR operator). + repeated QueryTerm query_terms = 1; + + // Range of time(s) specifying when Condition is active. + // Condition true if any time range matches. + repeated TimeRange active_time_range = 3; +} + +// 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. +message Rule { + // A boost action to apply to results matching condition specified above. + message BoostAction { + // Strength of the condition boost, which must be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the item a big promotion. However, it does not + // necessarily mean that the boosted item will be the top result at all + // times, nor that other items will be excluded. Results could still be + // shown even when none of them matches the condition. And results that + // are significantly more relevant to the search query can still trump + // your heavily favored but irrelevant items. + // + // Setting to -1.0 gives the item a big demotion. However, results that + // are deeply relevant might still be shown. The item will have an + // upstream battle to get a fairly high ranking, but it is not blocked out + // completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 1; + + // The filter can have a max size of 5000 characters. + // An expression which specifies which products to apply an action to. + // The syntax and supported fields are the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] + // for detail syntax and limitations. + // + // Examples: + // + // * To boost products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue":
+ // *(id: ANY("product_1", "product_2"))
* + // *AND
* + // *(colorFamilies: ANY("Red", "Blue"))
* + string products_filter = 2; + } + + // * Rule Condition: + // - No [Condition][query_terms] provided is a global match. + // - 1 or more [Condition][query_terms] provided is combined with OR + // operator. + // * Action Input: The request query and filter that will be applied to the + // retrieved products, in addition to any filters already provided with the + // SearchRequest. The AND operator is used to combine the query's existing + // filters with the filter rule(s). NOTE: May result in 0 results when + // filters conflict. + // * Action Result: Filters the returned objects to be ONLY those that passed + // the filter. + message FilterAction { + // A filter to apply on the matching condition results. Supported features: + // + // * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be + // set. + // * Filter syntax is identical to + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]. + // See more + // details at the Retail Search + // [user guide](/retail/search/docs/filter-and-order#filter). + // * To filter products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue":
+ // *(id: ANY("product_1", "product_2"))
* + // *AND
* + // *(colorFamilies: ANY("Red", "Blue"))
* + string filter = 1; + } + + // Redirects a shopper to a specific page. + // * Rule Condition: + // - Must specify [Condition][query_terms]. + // * Action Input: Request Query + // * Action Result: Redirects shopper to provided uri. + message RedirectAction { + // URL must have length equal or less than 2000 characters. + string redirect_uri = 1; + } + + // Creates a set of terms that will be treated as synonyms of each other. + // Example: synonyms of "sneakers" and "shoes". + // * "sneakers" will use a synonym of "shoes". + // * "shoes" will use a synonym of "sneakers". + message TwowaySynonymsAction { + // Defines a set of synonyms. + // Can specify up to 100 synonyms. + // Must specify at least 2 synonyms. + repeated string synonyms = 1; + } + + // Maps a set of terms to a set of synonyms. + // Set of synonyms will be treated as synonyms of each query term only. + // `query_terms` will not be treated as synonyms of each other. + // Example: "sneakers" will use a synonym of "shoes". + // "shoes" will not use a synonym of "sneakers". + message OnewaySynonymsAction { + // Terms from the search query. + // Will treat synonyms as their synonyms. + // Not themselves synonyms of the synonyms. + // Can specify up to 100 terms. + repeated string query_terms = 3; + + // Defines a set of synonyms. + // Cannot contain duplicates. + // Can specify up to 100 synonyms. + repeated string synonyms = 4; + + // Will be [deprecated = true] post migration; + repeated string oneway_terms = 2; + } + + // Prevents `query_term` from being associated with specified terms during + // search. + // Example: Don't associate "gShoe" and "cheap". + message DoNotAssociateAction { + // Terms from the search query. + // Will not consider do_not_associate_terms for search if in search query. + // Can specify up to 100 terms. + repeated string query_terms = 2; + + // Cannot contain duplicates or the query term. + // Can specify up to 100 terms. + repeated string do_not_associate_terms = 3; + + // Will be [deprecated = true] post migration; + repeated string terms = 1; + } + + // Replaces a term in the query. Multiple replacement candidates can be + // specified. All `query_terms` will be replaced with the replacement term. + // Example: Replace "gShoe" with "google shoe". + message ReplacementAction { + // Terms from the search query. + // Will be replaced by replacement term. + // Can specify up to 100 terms. + repeated string query_terms = 2; + + // Term that will be used for replacement. + string replacement_term = 3; + + // Will be [deprecated = true] post migration; + string term = 1; + } + + // Prevents a term in the query from being used in search. + // Example: Don't search for "shoddy". + message IgnoreAction { + // Terms to ignore in the search query. + repeated string ignore_terms = 1; + } + + // An action must be provided. + oneof action { + // A boost action. + BoostAction boost_action = 2; + + // Redirects a shopper to a specific page. + RedirectAction redirect_action = 3; + + // Treats specific term as a synonym with a group of terms. + // Group of terms will not be treated as synonyms with the specific term. + OnewaySynonymsAction oneway_synonyms_action = 6; + + // Prevents term from being associated with other terms. + DoNotAssociateAction do_not_associate_action = 7; + + // Replaces specific terms in the query. + ReplacementAction replacement_action = 8; + + // Ignores specific terms from query during search. + IgnoreAction ignore_action = 9; + + // Filters results. + FilterAction filter_action = 10; + + // Treats a set of terms as synonyms of one another. + TwowaySynonymsAction twoway_synonyms_action = 11; + } + + // Required. The condition that triggers the rule. + // If the condition is empty, the rule will always apply. + Condition condition = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An intended audience of the [Product][google.cloud.retail.v2alpha.Product] +// for whom it's sold. +message Audience { + // The genders of the audience. Strongly encouraged to use the standard + // values: "male", "female", "unisex". + // + // At most 5 values are allowed. Each value must be a UTF-8 encoded string + // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Google Merchant Center property + // [gender](https://support.google.com/merchants/answer/6324479). Schema.org + // property + // [Product.audience.suggestedGender](https://schema.org/suggestedGender). + repeated string genders = 1; + + // The age groups of the audience. Strongly encouraged to use the standard + // values: "newborn" (up to 3 months old), "infant" (3–12 months old), + // "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + // teens or older). + // + // At most 5 values are allowed. Each value must be a UTF-8 encoded string + // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Google Merchant Center property + // [age_group](https://support.google.com/merchants/answer/6324463). + // Schema.org property + // [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + // [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + repeated string age_groups = 2; +} + +// The color information of a [Product][google.cloud.retail.v2alpha.Product]. +message ColorInfo { + // The standard color families. Strongly recommended to use the following + // standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + // "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + // "Mixed". Normally it is expected to have only 1 color family. May consider + // using single "Mixed" instead of multiple values. + // + // A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + repeated string color_families = 1; + + // The color display names, which may be different from standard color family + // names, such as the color aliases used in the website frontend. Normally + // it is expected to have only 1 color. May consider using single "Mixed" + // instead of multiple values. + // + // A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + repeated string colors = 2; +} + +// A custom attribute that is not explicitly modeled in +// [Product][google.cloud.retail.v2alpha.Product]. +message CustomAttribute { + // The textual values of this custom attribute. For example, `["yellow", + // "green"]` when the key is "color". + // + // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or + // [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be + // set. Otherwise, an INVALID_ARGUMENT error is returned. + repeated string text = 1; + + // The numerical values of this custom attribute. For example, `[2.3, 15.4]` + // when the key is "lengths_cm". + // + // Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or + // [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be + // set. Otherwise, an INVALID_ARGUMENT error is returned. + repeated double numbers = 2; + + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2alpha.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // This field is ignored in a + // [UserEvent][google.cloud.retail.v2alpha.UserEvent]. + // + // Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text] + // is set. Otherwise, a INVALID_ARGUMENT error is returned. + optional bool searchable = 3; + + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2alpha.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // indexed, so that it can be filtered, faceted or boosted in + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // This field is ignored in a + // [UserEvent][google.cloud.retail.v2alpha.UserEvent]. + // + // See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter], + // [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs] + // and + // [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec] + // for more details. + optional bool indexable = 4; +} + +// Fulfillment information, such as the store IDs for in-store pickup or region +// IDs for different shipping methods. +message FulfillmentInfo { + // The fulfillment type, including commonly used types (such as pickup in + // store and same day delivery), and custom types. Customers have to map + // custom types to their display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + string type = 1; + + // The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type], + // such as the store IDs for + // [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // or the region IDs for + // [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type]. + // + // A maximum of 3000 values are allowed. Each value must be a string with a + // length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + // as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string place_ids = 2; +} + +// [Product][google.cloud.retail.v2alpha.Product] image. Recommendations AI and +// Retail Search do not use product images to improve prediction and search +// results. However, product images can be returned in results, and are shown in +// prediction or search previews in the console. +message Image { + // Required. URI of the image. + // + // This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [image_link](https://support.google.com/merchants/answer/6324350). + // Schema.org property [Product.image](https://schema.org/image). + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Height of the image in number of pixels. + // + // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 height = 2; + + // Width of the image in number of pixels. + // + // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 width = 3; +} + +// A floating point interval. +message Interval { + // The lower bound of the interval. If neither of the min fields are set, then + // the lower bound is negative infinity. + // + // This field must be not larger than + // [max][google.cloud.retail.v2alpha.Interval.max]. Otherwise, an + // INVALID_ARGUMENT error is returned. + oneof min { + // Inclusive lower bound. + double minimum = 1; + + // Exclusive lower bound. + double exclusive_minimum = 2; + } + + // The upper bound of the interval. If neither of the max fields are set, then + // the upper bound is positive infinity. + // + // This field must be not smaller than + // [min][google.cloud.retail.v2alpha.Interval.min]. Otherwise, an + // INVALID_ARGUMENT error is returned. + oneof max { + // Inclusive upper bound. + double maximum = 3; + + // Exclusive upper bound. + double exclusive_maximum = 4; + } +} + +// The price information of a [Product][google.cloud.retail.v2alpha.Product]. +message PriceInfo { + // The price range of all + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. + message PriceRange { + // The inclusive + // [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price] + // interval of all + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. + Interval price = 1; + + // The inclusive + // [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] + // internal of all + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. + Interval original_price = 2; + } + + // The 3-letter currency code defined in [ISO + // 4217](https://www.iso.org/iso-4217-currency-codes.html). + // + // If this field is an unrecognizable currency code, an INVALID_ARGUMENT + // error is returned. + // + // The + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s with the same + // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id] + // must share the same + // [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code]. + // Otherwise, a FAILED_PRECONDITION error is returned. + string currency_code = 1; + + // Price of the product. + // + // Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). Schema.org + // property [Offer.price](https://schema.org/price). + float price = 2; + + // Price of the product without any discount. If zero, by default set to be + // the [price][google.cloud.retail.v2alpha.PriceInfo.price]. + float original_price = 3; + + // The costs associated with the sale of a particular product. Used for gross + // profit reporting. + // + // * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] - + // [cost][google.cloud.retail.v2alpha.PriceInfo.cost] + // + // Google Merchant Center property + // [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + float cost = 4; + + // The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price] + // starts to be effective. This can be set as a future timestamp, and the + // [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for + // search after + // [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time]. + // If so, the + // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must + // be set and + // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is + // used before + // [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time]. + // + // Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is + // always effective because it will cause additional latency during search. + google.protobuf.Timestamp price_effective_time = 5; + + // The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price] + // stops to be effective. The + // [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search + // before + // [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time]. + // If this field is set, the + // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must + // be set and + // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is + // used after + // [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time]. + // + // Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is + // always effective because it will cause additional latency during search. + google.protobuf.Timestamp price_expire_time = 6; + + // Output only. The price range of all the child + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s grouped together on the + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]. Only populated for + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]s. + // + // Note: This field is OUTPUT_ONLY for + // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. + // Do not set this field in API requests. + PriceRange price_range = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The rating of a [Product][google.cloud.retail.v2alpha.Product]. +message Rating { + // The total number of ratings. This value is independent of the value of + // [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram]. + // + // This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 rating_count = 1; + + // The average rating of the [Product][google.cloud.retail.v2alpha.Product]. + // + // The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + // returned. + float average_rating = 2; + + // List of rating counts per rating value (index = rating - 1). The list is + // empty if there is no rating. If the list is non-empty, its size is + // always 5. Otherwise, an INVALID_ARGUMENT error is returned. + // + // For example, [41, 14, 13, 47, 303]. It means that the + // [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star, + // 14 ratings with 2 star, and so on. + repeated int32 rating_histogram = 3; +} + +// Information of an end user. +message UserInfo { + // Highly recommended for logged-in users. Unique identifier for logged-in + // user, such as a user name. + // + // Always use a hashed value for this ID. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string user_id = 1; + + // The end user's IP address. This field is used to extract location + // information for personalization. + // + // This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + // address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // This should not be set when: + // + // * setting + // [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info]. + // * using the JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] + // or if + // [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] + // is set. + string ip_address = 2; + + // User agent as included in the HTTP header. Required for getting + // [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results]. + // + // The field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This should not be set when using the client side event reporting with + // GTM or JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] + // or if + // [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] + // is set. + string user_agent = 3; + + // True if the request is made directly from the end user, in which case the + // [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and + // [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be + // populated from the HTTP request. This flag should be set only if the API + // request is made directly from the end user such as a mobile app (and not if + // a gateway or a server is processing and pushing the user events). + // + // This should not be set when using the JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]. + bool direct_user_request = 4; +} + +// The inventory information at a place (e.g. a store) identified +// by a place ID. +message LocalInventory { + // The place ID for the current set of inventory information. + string place_id = 1; + + // Product price and cost information. + // + // Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 2; + + // Additional local inventory attributes, for example, store name, promotion + // tags, etc. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * At most 30 attributes are allowed. + // * The key must be a UTF-8 encoded string with a length limit of 32 + // characters. + // * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + // key0LikeThis or KEY_1_LIKE_THIS. + // * The attribute values must be of the same type (text or number). + // * Only 1 value is allowed for each attribute. + // * For text values, the length limit is 256 UTF-8 characters. + // * The attribute does not support search. The `searchable` field should be + // unset or set to false. + // * The max summed total bytes of custom attribute keys and values per + // product is 5MiB. + map attributes = 3; + + // Input only. Supported fulfillment types. Valid fulfillment type values + // include commonly used types (such as pickup in store and same day + // delivery), and custom types. Customers have to map custom types to their + // display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string fulfillment_types = 4 + [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/completion_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/completion_service.proto new file mode 100644 index 00000000..a91aa618 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/completion_service.proto @@ -0,0 +1,199 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/import_config.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "CompletionServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// 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. +service CompletionService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // 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. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:completeQuery" + }; + } + + // Bulk import of processed completion dataset. + // + // Request processing is asynchronous. Partial updating is not supported. + // + // The operation is successfully finished only after the imported suggestions + // are indexed successfully and ready for serving. The process takes hours. + // + // This feature is only available for users who have Retail Search enabled. + // Please enable Retail Search on Cloud Console before using this feature. + rpc ImportCompletionData(ImportCompletionDataRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/completionData:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.ImportCompletionDataResponse" + metadata_type: "google.cloud.retail.v2alpha.ImportMetadata" + }; + } +} + +// Auto-complete parameters. +message CompleteQueryRequest { + // Required. Catalog for which the completion is performed. + // + // Full resource name of catalog, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The query used to generate suggestions. + // + // The maximum number of allowed characters is 255. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required field. A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able to + // uniquely identify a visitor on a single device. This unique identifier + // should not change if the visitor logs in or out of the website. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string visitor_id = 7; + + // The language filters applied to the output suggestions. If set, it should + // contain the language of the query. If not set, suggestions are returned + // without considering language restrictions. This is the BCP-47 language + // code, such as "en-US" or "sr-Latn". For more information, see [Tags for + // Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + // number of language codes is 3. + repeated string language_codes = 3; + + // The device type context for completion suggestions. + // It is useful to apply different suggestions on different device types, e.g. + // `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + // types. + // + // Supported formats: + // + // * `UNKNOWN_DEVICE_TYPE` + // + // * `DESKTOP` + // + // * `MOBILE` + // + // * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + string device_type = 4; + + // Determines which dataset to use for fetching completion. "user-data" will + // use the imported dataset through + // [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData]. + // "cloud-retail" will use the dataset generated by cloud retail based on user + // events. If leave empty, it will use the "user-data". + // + // Current supported values: + // + // * user-data + // + // * cloud-retail + // This option requires additional allowlisting. Before using cloud-retail, + // contact Cloud Retail support team first. + string dataset = 6; + + // Completion max suggestions. If left unset or set to 0, then will fallback + // to the configured value + // [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions]. + // + // The maximum allowed max suggestions is 20. If it is set higher, it will be + // capped by 20. + int32 max_suggestions = 5; +} + +// Response of the auto-complete query. +message CompleteQueryResponse { + // Resource that represents completion results. + message CompletionResult { + // The suggestion for the query. + string suggestion = 1; + + // Custom attributes for the suggestion term. + // * For "user-data", the attributes are additional custom attributes + // ingested through BigQuery. + // * For "cloud-retail", the attributes are product attributes generated + // by Cloud Retail. + map attributes = 2; + } + + // Recent search of this user. + message RecentSearchResult { + // The recent search query. + string recent_search = 1; + } + + // Results of the matching suggestions. The result list is ordered and the + // first result is top suggestion. + repeated CompletionResult completion_results = 1; + + // A unique complete token. This should be included in the + // [UserEvent.completion_detail][google.cloud.retail.v2alpha.UserEvent.completion_detail] + // for search events resulting from this completion, which enables accurate + // attribution of complete model performance. + string attribution_token = 2; + + // Matched recent searches of this user. The maximum number of recent searches + // is 10. This field is a restricted feature. Contact Retail Search support + // team if you are interested in enabling it. + // + // This feature is only available when + // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id] + // field is set and [UserEvent][google.cloud.retail.v2alpha.UserEvent] is + // imported. The recent searches satisfy the follow rules: + // * They are ordered from latest to oldest. + // * They are matched with + // [CompleteQueryRequest.query][google.cloud.retail.v2alpha.CompleteQueryRequest.query] + // case insensitively. + // * They are transformed to lower cases. + // * They are UTF-8 safe. + // + // Recent searches are deduplicated. More recent searches will be reserved + // when duplication happens. + repeated RecentSearchResult recent_search_results = 3; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control.proto new file mode 100644 index 00000000..4d85015e --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control.proto @@ -0,0 +1,92 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/search_service.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Configures dynamic serving time metadata that is used to pre and post +// process search/recommendation model results. +message Control { + option (google.api.resource) = { + type: "retail.googleapis.com/Control" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}" + }; + + // The behavior/type of the control + // + // A behavior/type must be specified on creation. Type cannot be changed once + // specified (e.g. A Rule control will always be a Rule control.). An + // INVALID_ARGUMENT will be returned if either condition is violated. + oneof control { + // A facet specification to perform faceted search. + SearchRequest.FacetSpec facet_spec = 3; + + // A rule control - a condition-action pair. + // Enacts a set action when the condition is triggered. + // For example: Boost "gShoe" when query full matches "Running Shoes". + Rule rule = 4; + } + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/controls/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable control display name. Used in Retail UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + 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. + // + // 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. + repeated SolutionType solution_types = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. 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 if not specified. + // Currently only allow one search_solution_use_case per control. + repeated SearchSolutionUseCase search_solution_use_case = 7 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control_service.proto new file mode 100644 index 00000000..6372aca6 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/control_service.proto @@ -0,0 +1,184 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/control.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ControlServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for modifying Control. +service ControlService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Control. + // + // If the [Control][google.cloud.retail.v2alpha.Control] to create already + // exists, an ALREADY_EXISTS error is returned. + rpc CreateControl(CreateControlRequest) returns (Control) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/controls" + body: "control" + }; + option (google.api.method_signature) = "parent,control,control_id"; + } + + // Deletes a Control. + // + // If the [Control][google.cloud.retail.v2alpha.Control] to delete does not + // exist, a NOT_FOUND error is returned. + rpc DeleteControl(DeleteControlRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2alpha/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Control. + // + // [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different + // oneof field, if so an INVALID_ARGUMENT is returned. If the + // [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a + // NOT_FOUND error is returned. + rpc UpdateControl(UpdateControlRequest) returns (Control) { + option (google.api.http) = { + patch: "/v2alpha/{control.name=projects/*/locations/*/catalogs/*/controls/*}" + body: "control" + }; + option (google.api.method_signature) = "control,update_mask"; + } + + // Gets a Control. + rpc GetControl(GetControlRequest) returns (Control) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all Controls linked to this catalog. + rpc ListControls(ListControlsRequest) returns (ListControlsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/controls" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for CreateControl method. +message CreateControlRequest { + // Required. Full resource name of parent catalog. 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 Control to create. + Control control = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Control, which will become the final + // component of the Control's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string control_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateControl method. +message UpdateControlRequest { + // Required. The Control to update. + Control control = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Control][google.cloud.retail.v2alpha.Control] to update. The following are + // NOT supported: + // + // * [Control.name][google.cloud.retail.v2alpha.Control.name] + // + // If not set or empty, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for DeleteControl method. +message DeleteControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for GetControl method. +message GetControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for ListControls method. +message ListControlsRequest { + // Required. The catalog resource name. 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 `ListControls` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter to apply on the list results. Supported features: + // + // * List all the products under the parent branch if + // [filter][google.cloud.retail.v2alpha.ListControlsRequest.filter] is unset. + // * List controls that are used in a single ServingConfig: + // 'serving_config = "boosted_home_page_cvr"' + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListControls method. +message ListControlsResponse { + // All the Controls for a given catalog. + repeated Control controls = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto new file mode 100644 index 00000000..f29c7f9a --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto @@ -0,0 +1,77 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ExportConfigProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Configuration of destination for Export related errors. +message ExportErrorsConfig { + // Required. Errors destination. + oneof destination { + // Google Cloud Storage path for import errors. This must be an empty, + // existing Cloud Storage bucket. Export errors will be written to a file in + // this bucket, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Metadata related to the progress of the Export operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ExportMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} + +// Response of the ExportProductsRequest. If the long running +// operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportProductsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ExportErrorsConfig errors_config = 2; +} + +// Response of the ExportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ExportErrorsConfig errors_config = 2; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/import_config.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/import_config.proto new file mode 100644 index 00000000..a1fcf240 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/import_config.proto @@ -0,0 +1,397 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/product.proto"; +import "google/cloud/retail/v2alpha/user_event.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ImportConfigProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// 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, + // `gs://bucket/directory/object.json`) or a pattern matching one or more + // files, such as `gs://bucket/directory/*.json`. A request can + // contain at most 100 files, and each file can be up to 2 GB. See + // [Importing product + // information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) + // for the expected file format and setup instructions. + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; + + // The schema to use when parsing the data from the source. + // + // Supported values for product imports: + // + // * `product` (default): One JSON + // [Product][google.cloud.retail.v2alpha.Product] per line. Each product must + // have a valid [Product.id][google.cloud.retail.v2alpha.Product.id]. + // * `product_merchant_center`: See [Importing catalog data from Merchant + // Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + // + // Supported values for user events imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line. + // * `user_event_ga360`: Using + // https://support.google.com/analytics/answer/3437719. + // + // Supported values for control imports: + // + // * 'control' (default): One JSON + // [Control][google.cloud.retail.v2alpha.Control] per line. + // + // Supported values for catalog attribute imports: + // + // * 'catalog_attribute' (default): One CSV + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line. + string data_schema = 2; +} + +// BigQuery source import data from. +message BigQuerySource { + // BigQuery table partition info. Leave this empty if the BigQuery table + // is not partitioned. + oneof partition { + // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. + google.type.Date partition_date = 6; + } + + // The project ID (can be project # or ID) that the BigQuery source is in with + // a length limit of 128 characters. If not specified, inherits the project + // ID from the parent request. + string project_id = 5; + + // Required. The BigQuery data set to copy the data from with a length limit + // of 1,024 characters. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to copy the data from with a length limit of + // 1,024 characters. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // BigQuery export to a specific Cloud Storage directory. + string gcs_staging_dir = 3; + + // The schema to use when parsing the data from the source. + // + // Supported values for product imports: + // + // * `product` (default): One JSON + // [Product][google.cloud.retail.v2alpha.Product] per line. Each product must + // have a valid [Product.id][google.cloud.retail.v2alpha.Product.id]. + // * `product_merchant_center`: See [Importing catalog data from Merchant + // Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + // + // Supported values for user events imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] per line. + // * `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. + // The schema is available here: + // https://support.google.com/analytics/answer/7029846. + // + // Supported values for auto-completion imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. + string data_schema = 4; +} + +// The inline source for the input config for ImportProducts method. +message ProductInlineSource { + // Required. A list of products to update/create. Each product must have a + // valid [Product.id][google.cloud.retail.v2alpha.Product.id]. Recommended max + // of 100 items. + repeated Product products = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The inline source for the input config for ImportUserEvents method. +message UserEventInlineSource { + // Required. A list of user events to import. Recommended max of 10k items. + repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration of destination for Import related errors. +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 + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Request message for Import methods. +message ImportProductsRequest { + // Indicates how imported products are reconciled with the existing products + // created or imported before. + enum ReconciliationMode { + // Defaults to INCREMENTAL. + RECONCILIATION_MODE_UNSPECIFIED = 0; + + // Inserts new products or updates existing products. + INCREMENTAL = 1; + + // 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.v2alpha.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; + } + + // Required. + // `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + // + // If no updateMask is specified, requires products.create permission. + // If updateMask is specified, requires products.update permission. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Deprecated. This field has no effect. + string request_id = 6 [deprecated = true]; + + // Required. The desired input location of the data. + ProductInputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + google.protobuf.FieldMask update_mask = 4; + + // The mode of reconciliation between existing products and the products to be + // imported. Defaults to + // [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + ReconciliationMode reconciliation_mode = 5; + + // 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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. + string notification_pubsub_topic = 7; +} + +// Request message for the ImportUserEvents request. +message ImportUserEventsRequest { + // Required. `projects/1234/locations/global/catalogs/default_catalog` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The desired input location of the data. + UserEventInputConfig input_config = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The desired location of errors incurred during the Import. Cannot be set + // for inline user event imports. + ImportErrorsConfig errors_config = 3; +} + +// Request message for ImportCompletionData methods. +message ImportCompletionDataRequest { + // Required. The catalog which the suggestions dataset belongs to. + // + // Format: `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The desired input location of the data. + CompletionDataInputConfig input_config = 2 + [(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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + string notification_pubsub_topic = 3; +} + +// The input config source for products. +message ProductInputConfig { + // Required. The source of the input. + oneof source { + // The Inline source for the input content for products. + ProductInlineSource product_inline_source = 1; + + // Google Cloud Storage location for the input content. + GcsSource gcs_source = 2; + + // BigQuery input source. + BigQuerySource big_query_source = 3; + } +} + +// The input config source for user events. +message UserEventInputConfig { + // The source of the input. + oneof source { + // Required. The Inline source for the input content for UserEvents. + UserEventInlineSource user_event_inline_source = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Google Cloud Storage location for the input content. + GcsSource gcs_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. BigQuery input source. + BigQuerySource big_query_source = 3 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// The input config source for completion data. +message CompletionDataInputConfig { + // The source of the input. + // + // Supported + // [BigQuerySource.data_schema][google.cloud.retail.v2alpha.BigQuerySource.data_schema] + // values for suggestions imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. + oneof source { + // Required. BigQuery input source. + // + // 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. + BigQuerySource big_query_source = 1 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// Metadata related to the progress of the Import operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ImportMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were processed successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; + + // Deprecated. This field is never set. + 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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + string notification_pubsub_topic = 6; +} + +// Response of the +// [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest]. +// If the long running operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportProductsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ImportErrorsConfig errors_config = 2; +} + +// Response of the ImportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ImportErrorsConfig errors_config = 2; + + // Aggregated statistics of user event import status. + UserEventImportSummary import_summary = 3; +} + +// A summary of import result. The UserEventImportSummary summarizes +// the import status for user events. +message UserEventImportSummary { + // Count of user events imported with complete existing catalog information. + int64 joined_events_count = 1; + + // Count of user events imported, but with catalog information not found + // in the imported catalog. + int64 unjoined_events_count = 2; +} + +// Response of the +// [ImportCompletionDataRequest][google.cloud.retail.v2alpha.ImportCompletionDataRequest]. +// If the long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +message ImportCompletionDataResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/prediction_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/prediction_service.proto new file mode 100644 index 00000000..5b89bceb --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/prediction_service.proto @@ -0,0 +1,194 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/retail/v2alpha/user_event.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for making recommendation prediction. +service PredictionService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Makes a recommendation prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict" + body: "*" + }; + } +} + +// Request message for Predict method. +message PredictRequest { + // Required. Full resource name of the format: + // {name=projects/*/locations/global/catalogs/default_catalog/placements/*} + // The ID of the Recommendations AI placement. Before you can request + // predictions from your model, you must create at least one placement for it. + // For more information, see [Managing + // placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). + // + // The full list of available placements can be seen at + // https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements + string placement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Context about the user, what they are looking at and what action + // they took to trigger the predict request. Note that this user event detail + // won't be ingested to userEvent logs. Thus, a separate userEvent write + // request is required for event logging. + 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. + int32 page_size = 3; + + // The previous PredictResponse.next_page_token. + string page_token = 4; + + // Filter for restricting prediction results with a length limit of 5,000 + // characters. Accepts values for tags and the `filterOutOfStockItems` flag. + // + // * Tag expressions. Restricts predictions to products that match all of the + // specified tags. Boolean operators `OR` and `NOT` are supported if the + // expression is enclosed in parentheses, and must be separated from the + // tag values by a space. `-"tagA"` is also supported and is equivalent to + // `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + // with a size limit of 1,000 characters. + // + // Note: "Recently viewed" models don't support tag filtering at the + // moment. + // + // * filterOutOfStockItems. Restricts predictions to products that do not + // have a + // stockState value of OUT_OF_STOCK. + // + // Examples: + // + // * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + // * filterOutOfStockItems tag=(-"promotional") + // * filterOutOfStockItems + // + // If your filter blocks all prediction results, the API will return generic + // (unfiltered) popular products. If you only want results strictly matching + // the filters, set `strictFiltering` to True in `PredictRequest.params` to + // receive empty results instead. + // Note that the API will never return items with storageStatus of "EXPIRED" + // or "DELETED" regardless of filter choices. + string filter = 5; + + // Use validate only mode for this prediction query. If set to true, a + // dummy model will be used that returns arbitrary products. + // Note that the validate only mode should only be used for testing the API, + // or if the model is not ready. + bool validate_only = 6; + + // Additional domain specific parameters for the predictions. + // + // Allowed values: + // + // * `returnProduct`: Boolean. If set to true, the associated product + // object will be returned in the `results.metadata` field in the + // prediction response. + // * `returnScore`: Boolean. If set to true, the prediction 'score' + // corresponding to each returned product will be set in the + // `results.metadata` field in the prediction response. The given + // 'score' indicates the probability of an product being clicked/purchased + // given the user's context and history. + // * `strictFiltering`: Boolean. True by default. If set to false, the service + // will return generic (unfiltered) popular products instead of empty if + // your filter blocks all prediction results. + // * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + // it needs to be one of {'no-price-reranking', 'low-price-reranking', + // 'medium-price-reranking', 'high-price-reranking'}. This gives + // request-level control and adjusts prediction results based on product + // price. + // * `diversityLevel`: String. Default empty. If set to be non-empty, then + // it needs to be one of {'no-diversity', 'low-diversity', + // 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + // request-level control and adjusts prediction results based on product + // category. + map params = 7; + + // The labels applied to a resource must meet the following requirements: + // + // * Each resource can have multiple labels, up to a maximum of 64. + // * Each label must be a key-value pair. + // * Keys have a minimum length of 1 character and a maximum length of 63 + // characters, and cannot be empty. Values can be empty, and have a maximum + // length of 63 characters. + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. All characters must use UTF-8 encoding, and + // international characters are allowed. + // * The key portion of a label must be unique. However, you can use the same + // key with multiple resources. + // * Keys must start with a lowercase letter or international character. + // + // See [Google Cloud + // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map labels = 8; +} + +// Response message for predict method. +message PredictResponse { + // PredictionResult represents the recommendation prediction results. + message PredictionResult { + // ID of the recommended product + string id = 1; + + // Additional product metadata / annotations. + // + // Possible values: + // + // * `product`: JSON representation of the product. Will be set if + // `returnProduct` is set to true in `PredictRequest.params`. + // * `score`: Prediction score in double value. Will be set if + // `returnScore` is set to true in `PredictRequest.params`. + map metadata = 2; + } + + // A list of recommended products. The order represents the ranking (from the + // most relevant product to the least). + repeated PredictionResult results = 1; + + // A unique attribution token. This should be included in the + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this + // recommendation, which enables accurate attribution of recommendation model + // performance. + string attribution_token = 2; + + // IDs of products in the request that were missing from the inventory. + repeated string missing_ids = 3; + + // True if the validateOnly property was set in the request. + bool validate_only = 4; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product.proto new file mode 100644 index 00000000..cbadc568 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product.proto @@ -0,0 +1,567 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/promotion.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ProductProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; +option (google.api.resource_definition) = { + type: "retail.googleapis.com/Branch" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}" +}; + +// Product captures all metadata information of items to be recommended or +// searched. +message Product { + option (google.api.resource) = { + type: "retail.googleapis.com/Product" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}" + }; + + // The type of this product. + enum Type { + // Default value. Default to + // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type] + // if unset. + TYPE_UNSPECIFIED = 0; + + // The primary type. + // + // As the primary unit for predicting, indexing and search serving, a + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product] is grouped with multiple + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s. + PRIMARY = 1; + + // The variant type. + // + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s usually share some common + // attributes on the same + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]s, but they have variant + // attributes like different colors, sizes and prices, etc. + VARIANT = 2; + + // The collection type. Collection products are bundled + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]s or + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s that are sold together, + // such as a jewelry set with necklaces, earrings and rings, etc. + COLLECTION = 3; + } + + // Product availability. If this field is unspecified, the product is + // assumed to be in stock. + enum Availability { + // Default product availability. Default to + // [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK] + // if unset. + AVAILABILITY_UNSPECIFIED = 0; + + // Product in stock. + IN_STOCK = 1; + + // Product out of stock. + OUT_OF_STOCK = 2; + + // Product that is in pre-order state. + PREORDER = 3; + + // Product that is back-ordered (i.e. temporarily out of stock). + BACKORDER = 4; + } + + oneof expiration { + // The timestamp when this product becomes unavailable for + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not + // available for + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] + // after [expire_time][google.cloud.retail.v2alpha.Product.expire_time]. + // However, the product can still be retrieved by + // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] + // and + // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // + // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be + // later than + // [available_time][google.cloud.retail.v2alpha.Product.available_time] and + // [publish_time][google.cloud.retail.v2alpha.Product.publish_time], + // otherwise an INVALID_ARGUMENT error is thrown. + // + // Corresponding properties: Google Merchant Center property + // [expiration_date](https://support.google.com/merchants/answer/6324499). + google.protobuf.Timestamp expire_time = 16; + + // Input only. The TTL (time to live) of the product. + // + // If it is set, it must be a non-negative value, and + // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as + // current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl]. + // The derived + // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is + // returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl] + // is left blank when retrieving the + // [Product][google.cloud.retail.v2alpha.Product]. + // + // If it is set, the product is not available for + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] + // after current timestamp plus + // [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can + // still be retrieved by + // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] + // and + // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + google.protobuf.Duration ttl = 17 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Immutable. Full resource name of the product, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. [Product][google.cloud.retail.v2alpha.Product] identifier, which + // is the final component of [name][google.cloud.retail.v2alpha.Product.name]. + // For example, this field is "id_1", if + // [name][google.cloud.retail.v2alpha.Product.name] is + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [id](https://support.google.com/merchants/answer/6324405). Schema.org + // property [Product.sku](https://schema.org/sku). + string id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of the product. Default to + // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type] + // if unset. + Type type = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Variant group identifier. Must be an + // [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch + // with this product. Otherwise, an error is thrown. + // + // For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]s, this field can only be + // empty or set to the same value as + // [id][google.cloud.retail.v2alpha.Product.id]. + // + // For VARIANT [Product][google.cloud.retail.v2alpha.Product]s, this field + // cannot be empty. A maximum of 2,000 products are allowed to share the same + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [item_group_id](https://support.google.com/merchants/answer/6324507). + // Schema.org property + // [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + string primary_product_id = 4; + + // The [id][google.cloud.retail.v2alpha.Product.id] of the collection members + // when [type][google.cloud.retail.v2alpha.Product.type] is + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]. + // + // Non-existent product ids are allowed. + // The [type][google.cloud.retail.v2alpha.Product.type] of the members must be + // either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise + // and 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; + + // The Global Trade Item Number (GTIN) of the product. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Corresponding properties: Google Merchant Center property + // [gtin](https://support.google.com/merchants/answer/6324461). + // Schema.org property + // [Product.isbn](https://schema.org/isbn), + // [Product.gtin8](https://schema.org/gtin8), + // [Product.gtin12](https://schema.org/gtin12), + // [Product.gtin13](https://schema.org/gtin13), or + // [Product.gtin14](https://schema.org/gtin14). + // + // If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + string gtin = 6; + + // Product categories. This field is repeated for supporting one product + // 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 + // other character(s). + // + // For example, if a shoes product belongs to both + // ["Shoes & Accessories" -> "Shoes"] and + // ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + // represented as: + // + // "categories": [ + // "Shoes & Accessories > Shoes", + // "Sports & Fitness > Athletic Clothing > Shoes" + // ] + // + // Must be set for + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product] otherwise an + // INVALID_ARGUMENT error is returned. + // + // At most 250 values are allowed per + // [Product][google.cloud.retail.v2alpha.Product]. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [google_product_category][mc_google_product_category]. Schema.org property + // [Product.category] (https://schema.org/category). + // + // [mc_google_product_category]: + // https://support.google.com/merchants/answer/6324436 + repeated string categories = 7; + + // Required. Product title. + // + // This field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [title](https://support.google.com/merchants/answer/6324415). Schema.org + // property [Product.name](https://schema.org/name). + string title = 8 [(google.api.field_behavior) = REQUIRED]; + + // The brands of the product. + // + // A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded + // string with a length limit of 1,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [brand](https://support.google.com/merchants/answer/6324351). Schema.org + // property [Product.brand](https://schema.org/brand). + repeated string brands = 9; + + // Product description. + // + // This field must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [description](https://support.google.com/merchants/answer/6324468). + // Schema.org property [Product.description](https://schema.org/description). + string description = 10; + + // Language of the title/description and other string attributes. Use language + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // + // For product prediction, this field is ignored and the model automatically + // detects the text language. The + // [Product][google.cloud.retail.v2alpha.Product] can include text in + // different languages, but duplicating + // [Product][google.cloud.retail.v2alpha.Product]s to provide text in multiple + // languages can result in degraded model performance. + // + // For product search this field is in use. It defaults to "en-US" if unset. + string language_code = 11; + + // Highly encouraged. Extra product attributes to be included. For example, + // for products, this could include the store name, vendor, style, color, etc. + // These are very strong signals for recommendation model, thus we highly + // recommend providing the attributes here. + // + // Features that can take on one of a limited number of possible values. Two + // types of features can be set are: + // + // Textual features. some examples would be the brand/maker of a product, or + // country of a customer. Numerical features. Some examples would be the + // height/weight of a product, or age of a customer. + // + // For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + // "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + // }`. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * Max entries count: 200. + // * The key must be a UTF-8 encoded string with a length limit of 128 + // characters. + // * For indexable attribute, the key must match the pattern: + // `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + // `KEY_1_LIKE_THIS`. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a non-empty UTF-8 encoded string with a + // length limit of 256 characters. + // * For number attributes, at most 400 values are allowed. + map attributes = 12; + + // Custom tags associated with the product. + // + // At most 250 values are allowed per + // [Product][google.cloud.retail.v2alpha.Product]. This value must be a UTF-8 + // encoded string with a length limit of 1,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // This tag can be used for filtering recommendation results by passing the + // tag as part of the + // [PredictRequest.filter][google.cloud.retail.v2alpha.PredictRequest.filter]. + // + // Corresponding properties: Google Merchant Center property + // [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + repeated string tags = 13; + + // Product price and cost information. + // + // Corresponding properties: Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 14; + + // The rating of this product. + Rating rating = 15; + + // The timestamp when this [Product][google.cloud.retail.v2alpha.Product] + // becomes available for + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + google.protobuf.Timestamp available_time = 18; + + // The online availability of the + // [Product][google.cloud.retail.v2alpha.Product]. Default to + // [Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK]. + // + // Corresponding properties: Google Merchant Center property + // [availability](https://support.google.com/merchants/answer/6324448). + // Schema.org property [Offer.availability](https://schema.org/availability). + Availability availability = 19; + + // The available quantity of the item. + google.protobuf.Int32Value available_quantity = 20; + + // Fulfillment information, such as the store IDs for in-store pickup or + // region IDs for different shipping methods. + // + // All the elements must have distinct + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type]. + // Otherwise, an INVALID_ARGUMENT error is returned. + repeated FulfillmentInfo fulfillment_info = 21; + + // Canonical URL directly linking to the product detail page. + // + // It is strongly recommended to provide a valid uri for the product, + // otherwise the service performance could be significantly degraded. + // + // This field must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [link](https://support.google.com/merchants/answer/6324416). Schema.org + // property [Offer.url](https://schema.org/url). + string uri = 22; + + // Product images for the product. We highly recommend putting the main + // image first. + // + // A maximum of 300 images are allowed. + // + // Corresponding properties: Google Merchant Center property + // [image_link](https://support.google.com/merchants/answer/6324350). + // Schema.org property [Product.image](https://schema.org/image). + repeated Image images = 23; + + // The target group associated with a given audience (e.g. male, veterans, + // car owners, musicians, etc.) of the product. + Audience audience = 24; + + // The color of the product. + // + // Corresponding properties: Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + ColorInfo color_info = 25; + + // The size of the product. To represent different size systems or size types, + // consider using this format: [[[size_system:]size_type:]size_value]. + // + // For example, in "US:MENS:M", "US" represents size system; "MENS" represents + // size type; "M" represents size value. In "GIRLS:27", size system is empty; + // "GIRLS" represents size type; "27" represents size value. In "32 inches", + // both size system and size type are empty, while size value is "32 inches". + // + // A maximum of 20 values are allowed per + // [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [size](https://support.google.com/merchants/answer/6324492), + // [size_type](https://support.google.com/merchants/answer/6324497), and + // [size_system](https://support.google.com/merchants/answer/6324502). + // Schema.org property [Product.size](https://schema.org/size). + repeated string sizes = 26; + + // The material of the product. For example, "leather", "wooden". + // + // A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 200 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [material](https://support.google.com/merchants/answer/6324410). Schema.org + // property [Product.material](https://schema.org/material). + repeated string materials = 27; + + // The pattern or graphic print of the product. For example, "striped", "polka + // dot", "paisley". + // + // A maximum of 20 values are allowed per + // [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + // property [Product.pattern](https://schema.org/pattern). + repeated string patterns = 28; + + // The condition of the product. Strongly encouraged to use the standard + // values: "new", "refurbished", "used". + // + // A maximum of 1 value is allowed per + // [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [condition](https://support.google.com/merchants/answer/6324469). + // Schema.org property + // [Offer.itemCondition](https://schema.org/itemCondition). + repeated string conditions = 29; + + // The promotions applied to the product. A maximum of 10 values are allowed + // per [Product][google.cloud.retail.v2alpha.Product]. Only + // [Promotion.promotion_id][google.cloud.retail.v2alpha.Promotion.promotion_id] + // will be used, other fields will be ignored if set. + repeated Promotion promotions = 34; + + // The timestamp when the product is published by the retailer for the first + // time, which indicates the freshness of the products. Note that this field + // is different from + // [available_time][google.cloud.retail.v2alpha.Product.available_time], given + // it purely describes product freshness regardless of when it is available on + // search and recommendation. + google.protobuf.Timestamp publish_time = 33; + + // Indicates which fields in the + // [Product][google.cloud.retail.v2alpha.Product]s are returned in + // [SearchResponse][google.cloud.retail.v2alpha.SearchResponse]. + // + // Supported fields for all [type][google.cloud.retail.v2alpha.Product.type]s: + // + // * [audience][google.cloud.retail.v2alpha.Product.audience] + // * [availability][google.cloud.retail.v2alpha.Product.availability] + // * [brands][google.cloud.retail.v2alpha.Product.brands] + // * [color_info][google.cloud.retail.v2alpha.Product.color_info] + // * [conditions][google.cloud.retail.v2alpha.Product.conditions] + // * [gtin][google.cloud.retail.v2alpha.Product.gtin] + // * [materials][google.cloud.retail.v2alpha.Product.materials] + // * [name][google.cloud.retail.v2alpha.Product.name] + // * [patterns][google.cloud.retail.v2alpha.Product.patterns] + // * [price_info][google.cloud.retail.v2alpha.Product.price_info] + // * [rating][google.cloud.retail.v2alpha.Product.rating] + // * [sizes][google.cloud.retail.v2alpha.Product.sizes] + // * [title][google.cloud.retail.v2alpha.Product.title] + // * [uri][google.cloud.retail.v2alpha.Product.uri] + // + // Supported fields only for + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]: + // + // * [categories][google.cloud.retail.v2alpha.Product.categories] + // * [description][google.cloud.retail.v2alpha.Product.description] + // * [images][google.cloud.retail.v2alpha.Product.images] + // + // Supported fields only for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]: + // + // * Only the first image in + // [images][google.cloud.retail.v2alpha.Product.images] + // + // To mark [attributes][google.cloud.retail.v2alpha.Product.attributes] as + // retrievable, include paths of the form "attributes.key" where "key" is the + // key of a custom attribute, as specified in + // [attributes][google.cloud.retail.v2alpha.Product.attributes]. + // + // For [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], the + // following fields are always returned in + // [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] by default: + // + // * [name][google.cloud.retail.v2alpha.Product.name] + // + // For [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT], the + // following fields are always returned in by default: + // + // * [name][google.cloud.retail.v2alpha.Product.name] + // * [color_info][google.cloud.retail.v2alpha.Product.color_info] + // + // Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Note: Returning more fields in + // [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] may increase + // response payload size and serving latency. + google.protobuf.FieldMask retrievable_fields = 30; + + // Output only. Product variants grouped together on primary product which + // share similar product attributes. It's automatically grouped by + // [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id] + // for all the product variants. Only populated for + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]s. + // + // Note: This field is OUTPUT_ONLY for + // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. + // Do not set this field in API requests. + repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product_service.proto new file mode 100644 index 00000000..7bced3fb --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/product_service.proto @@ -0,0 +1,882 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/import_config.proto"; +import "google/cloud/retail/v2alpha/product.proto"; +import "google/cloud/retail/v2alpha/purge_config.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ProductServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for ingesting [Product][google.cloud.retail.v2alpha.Product] +// information of the customer's website. +service ProductService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a [Product][google.cloud.retail.v2alpha.Product]. + rpc CreateProduct(CreateProductRequest) returns (Product) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" + body: "product" + }; + option (google.api.method_signature) = "parent,product,product_id"; + } + + // Gets a [Product][google.cloud.retail.v2alpha.Product]. + rpc GetProduct(GetProductRequest) returns (Product) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a [Product][google.cloud.retail.v2alpha.Product]. + rpc UpdateProduct(UpdateProductRequest) returns (Product) { + option (google.api.http) = { + patch: "/v2alpha/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + body: "product" + }; + option (google.api.method_signature) = "product,update_mask"; + } + + // Deletes a [Product][google.cloud.retail.v2alpha.Product]. + rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Permanently deletes all selected + // [Product][google.cloud.retail.v2alpha.Product]s under a branch. + // + // This process is asynchronous. If the request is valid, the removal will be + // enqueued and processed offline. Depending on the number of + // [Product][google.cloud.retail.v2alpha.Product]s, this operation could take + // hours to complete. Before the operation completes, some + // [Product][google.cloud.retail.v2alpha.Product]s may still be returned by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // + // Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, + // this operation could take hours to complete. To get a sample of + // [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set + // [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] + // to false. + rpc PurgeProducts(PurgeProductsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.PurgeProductsResponse" + metadata_type: "google.cloud.retail.v2alpha.PurgeProductsMetadata" + }; + } + + // Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. + // + // Request processing may be synchronous. No partial updating is supported. + // Non-existing items are created. + // + // Note that it is possible for a subset of the + // [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated. + rpc ImportProducts(ImportProductsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.ImportProductsResponse" + metadata_type: "google.cloud.retail.v2alpha.ImportMetadata" + }; + } + + // Updates inventory information for a + // [Product][google.cloud.retail.v2alpha.Product] while respecting the last + // update timestamps of each inventory field. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2alpha.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, updates are not immediately manifested in the + // [Product][google.cloud.retail.v2alpha.Product] queried by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // + // When inventory is updated with + // [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] + // and + // [UpdateProduct][google.cloud.retail.v2alpha.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 + // [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] + // or + // [UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] + // request. + // + // If no inventory fields are set in + // [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], + // then any pre-existing inventory information for this product will be used. + // + // If no inventory fields are set in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], + // then any existing inventory information will be preserved. + // + // Pre-existing inventory information can only be updated with + // [SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], + // [AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], + // and + // [RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.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. + rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" + body: "*" + }; + option (google.api.method_signature) = "inventory,set_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.SetInventoryResponse" + metadata_type: "google.cloud.retail.v2alpha.SetInventoryMetadata" + }; + } + + // Incrementally adds place IDs to + // [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2alpha.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, the added place IDs are not immediately manifested in the + // [Product][google.cloud.retail.v2alpha.Product] queried by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.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. + rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse" + metadata_type: "google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata" + }; + } + + // Incrementally removes place IDs from a + // [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2alpha.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, the removed place IDs are not immediately manifested in the + // [Product][google.cloud.retail.v2alpha.Product] queried by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.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. + rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse" + metadata_type: "google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata" + }; + } + + // Updates local inventory information for a + // [Product][google.cloud.retail.v2alpha.Product] at a list of places, while + // respecting the last update timestamps of each inventory field. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2alpha.Product] to exist before updating + // inventory information. If the request is valid, the update will be enqueued + // and processed downstream. As a consequence, when a response is returned, + // updates are not immediately manifested in the + // [Product][google.cloud.retail.v2alpha.Product] queried by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // + // Local inventory information can only be modified using this method. + // [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] + // and + // [UpdateProduct][google.cloud.retail.v2alpha.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. + rpc AddLocalInventories(AddLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.AddLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2alpha.AddLocalInventoriesMetadata" + }; + } + + // Remove local inventory information for a + // [Product][google.cloud.retail.v2alpha.Product] at a list of places at a + // removal timestamp. + // + // This process is asynchronous. If the request is valid, the removal will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, removals are not immediately manifested in the + // [Product][google.cloud.retail.v2alpha.Product] queried by + // [GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // + // Local inventory information can only be removed using this method. + // [CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] + // and + // [UpdateProduct][google.cloud.retail.v2alpha.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. + rpc RemoveLocalInventories(RemoveLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata" + }; + } +} + +// Request message for [CreateProduct][] method. +message CreateProductRequest { + // Required. The parent catalog resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Required. The [Product][google.cloud.retail.v2alpha.Product] to create. + Product product = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Product][google.cloud.retail.v2alpha.Product], which will become the final + // component of the [Product.name][google.cloud.retail.v2alpha.Product.name]. + // + // If the caller does not have permission to create the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + // + // This field must be unique among all + // [Product][google.cloud.retail.v2alpha.Product]s with the same + // [parent][google.cloud.retail.v2alpha.CreateProductRequest.parent]. + // Otherwise, an ALREADY_EXISTS error is returned. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string product_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [GetProduct][] method. +message GetProductRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + // + // If the requested [Product][google.cloud.retail.v2alpha.Product] does not + // exist, a NOT_FOUND error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + +// Request message for [UpdateProduct][] method. +message UpdateProductRequest { + // Required. The product to update/create. + // + // If the caller does not have permission to update the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2alpha.Product] to update does not + // exist and + // [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing] + // is not set, a NOT_FOUND error is returned. + Product product = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Product][google.cloud.retail.v2alpha.Product] to update. The immutable and + // output only fields are NOT supported. If not set, all supported fields (the + // fields that are neither immutable nor output only) are updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is + // not found, a new [Product][google.cloud.retail.v2alpha.Product] will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for [DeleteProduct][] method. +message DeleteProductRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to delete the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2alpha.Product] to delete does not + // exist, a NOT_FOUND error is returned. + // + // The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be + // a + // [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2alpha.Product] member nor a + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product] with more than one + // [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // All inventory information for the named + // [Product][google.cloud.retail.v2alpha.Product] will be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + +// Request message for +// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] +// method. +message ListProductsRequest { + // Required. The parent branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + // `default_branch` as the branch ID, to list products under the default + // branch. + // + // If the caller does not have permission to list + // [Product][google.cloud.retail.v2alpha.Product]s under this branch, + // regardless of whether or not this branch exists, a PERMISSION_DENIED error + // is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to + // return. If unspecified, defaults to 100. The maximum allowed value is 1000. + // Values above 1000 will be coerced to 1000. + // + // If this field is negative, an INVALID_ARGUMENT error is returned. + int32 page_size = 2; + + // A page token + // [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token], + // received from a previous + // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 3; + + // A filter to apply on the list results. Supported features: + // + // * List all the products under the parent branch if + // [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset. + // * List + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s sharing the same + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product]. For example: + // `primary_product_id = "some_product_id"` + // * List [Product][google.cloud.retail.v2alpha.Product]s bundled in a + // [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2alpha.Product]. + // For example: + // `collection_product_id = "some_product_id"` + // * List [Product][google.cloud.retail.v2alpha.Product]s with a partibular + // type. For example: + // `type = "PRIMARY"` + // `type = "VARIANT"` + // `type = "COLLECTION"` + // + // If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + // + // If the specified + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2alpha.Product] or + // [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND + // error is returned. + string filter = 4; + + // The fields of [Product][google.cloud.retail.v2alpha.Product] to return in + // the responses. If not set or empty, the following fields are returned: + // + // * [Product.name][google.cloud.retail.v2alpha.Product.name] + // * [Product.id][google.cloud.retail.v2alpha.Product.id] + // * [Product.title][google.cloud.retail.v2alpha.Product.title] + // * [Product.uri][google.cloud.retail.v2alpha.Product.uri] + // * [Product.images][google.cloud.retail.v2alpha.Product.images] + // * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + // * [Product.brands][google.cloud.retail.v2alpha.Product.brands] + // + // If "*" is provided, all fields are returned. + // [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned + // no matter what mask is set. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask read_mask = 5; + + // If true and + // [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is + // empty, + // [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size] + // is set to the total count of matched items irrespective of pagination. + // + // Notice that setting this field to true affects the performance. + bool require_total_size = 6; +} + +// Response message for +// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] +// method. +message ListProductsResponse { + // The [Product][google.cloud.retail.v2alpha.Product]s. + repeated Product products = 1; + + // A token that can be sent as + // [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; + + // The total count of matched [Product][google.cloud.retail.v2alpha.Product]s + // irrespective of pagination. The total number of + // [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may + // be less than the + // [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size] + // that matches. + // + // This field is ignored if + // [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size] + // is not set or + // [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] + // is not empty. + int32 total_size = 3; +} + +// Request message for [SetInventory][] method. +message SetInventoryRequest { + // Required. The inventory information to update. The allowable fields to + // update are: + // * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + // * [Product.availability][google.cloud.retail.v2alpha.Product.availability] + // * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity] + // * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info] + // The updated inventory fields must be specified in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]. + // + // If [SetInventoryRequest.inventory.name][] is empty or invalid, an + // INVALID_ARGUMENT error is returned. + // + // If the caller does not have permission to update the + // [Product][google.cloud.retail.v2alpha.Product] named in + // [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of + // whether or not it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2alpha.Product] to update does not + // have existing inventory information, the provided inventory information + // will be inserted. + // + // If the [Product][google.cloud.retail.v2alpha.Product] to update has + // existing inventory information, the provided inventory information will be + // merged while respecting the last update time for each inventory field, + // using the provided or default value for + // [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time]. + // + // The caller can replace place IDs for a subset of fulfillment types in the + // following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types and corresponding place IDs + // to update in [SetInventoryRequest.inventory.fulfillment_info][] + // + // The caller can clear all place IDs from a subset of fulfillment types in + // the following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types to clear in + // [SetInventoryRequest.inventory.fulfillment_info][] + // * Checks that only the desired fulfillment info types have empty + // [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + // + // The last update time is recorded for the following inventory fields: + // * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + // * [Product.availability][google.cloud.retail.v2alpha.Product.availability] + // * [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity] + // * [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info] + // + // If a full overwrite of inventory information while ignoring timestamps is + // needed, [UpdateProduct][] should be invoked instead. + Product inventory = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided + // [Product][google.cloud.retail.v2alpha.Product] to update. + // + // At least one field must be provided. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask set_mask = 2; + + // The time when the request is issued, used to prevent + // out-of-order updates on inventory fields with the last update time + // recorded. If not provided, the internal system time will be used. + google.protobuf.Timestamp set_time = 3; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] with + // name [Product.name][google.cloud.retail.v2alpha.Product.name] is not found, + // the inventory update will still be processed and retained for at most 1 day + // until the [Product][google.cloud.retail.v2alpha.Product] is created. If set + // to false, a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2alpha.Product] is not found. + bool allow_missing = 4; +} + +// Metadata related to the progress of the SetInventory operation. +// Currently empty because there is no meaningful metadata populated from the +// [SetInventory][] method. +message SetInventoryMetadata {} + +// Response of the SetInventoryRequest. Currently empty because +// there is no meaningful response populated from the [SetInventory][] +// method. +message SetInventoryResponse {} + +// Request message for [AddFulfillmentPlaces][] method. +message AddFulfillmentPlacesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. The fulfillment type, including commonly used types (such as + // pickup in store and same day delivery), and custom types. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // This field directly corresponds to [Product.fulfillment_info.type][]. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IDs for this + // [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type], such + // as the store IDs for "pickup-in-store" or the region IDs for + // "same-day-delivery" to be added for this + // [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type]. + // Duplicate IDs will be automatically ignored. + // + // At least 1 value is required, and a maximum of 2000 values are allowed. + // Each value must be a string with a length limit of 10 characters, matching + // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // If the total number of place IDs exceeds 2000 for this + // [type][google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.type] after + // adding, then the update will be rejected. + repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED]; + + // The time when the fulfillment updates are issued, used to prevent + // out-of-order updates on fulfillment information. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 4; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is + // not found, the fulfillment information will still be processed and retained + // for at most 1 day and processed once the + // [Product][google.cloud.retail.v2alpha.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2alpha.Product] is not found. + bool allow_missing = 5; +} + +// Metadata related to the progress of the AddFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddFulfillmentPlaces][] method. +message AddFulfillmentPlacesMetadata {} + +// Response of the AddFulfillmentPlacesRequest. Currently empty because +// there is no meaningful response populated from the [AddFulfillmentPlaces][] +// method. +message AddFulfillmentPlacesResponse {} + +// Request message for [AddLocalInventories][] method. +message AddLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of inventory information at difference places. Each place + // is identified by its place ID. At most 3000 inventories are allowed per + // request. + repeated LocalInventory local_inventories = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided list of + // [LocalInventory][google.cloud.retail.v2alpha.LocalInventory] to update. The + // field is updated to the provided value. + // + // If a field is set while the place does not have a previous local inventory, + // the local inventory at that store is created. + // + // If a field is set while the value of that field is not provided, the + // original field value, if it exists, is deleted. + // + // If the mask is not set or set with empty paths, all inventory fields will + // be updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask add_mask = 4; + + // The time when the inventory updates are issued. Used to prevent + // out-of-order updates on local inventory fields. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is + // not found, the local inventory will still be processed and retained for at + // most 1 day and processed once the + // [Product][google.cloud.retail.v2alpha.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2alpha.Product] is not found. + bool allow_missing = 6; +} + +// Metadata related to the progress of the AddLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddLocalInventories][] method. +message AddLocalInventoriesMetadata {} + +// Response of the [AddLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [AddLocalInventories][] +// method. +message AddLocalInventoriesResponse {} + +// Request message for [RemoveLocalInventories][] method. +message RemoveLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of place IDs to have their inventory deleted. + // At most 3000 place IDs are allowed per request. + repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time when the inventory deletions are issued. Used to prevent + // out-of-order updates and deletions on local inventory fields. If not + // provided, the internal system time will be used. + google.protobuf.Timestamp remove_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is + // not found, the local inventory removal request will still be processed and + // retained for at most 1 day and processed once the + // [Product][google.cloud.retail.v2alpha.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2alpha.Product] is not found. + bool allow_missing = 3; +} + +// Metadata related to the progress of the RemoveLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveLocalInventories][] method. +message RemoveLocalInventoriesMetadata {} + +// Response of the [RemoveLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [RemoveLocalInventories][] +// method. +message RemoveLocalInventoriesResponse {} + +// Request message for [RemoveFulfillmentPlaces][] method. +message RemoveFulfillmentPlacesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2alpha.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2alpha.Product], regardless of whether or + // not it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. The fulfillment type, including commonly used types (such as + // pickup in store and same day delivery), and custom types. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // This field directly corresponds to [Product.fulfillment_info.type][]. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IDs for this + // [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type], + // such as the store IDs for "pickup-in-store" or the region IDs for + // "same-day-delivery", to be removed for this + // [type][google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.type]. + // + // At least 1 value is required, and a maximum of 2000 values are allowed. + // Each value must be a string with a length limit of 10 characters, matching + // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + // INVALID_ARGUMENT error is returned. + repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED]; + + // The time when the fulfillment updates are issued, used to prevent + // out-of-order updates on fulfillment information. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp remove_time = 4; + + // If set to true, and the [Product][google.cloud.retail.v2alpha.Product] is + // not found, the fulfillment information will still be processed and retained + // for at most 1 day and processed once the + // [Product][google.cloud.retail.v2alpha.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2alpha.Product] is not found. + bool allow_missing = 5; +} + +// Metadata related to the progress of the RemoveFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveFulfillmentPlaces][] method. +message RemoveFulfillmentPlacesMetadata {} + +// Response of the RemoveFulfillmentPlacesRequest. Currently empty because there +// is no meaningful response populated from the [RemoveFulfillmentPlaces][] +// method. +message RemoveFulfillmentPlacesResponse {} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/promotion.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/promotion.proto new file mode 100644 index 00000000..879449a4 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/promotion.proto @@ -0,0 +1,40 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "PromotionProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Promotion information. +message Promotion { + // ID of the promotion. For example, "free gift". + // + // The value must be a UTF-8 encoded string with a length limit of 128 + // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Google Merchant Center property + // [promotion](https://support.google.com/merchants/answer/7050148). + string promotion_id = 1; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/purge_config.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/purge_config.proto new file mode 100644 index 00000000..6b929f26 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/purge_config.proto @@ -0,0 +1,171 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "PurgeConfigProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Metadata related to the progress of the Purge operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeMetadata {} + +// Metadata related to the progress of the PurgeProducts operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeProductsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were deleted successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} + +// Request message for PurgeProducts method. +message PurgeProductsRequest { + // Required. The resource name of the branch under which the products are + // created. The format is + // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Required. The filter string to specify the products to be deleted with a + // length limit of 5,000 characters. + // + // Empty string filter is not allowed. "*" implies delete all items in a + // branch. + // + // The eligible fields for filtering are: + // + // * `availability`: Double quoted + // [Product.availability][google.cloud.retail.v2alpha.Product.availability] + // string. + // * `create_time` : in ISO 8601 "zulu" format. + // + // Supported syntax: + // + // * Comparators (">", "<", ">=", "<=", "="). + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" + // * availability = "IN_STOCK" + // + // * Conjunctions ("AND") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + // + // * Disjunctions ("OR") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + // + // * Can support nested queries. + // Examples: + // * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + // OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + // + // * Filter Limits: + // * Filter should not contain more than 6 conditions. + // * Max nesting depth should not exceed 2 levels. + // + // Examples queries: + // * Delete back order products created before a timestamp. + // create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually perform the purge. + // If `force` is set to false, the method will return the expected purge count + // without deleting any products. + bool force = 3; +} + +// Response of the PurgeProductsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeProductsResponse { + // The total count of products purged as a result of the operation. + int64 purge_count = 1; + + // A sample of the product names that will be deleted. + // Only populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + repeated string purge_sample = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + +// Request message for PurgeUserEvents method. +message PurgeUserEventsRequest { + // Required. The resource name of the catalog under which the events are + // created. The format is + // `projects/${projectId}/locations/global/catalogs/${catalogId}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The filter string to specify the events to be deleted with a + // length limit of 5,000 characters. Empty string filter is not allowed. The + // eligible fields for filtering are: + // + // * `eventType`: Double quoted + // [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type] + // string. + // * `eventTime`: in ISO 8601 "zulu" format. + // * `visitorId`: Double quoted string. Specifying this will delete all + // events associated with a visitor. + // * `userId`: Double quoted string. Specifying this will delete all events + // associated with a user. + // + // Examples: + // + // * Deleting all events in a time range: + // `eventTime > "2012-04-23T18:25:43.511Z" + // eventTime < "2012-04-23T18:30:43.511Z"` + // * Deleting specific eventType in time range: + // `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + // * Deleting all events for a specific visitor: + // `visitorId = "visitor1024"` + // + // The filtering fields are assumed to have an implicit AND. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually perform the purge. + // If `force` is set to false, the method will return the expected purge count + // without deleting any user events. + bool force = 3; +} + +// Response of the PurgeUserEventsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeUserEventsResponse { + // The total count of events purged as a result of the operation. + int64 purged_events_count = 1; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/search_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/search_service.proto new file mode 100644 index 00000000..f9612734 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/search_service.proto @@ -0,0 +1,832 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/product.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "SearchServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for search. +// +// This feature is only available for users who have Retail Search enabled. +// Please 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) = + "https://www.googleapis.com/auth/cloud-platform"; + + // 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. + rpc Search(SearchRequest) returns (SearchResponse) { + option (google.api.http) = { + post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" + body: "*" + }; + } +} + +// Request message for +// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] +// method. +message SearchRequest { + // A facet specification to perform faceted search. + message FacetSpec { + // Specifies how a facet is computed. + message FacetKey { + // Required. Supported textual and numerical facet keys in + // [Product][google.cloud.retail.v2alpha.Product] object, over which the + // facet values are computed. Facet key is case-sensitive. + // + // Allowed facet keys when + // [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query] + // is not specified: + // + // * textual_field = + // * "brands" + // * "categories" + // * "genders" + // * "ageGroups" + // * "availability" + // * "colorFamilies" + // * "colors" + // * "sizes" + // * "materials" + // * "patterns" + // * "conditions" + // * "attributes.key" + // * "pickupInStore" + // * "shipToStore" + // * "sameDayDelivery" + // * "nextDayDelivery" + // * "customFulfillment1" + // * "customFulfillment2" + // * "customFulfillment3" + // * "customFulfillment4" + // * "customFulfillment5" + // * "inventory(place_id,attributes.key)" + // + // * numerical_field = + // * "price" + // * "discount" + // * "rating" + // * "ratingCount" + // * "attributes.key" + // * "inventory(place_id,price)" + // * "inventory(place_id,original_price)" + // * "inventory(place_id,attributes.key)" + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Set only if values should be bucketized into intervals. Must be set + // for facets with numerical values. Must not be set for facet with text + // values. Maximum number of intervals is 30. + repeated Interval intervals = 2; + + // Only get facet for the given restricted values. For example, when using + // "pickupInStore" as key and set restricted values to + // ["store123", "store456"], only facets for "store123" and "store456" are + // returned. Only supported on textual fields and fulfillments. + // Maximum is 20. + // + // Must be set for the fulfillment facet keys: + // + // * pickupInStore + // + // * shipToStore + // + // * sameDayDelivery + // + // * nextDayDelivery + // + // * customFulfillment1 + // + // * customFulfillment2 + // + // * customFulfillment3 + // + // * customFulfillment4 + // + // * customFulfillment5 + repeated string restricted_values = 3; + + // Only get facet values that start with the given string prefix. For + // example, suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // Only supported on textual fields. Maximum is 10. + repeated string prefixes = 8; + + // Only get facet values that contains the given strings. For example, + // suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // Only supported on textual fields. Maximum is 10. + repeated string contains = 9; + + // The order in which [Facet.values][] are returned. + // + // Allowed values are: + // + // * "count desc", which means order by [Facet.FacetValue.count][] + // descending. + // + // * "value desc", which means order by [Facet.FacetValue.value][] + // descending. + // Only applies to textual facets. + // + // If not set, textual values are sorted in [natural + // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + // intervals are sorted in the order given by + // [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals]; + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // are sorted in the order given by + // [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values]. + string order_by = 4; + + // The query that is used to compute facet for the given facet key. + // When provided, it will override the default behavior of facet + // computation. The query syntax is the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] + // for detail syntax and limitations. Notice that there is no limitation + // on + // [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key] + // when query is specified. + // + // In the response, [FacetValue.value][] will be always "1" and + // [FacetValue.count][] will be the number of results that matches the + // query. + // + // For example, you can set a customized facet for "shipToStore", + // where + // [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key] + // is "customizedShipToStore", and + // [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query] + // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + // Then the facet will count the products that are both in stock and ship + // to store "123". + string query = 5; + } + + // Required. The facet key specification. + FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Maximum of facet values that should be returned for this facet. If + // unspecified, defaults to 20. The maximum allowed value is 300. Values + // above 300 will be coerced to 300. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 limit = 2; + + // List of keys to exclude when faceting. + // + // By default, + // [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key] + // is not excluded from the filter unless it is listed in this field. + // + // For example, suppose there are 100 products with color facet "Red" and + // 200 products with color facet "Blue". A query containing the filter + // "colorFamilies:ANY("Red")" and have "colorFamilies" as + // [FacetKey.key][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.key] + // will by default return the "Red" with count 100. + // + // If this field contains "colorFamilies", then the query returns both the + // "Red" with count 100 and "Blue" with count 200, because the + // "colorFamilies" key is now excluded from the filter. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated string excluded_filter_keys = 3; + + // Enables dynamic position for this facet. If set to true, the position of + // this facet among all facets in the response is determined by Google + // Retail Search. It will be ordered together with dynamic facets if dynamic + // facets is enabled. If set to false, the position of this facet in the + // response will be the same as in the request, and it will be ranked before + // the facets with dynamic position enable and all dynamic facets. + // + // For example, you may always want to have rating facet returned in + // the response, but it's not necessarily to always display the rating facet + // at the top. In that case, you can set enable_dynamic_position to true so + // that the position of rating facet in response will be determined by + // Google Retail Search. + // + // Another example, assuming you have the following facets in the request: + // + // * "rating", enable_dynamic_position = true + // + // * "price", enable_dynamic_position = false + // + // * "brands", enable_dynamic_position = false + // + // And also you have a dynamic facets enable, which will generate a facet + // 'gender'. Then the final order of the facets in the response can be + // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + // "rating") depends on how Google Retail Search orders "gender" and + // "rating" facets. However, notice that "price" and "brands" will always be + // ranked at 1st and 2nd position since their enable_dynamic_position are + // false. + bool enable_dynamic_position = 4; + } + + // The specifications of dynamically generated facets. + message DynamicFacetSpec { + // Enum to control DynamicFacet mode + enum Mode { + // Default value. + MODE_UNSPECIFIED = 0; + + // Disable Dynamic Facet. + DISABLED = 1; + + // Automatic mode built by Google Retail Search. + ENABLED = 2; + } + + // Mode of the DynamicFacet feature. + // Defaults to + // [Mode.DISABLED][google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + // if it's unset. + Mode mode = 1; + } + + // Boost specification to boost certain items. + message BoostSpec { + // Boost applies to products which match a condition. + message ConditionBoostSpec { + // An expression which specifies a boost condition. The syntax and + // supported fields are the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] + // for detail syntax and limitations. + // + // Examples: + // + // * To boost products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue": + // * (id: ANY("product_1", "product_2")) AND (colorFamilies: + // ANY("Red","Blue")) + string condition = 1; + + // Strength of the condition boost, which should be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the item a big promotion. However, it does not + // necessarily mean that the boosted item will be the top result at all + // times, nor that other items will be excluded. Results could still be + // shown even when none of them matches the condition. And results that + // are significantly more relevant to the search query can still trump + // your heavily favored but irrelevant items. + // + // Setting to -1.0 gives the item a big demotion. However, results that + // are deeply relevant might still be shown. The item will have an + // upstream battle to get a fairly high ranking, but it is not blocked out + // completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2; + } + + // Condition boost specifications. If a product matches multiple conditions + // in the specifictions, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 10. + repeated ConditionBoostSpec condition_boost_specs = 1; + + // Whether to skip boostspec validation. If this field is set to true, + // invalid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs] + // will be ignored and valid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs] + // will still be applied. + optional bool skip_boost_spec_validation = 2; + } + + // Specification to determine under which conditions query expansion should + // occur. + message QueryExpansionSpec { + // Enum describing under which condition query expansion should occur. + enum Condition { + // Unspecified query expansion condition. This defaults to + // [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + CONDITION_UNSPECIFIED = 0; + + // Disabled query expansion. Only the exact search query is used, even if + // [SearchResponse.total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] + // is zero. + DISABLED = 1; + + // Automatic query expansion built by Google Retail Search. + AUTO = 3; + } + + // The condition under which query expansion should occur. Default to + // [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + Condition condition = 1; + + // Whether to pin unexpanded results. If this field is set to true, + // unexpanded products are always at the top of the search results, followed + // by the expanded results. + bool pin_unexpanded_results = 2; + } + + // The specification for personalization. + message PersonalizationSpec { + // The personalization mode of each search request. + enum Mode { + // Default value. Defaults to + // [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Let CRS decide whether to use personalization. + AUTO = 1; + + // Disable personalization. + DISABLED = 2; + } + + // Defaults to + // [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. + Mode mode = 1; + } + + // The relevance threshold of the search results. The higher relevance + // threshold is, the higher relevant results are shown and the less number of + // results are returned. + enum RelevanceThreshold { + // Default value. Defaults to + // [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH]. + RELEVANCE_THRESHOLD_UNSPECIFIED = 0; + + // High relevance threshold. + HIGH = 1; + + // Medium relevance threshold. + MEDIUM = 2; + + // Low relevance threshold. + LOW = 3; + + // Lowest relevance threshold. + LOWEST = 4; + } + + // 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. + 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 + // [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs] + // or + // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] + // is set. + PRODUCT_SEARCH_ONLY = 1; + + // Only faceted search will be performed. The product search will be + // disabled. + // + // When in this mode, one or both of [SearchRequest.facet_spec][] and + // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] + // should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only + // [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] + // will not be returned. + FACETED_SEARCH_ONLY = 2; + } + + // Required. The resource name of the search engine placement, such as + // `projects/*/locations/global/catalogs/default_catalog/placements/default_search` + // This field is used to identify the serving configuration name and the set + // of models that will be used to make the search. + string placement = 1 [(google.api.field_behavior) = REQUIRED]; + + // The branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. + // + // Use "default_branch" as the branch ID or leave this field empty, to search + // products under the default branch. + string branch = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Raw search query. + string query = 3; + + // Required. A unique identifier for tracking visitors. For example, this + // could be implemented with an HTTP cookie, which should be able to uniquely + // identify a visitor on a single device. This unique identifier should not + // change if the visitor logs in or out of the website. + // + // This should be the same identifier as + // [UserEvent.visitor_id][google.cloud.retail.v2alpha.UserEvent.visitor_id]. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string visitor_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // User information. + UserInfo user_info = 5; + + // Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to + // return. If unspecified, defaults to a reasonable value. The maximum allowed + // value is 120. Values above 120 will be coerced to 120. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 page_size = 7; + + // A page token + // [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token], + // received from a previous + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 8; + + // A 0-indexed integer that specifies the current offset (that is, starting + // result location, amongst the + // [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as + // relevant) in search results. This field is only considered if + // [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is + // unset. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 offset = 9; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. Filter + // expression is case-sensitive. See more details at this [user + // guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string filter = 10; + + // The default filter that is applied when a user performs a search without + // checking any filters on the search page. + // + // The filter applied to every search request when quality improvement such as + // query expansion is needed. For example, if a query does not have enough + // results, an expanded query with + // [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter] + // will be returned as a supplement of the original query. This field is + // strongly recommended to achieve high search quality. + // + // See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] + // for more details about filter syntax. + string canonical_filter = 28; + + // The order in which products are returned. Products can be ordered by + // a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave + // it unset if ordered by relevance. OrderBy expression is case-sensitive. See + // more details at this [user + // guide](https://cloud.google.com/retail/docs/filter-and-order#order). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string order_by = 11; + + // Facet specifications for faceted search. If empty, no facets are returned. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated FacetSpec facet_specs = 12; + + // Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + // to enable dynamic facets. Do not set this field. + // + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + + // Boost specification to boost certain products. See more details at this + // [user guide](https://cloud.google.com/retail/docs/boosting). + // + // Notice that if both + // [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids] + // and [SearchRequest.boost_spec] are set, the boost conditions from both + // places are evaluated. If a search request matches multiple boost + // conditions, the final boost score is equal to the sum of the boost scores + // from all matched boost conditions. + BoostSpec boost_spec = 13; + + // The query expansion specification that specifies the conditions under which + // query expansion will occur. See more details at this [user + // guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + QueryExpansionSpec query_expansion_spec = 14; + + // The relevance threshold of the search results. + // + // Defaults to + // [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH], + // which means only the most relevant results are shown, and the least number + // of results are returned. See more details at this [user + // guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + RelevanceThreshold relevance_threshold = 15; + + // The keys to fetch and rollup the matching + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s attributes, + // [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo] or + // [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s attributes. + // The attributes from all the matching + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s or + // [LocalInventory][google.cloud.retail.v2alpha.LocalInventory]s are merged + // and de-duplicated. Notice that rollup attributes will lead to extra query + // latency. Maximum number of keys is 30. + // + // For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a + // fulfillment type and a fulfillment ID must be provided in the format of + // "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + // "pickupInStore" is fulfillment type and "store123" is the store ID. + // + // Supported keys are: + // + // * colorFamilies + // * price + // * originalPrice + // * discount + // * variantId + // * inventory(place_id,price) + // * inventory(place_id,original_price) + // * inventory(place_id,attributes.key), where key is any key in the + // [Product.inventories.attributes][] map. + // * attributes.key, where key is any key in the + // [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map. + // * pickupInStore.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "pickup-in-store". + // * shipToStore.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "ship-to-store". + // * sameDayDelivery.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "same-day-delivery". + // * nextDayDelivery.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "next-day-delivery". + // * customFulfillment1.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "custom-type-1". + // * customFulfillment2.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "custom-type-2". + // * customFulfillment3.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "custom-type-3". + // * customFulfillment4.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "custom-type-4". + // * customFulfillment5.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] + // for + // [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] + // "custom-type-5". + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + repeated string variant_rollup_keys = 17; + + // The categories associated with a category page. Required for category + // navigation queries to achieve good search quality. The format should be + // the same as + // [UserEvent.page_categories][google.cloud.retail.v2alpha.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 + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + repeated string page_categories = 23; + + // The search mode of the search request. If not specified, a single search + // request triggers both product search and faceted search. + SearchMode search_mode = 31; + + // The specification for personalization. + PersonalizationSpec personalization_spec = 32; +} + +// Response message for +// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] +// method. +message SearchResponse { + // Represents the search results. + message SearchResult { + // [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched + // [Product][google.cloud.retail.v2alpha.Product]. + string id = 1; + + // The product data snippet in the search response. Only + // [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to + // be populated. + // + // [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains + // the product variants that match the search query. If there are multiple + // product variants matching the query, top 5 most relevant product variants + // are returned and ordered by relevancy. + // + // If relevancy can be deternmined, use + // [matching_variant_fields][google.cloud.retail.v2alpha.SearchResponse.SearchResult.matching_variant_fields] + // to look up matched product variants fields. If relevancy cannot be + // determined, e.g. when searching "shoe" all products in a shoe product can + // be a match, 5 product variants are returned but order is meaningless. + Product product = 2; + + // The count of matched + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product]s. + int32 matching_variant_count = 3; + + // If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product] matches the search query, + // this map indicates which [Product][google.cloud.retail.v2alpha.Product] + // fields are matched. The key is the + // [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a + // field mask of the matched [Product][google.cloud.retail.v2alpha.Product] + // fields. If matched attributes cannot be determined, this map will be + // empty. + // + // For example, a key "sku1" with field mask + // "products.color_info" indicates there is a match between + // "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query. + map matching_variant_fields = 4; + + // The rollup matching + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one + // of the + // [SearchRequest.variant_rollup_keys][google.cloud.retail.v2alpha.SearchRequest.variant_rollup_keys]. + // The values are the merged and de-duplicated + // [Product][google.cloud.retail.v2alpha.Product] attributes. Notice that + // the rollup values are respect filter. For example, when filtering by + // "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + // returned. + // + // For textual and numerical attributes, the rollup values is a list of + // string or double values with type + // [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + // there are two variants with colors "red" and "blue", the rollup values + // are + // + // { key: "colorFamilies" + // value { + // list_value { + // values { string_value: "red" } + // values { string_value: "blue" } + // } + // } + // } + // + // For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the + // rollup values is a double value with type + // [google.protobuf.Value][google.protobuf.Value]. For example, + // `{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; + } + + // A facet result. + message Facet { + // A facet value which contains value names and their count. + message FacetValue { + // A facet value which contains values. + oneof facet_value { + // Text value of a facet, such as "Black" for facet "colorFamilies". + string value = 1; + + // Interval value for a facet, such as [10, 20) for facet "price". + Interval interval = 2; + } + + // Number of items that have this facet value. + int64 count = 3; + } + + // The key for this facet. E.g., "colorFamilies" or "price" or + // "attributes.attr1". + string key = 1; + + // The facet values for this field. + repeated FacetValue values = 2; + + // Whether the facet is dynamically generated. + bool dynamic_facet = 3; + } + + // Information describing query expansion including whether expansion has + // occurred. + message QueryExpansionInfo { + // Bool describing whether query expansion has occurred. + bool expanded_query = 1; + + // Number of pinned results. This field will only be set when expansion + // happens and + // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + // is set to true. + int64 pinned_result_count = 2; + } + + // A list of matched items. The order represents the ranking. + repeated SearchResult results = 1; + + // Results of facets requested by user. + repeated Facet facets = 2; + + // The estimated total count of matched items irrespective of pagination. The + // count of [results][google.cloud.retail.v2alpha.SearchResponse.results] + // returned by pagination may be less than the + // [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that + // matches. + int32 total_size = 3; + + // If spell correction applies, the corrected query. Otherwise, empty. + string corrected_query = 4; + + // A unique search token. This should be included in the + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this + // search, which enables accurate attribution of search model performance. + string attribution_token = 5; + + // A token that can be sent as + // [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 6; + + // Query expansion information for the returned results. + QueryExpansionInfo query_expansion_info = 7; + + // The URI of a customer-defined redirect page. If redirect action is + // triggered, no search will be performed, and only + // [redirect_uri][google.cloud.retail.v2alpha.SearchResponse.redirect_uri] and + // [attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token] + // will be set in the response. + string redirect_uri = 10; + + // The fully qualified resource name of applied + // [controls](https://cloud.google.com/retail/docs/serving-control-rules). + repeated string applied_controls = 12; + + // The invalid + // [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2alpha.SearchRequest.BoostSpec.condition_boost_specs] + // that are not applied during serving. + repeated SearchRequest.BoostSpec.ConditionBoostSpec + invalid_condition_boost_specs = 14; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config.proto new file mode 100644 index 00000000..c339f310 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config.proto @@ -0,0 +1,247 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/search_service.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ServingConfigProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// 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}" + }; + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/servingConfig/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable serving config display name. Used in Retail + // UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + // 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. + // others-you-may-like CTR to others-you-may-like CVR). + // + // Required when + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string model_id = 3; + + // How much price ranking we want in serving results. + // Price reranking causes product items with a similar + // recommendation probability to be ordered by price, with the + // 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' + // + // If not specified, we choose default based on model type. Default value: + // 'no-price-reranking'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string price_reranking_level = 4; + + // Facet specifications for faceted search. If empty, no facets are returned. + // The ids refer to the ids of [Control][google.cloud.retail.v2alpha.Control] + // resources with only the Facet control set. These controls are assumed to be + // in the same [Catalog][google.cloud.retail.v2alpha.Catalog] as the + // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]. + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string facet_control_ids = 5; + + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + + // Condition boost specifications. If a product matches multiple conditions + // in the specifications, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 100. + // + // Notice that if both + // [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids] + // and [SearchRequest.boost_spec] are set, the boost conditions from both + // places are evaluated. If a search request matches multiple boost + // conditions, the final boost score is equal to the sum of the boost scores + // from all matched boost conditions. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string boost_control_ids = 7; + + // Condition filter specifications. If a product matches multiple conditions + // in the specifications, filters from these specifications are all + // applied and combined via the AND operator. Maximum number of + // specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string filter_control_ids = 9; + + // Condition redirect specifications. Only the first triggered redirect action + // is applied, even if multiple apply. Maximum number of specifications is + // 1000. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string redirect_control_ids = 10; + + // Condition synonyms specifications. If multiple syonyms conditions match, + // all matching synonyms control in the list will execute. Order of controls + // in the list will not matter. Maximum number of specifications is + // 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string twoway_synonyms_control_ids = 18; + + // Condition oneway synonyms specifications. If multiple oneway synonyms + // conditions match, all matching oneway synonyms controls in the list will + // execute. Order of controls in the list will not matter. Maximum number of + // specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string oneway_synonyms_control_ids = 12; + + // Condition do not associate specifications. If multiple do not associate + // conditions match, all matching do not associate controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string do_not_associate_control_ids = 13; + + // Condition replacement specifications. + // - Applied according to the order in the list. + // - A previously replaced term can not be re-replaced. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + repeated string replacement_control_ids = 14; + + // Condition ignore specifications. If multiple ignore + // conditions match, all matching ignore controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + 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: + // + // * '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'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [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. + // If not specified, we enable it by default. + // Allowed values are: + // + // * '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 + // 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). + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string enable_category_filter_level = 16; + + // 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 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config_service.proto new file mode 100644 index 00000000..48286797 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/serving_config_service.proto @@ -0,0 +1,241 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/serving_config.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "ServingConfigServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for modifying ServingConfig. +service ServingConfigService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a ServingConfig. + // + // A maximum of 100 + // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in + // a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a + // FAILED_PRECONDITION error is returned. + rpc CreateServingConfig(CreateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + body: "serving_config" + }; + option (google.api.method_signature) = + "parent,serving_config,serving_config_id"; + } + + // Deletes a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc DeleteServingConfig(DeleteServingConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2alpha/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a ServingConfig. + rpc UpdateServingConfig(UpdateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + patch: "/v2alpha/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + body: "serving_config" + }; + option (google.api.method_signature) = "serving_config,update_mask"; + } + + // Gets a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc GetServingConfig(GetServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all ServingConfigs linked to this catalog. + rpc ListServingConfigs(ListServingConfigsRequest) + returns (ListServingConfigsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Enables a Control on the specified ServingConfig. + // The control is added in the last position of the list of controls + // it belongs to (e.g. if it's a facet spec control it will be applied + // in the last position of servingConfig.facetSpecIds) + // Returns a ALREADY_EXISTS error if the control has already been applied. + // Returns a FAILED_PRECONDITION error if the addition could exceed maximum + // number of control allowed for that type of control. + rpc AddControl(AddControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2alpha/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } + + // Disables a Control on the specified ServingConfig. + // The control is removed from the ServingConfig. + // Returns a NOT_FOUND error if the Control is not enabled for the + // ServingConfig. + rpc RemoveControl(RemoveControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2alpha/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } +} + +// Request for CreateServingConfig method. +message CreateServingConfigRequest { + // Required. Full resource name of parent. 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 ServingConfig to create. + ServingConfig serving_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the ServingConfig, which will become the final + // component of the ServingConfig's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string serving_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateServingConfig method. +message UpdateServingConfigRequest { + // Required. The ServingConfig to update. + ServingConfig serving_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to update. The + // following are NOT supported: + // + // * [ServingConfig.name][google.cloud.retail.v2alpha.ServingConfig.name] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// Request for ListServingConfigs method. +message ListServingConfigsRequest { + // Required. The catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListServingConfigs` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListServingConfigs method. +message ListServingConfigsResponse { + // All the ServingConfigs for a given catalog. + repeated ServingConfig serving_configs = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // Required. The id of the control to apply. Assumed to be in the same catalog + // as the serving config - if id is not found a NOT_FOUND error is returned. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // Required. The id of the control to apply. Assumed to be in the same catalog + // as the serving config. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event.proto new file mode 100644 index 00000000..94f72879 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event.proto @@ -0,0 +1,344 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/product.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "UserEventProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// UserEvent captures all metadata information Retail API needs to know about +// how end users interact with customers' website. +message UserEvent { + // Required. User event type. Allowed values are: + // + // * `add-to-cart`: Products being added to cart. + // * `category-page-view`: Special pages such as sale or promotion pages + // viewed. + // * `detail-page-view`: Products detail page viewed. + // * `home-page-view`: Homepage viewed. + // * `promotion-offered`: Promotion is offered to a user. + // * `promotion-not-offered`: Promotion is not offered to a user. + // * `purchase-complete`: User finishing a purchase. + // * `search`: Product search. + // * `shopping-cart-page-view`: User viewing a shopping cart. + string event_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A unique identifier for tracking visitors. + // + // For example, this could be implemented with an HTTP cookie, which should be + // able to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor log in/out of the website. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // The field should not contain PII or user-data. We recommend to use Google + // Analystics [Client + // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + string visitor_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique identifier for tracking a visitor session with a length limit of + // 128 bytes. A session is an aggregation of an end user behavior in a time + // span. + // + // A general guideline to populate the sesion_id: + // 1. If user has no activity for 30 min, a new session_id should be assigned. + // 2. The session_id should be unique across users, suggest use uuid or add + // visitor_id as prefix. + string session_id = 21; + + // Only required for + // [UserEventService.ImportUserEvents][google.cloud.retail.v2alpha.UserEventService.ImportUserEvents] + // method. Timestamp of when the user event happened. + google.protobuf.Timestamp event_time = 3; + + // A list of identifiers for the independent experiment groups this user event + // belongs to. This is used to distinguish between user events associated with + // different experiment setups (e.g. using Retail API, using different + // recommendation models). + repeated string experiment_ids = 4; + + // Highly recommended for user events that are the result of + // [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict]. + // This field enables accurate attribution of recommendation model + // performance. + // + // The value must be a valid + // [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token] + // for user events that are the result of + // [PredictionService.Predict][google.cloud.retail.v2alpha.PredictionService.Predict]. + // The value must be a valid + // [SearchResponse.attribution_token][google.cloud.retail.v2alpha.SearchResponse.attribution_token] + // for user events that are the result of + // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // This token enables us to accurately attribute page view or purchase back to + // the event and the particular predict response containing this + // clicked/purchased product. If user clicks on product K in the + // recommendation results, pass + // [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token] + // as a URL parameter to product K's page. When recording events on product + // K's page, log the + // [PredictResponse.attribution_token][google.cloud.retail.v2alpha.PredictResponse.attribution_token] + // to this field. + string attribution_token = 5; + + // The main product details related to the event. + // + // This field is required for the following event types: + // + // * `add-to-cart` + // * `detail-page-view` + // * `purchase-complete` + // * `search` + // + // In a `search` event, this field represents the products returned to the end + // user on the current page (the end user may have not finished browsing the + // whole page yet). When a new page is returned to the end user, after + // pagination/filtering/ordering even for the same query, a new `search` event + // with different + // [product_details][google.cloud.retail.v2alpha.UserEvent.product_details] is + // desired. The end user may have not finished browsing the whole page yet. + repeated ProductDetail product_details = 6; + + // The main auto-completion details related to the event. + // + // This field should be set for `search` event when autocomplete function is + // enabled and the user clicks a suggestion for search. + CompletionDetail completion_detail = 22; + + // Extra user event features to include in the recommendation model. + // + // If you provide custom attributes for ingested user events, also include + // them in the user events that you associate with prediction requests. Custom + // attribute formatting must be consistent between imported events and events + // provided with prediction requests. This lets the Retail API use + // those custom attributes when training models and serving predictions, which + // helps improve recommendation quality. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * The key must be a UTF-8 encoded string with a length limit of 5,000 + // characters. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 256 characters. + // * For number attributes, at most 400 values are allowed. + // + // For product recommendations, an example of extra user information is + // traffic_channel, which is how a user arrives at the site. Users can arrive + // at the site by coming to the site directly, coming through Google + // search, or in other ways. + map attributes = 7; + + // The ID or name of the associated shopping cart. This ID is used + // to associate multiple items added or present in the cart before purchase. + // + // This can only be set for `add-to-cart`, `purchase-complete`, or + // `shopping-cart-page-view` events. + string cart_id = 8; + + // A transaction represents the entire purchase transaction. + // + // Required for `purchase-complete` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + PurchaseTransaction purchase_transaction = 9; + + // The user's search query. + // + // See [SearchRequest.query][google.cloud.retail.v2alpha.SearchRequest.query] + // for definition. + // + // The value must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // At least one of + // [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + string search_query = 10; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. + // + // See + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] + // for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string filter = 16; + + // The order in which products are returned. + // + // See + // [SearchRequest.order_by][google.cloud.retail.v2alpha.SearchRequest.order_by] + // for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + string order_by = 17; + + // An integer that specifies the current offset for pagination (the 0-indexed + // starting location, amongst the products deemed by the API as relevant). + // + // See + // [SearchRequest.offset][google.cloud.retail.v2alpha.SearchRequest.offset] + // for definition. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + int32 offset = 18; + + // 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 + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + // + // Required for `category-page-view` events. At least one of + // [search_query][google.cloud.retail.v2alpha.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + repeated string page_categories = 11; + + // User information. + UserInfo user_info = 12; + + // Complete URL (window.location.href) of the user's current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. Maximum length 5,000 + // characters. + string uri = 13; + + // The referrer URL of the current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. + string referrer_uri = 14; + + // A unique ID of a web page view. + // + // This should be kept the same for all user events triggered from the same + // pageview. For example, an item detail page view could trigger multiple + // events as the user is browsing the page. The `pageViewId` property should + // be kept the same for all these events so that they can be grouped together + // properly. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. + string page_view_id = 15; +} + +// Detailed product information associated with a user event. +message ProductDetail { + // Required. [Product][google.cloud.retail.v2alpha.Product] information. + // + // Required field(s): + // + // * [Product.id][google.cloud.retail.v2alpha.Product.id] + // + // Optional override field(s): + // + // * [Product.price_info][google.cloud.retail.v2alpha.Product.price_info] + // + // If any supported optional fields are provided, we will treat them as a full + // override when looking up product information from the catalog. Thus, it is + // important to ensure that the overriding fields are accurate and + // complete. + // + // All other product fields are ignored and instead populated via catalog + // lookup after event ingestion. + Product product = 1 [(google.api.field_behavior) = REQUIRED]; + + // Quantity of the product associated with the user event. + // + // For example, this field will be 2 if two products are added to the shopping + // cart for `purchase-complete` event. Required for `add-to-cart` and + // `purchase-complete` event types. + google.protobuf.Int32Value quantity = 2; +} + +// Detailed completion information including completion attribution token and +// clicked completion info. +message CompletionDetail { + // Completion attribution token in + // [CompleteQueryResponse.attribution_token][google.cloud.retail.v2alpha.CompleteQueryResponse.attribution_token]. + string completion_attribution_token = 1; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion]. + string selected_suggestion = 2; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.suggestion] + // position, starting from 0. + int32 selected_position = 3; +} + +// A transaction represents the entire purchase transaction. +message PurchaseTransaction { + // The transaction ID with a length limit of 128 characters. + string id = 1; + + // Required. Total non-zero revenue or grand total associated with the + // transaction. This value include shipping, tax, or other adjustments to + // total revenue that you want to include as part of your revenue + // calculations. + float revenue = 2 [(google.api.field_behavior) = REQUIRED]; + + // All the taxes associated with the transaction. + float tax = 3; + + // All the costs associated with the products. These can be manufacturing + // costs, shipping expenses not borne by the end user, or any other costs, + // such that: + // + // * Profit = + // [revenue][google.cloud.retail.v2alpha.PurchaseTransaction.revenue] - + // [tax][google.cloud.retail.v2alpha.PurchaseTransaction.tax] - + // [cost][google.cloud.retail.v2alpha.PurchaseTransaction.cost] + float cost = 4; + + // Required. Currency code. Use three-character ISO-4217 code. + string currency_code = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event_service.proto b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event_service.proto new file mode 100644 index 00000000..af97dad9 --- /dev/null +++ b/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/user_event_service.proto @@ -0,0 +1,190 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/import_config.proto"; +import "google/cloud/retail/v2alpha/purge_config.proto"; +import "google/cloud/retail/v2alpha/user_event.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail"; +option java_multiple_files = true; +option java_outer_classname = "UserEventServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for ingesting end user actions on the customer website. +service UserEventService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Writes a single user event. + rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:write" + body: "user_event" + }; + } + + // Writes a single user event from the browser. This uses a GET request to + // due to browser restriction of POST-ing to a 3rd party domain. + // + // This method is used only by the Retail API JavaScript pixel and Google Tag + // Manager. Users should not call this method directly. + rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect" + }; + } + + // Deletes permanently all user events specified by the filter provided. + // Depending on the number of events specified by the filter, this operation + // could take hours or days to complete. To test a filter, use the list + // command first. + rpc PurgeUserEvents(PurgeUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.PurgeUserEventsResponse" + metadata_type: "google.cloud.retail.v2alpha.PurgeMetadata" + }; + } + + // 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. + rpc ImportUserEvents(ImportUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.ImportUserEventsResponse" + metadata_type: "google.cloud.retail.v2alpha.ImportMetadata" + }; + } + + // 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. + rpc RejoinUserEvents(RejoinUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RejoinUserEventsResponse" + metadata_type: "RejoinUserEventsMetadata" + }; + } +} + +// Request message for WriteUserEvent method. +message WriteUserEventRequest { + // Required. The parent catalog resource name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. User event to write. + UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CollectUserEvent method. +message CollectUserEventRequest { + // Required. The parent catalog name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URL encoded UserEvent proto with a length limit of 2,000,000 + // characters. + string user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // The URL including cgi-parameters but excluding the hash fragment with a + // length limit of 5,000 characters. This is often more useful than the + // referer URL, because many browsers only send the domain for 3rd party + // requests. + string uri = 3; + + // The event timestamp in milliseconds. This prevents browser caching of + // otherwise identical get requests. The name is abbreviated to reduce the + // payload bytes. + int64 ets = 4; +} + +// Request message for RejoinUserEvents method. +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. + // 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. + enum UserEventRejoinScope { + // Rejoin all events with the latest product catalog, including both joined + // events and unjoined events. + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + + // Only rejoin joined events with the latest product catalog. + JOINED_EVENTS = 1; + + // Only rejoin unjoined events with the latest product catalog. + UNJOINED_EVENTS = 2; + } + + // Required. The parent catalog resource name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + UserEventRejoinScope user_event_rejoin_scope = 2; +} + +// 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. +message RejoinUserEventsMetadata {} diff --git a/proto-google-cloud-retail-v2beta/clirr-ignored-differences.xml b/proto-google-cloud-retail-v2beta/clirr-ignored-differences.xml new file mode 100644 index 00000000..e5c743d2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/retail/v2beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/retail/v2beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/retail/v2beta/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-retail-v2beta/pom.xml b/proto-google-cloud-retail-v2beta/pom.xml new file mode 100644 index 00000000..113ecadc --- /dev/null +++ b/proto-google-cloud-retail-v2beta/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-retail-v2beta + 2.1.1-SNAPSHOT + proto-google-cloud-retail-v2beta + Proto library for google-cloud-retail + + com.google.cloud + google-cloud-retail-parent + 2.1.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequest.java new file mode 100644 index 00000000..4198af1a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequest.java @@ -0,0 +1,978 @@ +/* + * 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.AddCatalogAttribute][google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddCatalogAttributeRequest} + */ +public final class AddCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddCatalogAttributeRequest) + AddCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddCatalogAttributeRequest.newBuilder() to construct. + private AddCatalogAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddCatalogAttributeRequest() { + attributesConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.CatalogAttribute.Builder subBuilder = null; + if (catalogAttribute_ != null) { + subBuilder = catalogAttribute_.toBuilder(); + } + catalogAttribute_ = + input.readMessage( + com.google.cloud.retail.v2beta.CatalogAttribute.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogAttribute_); + catalogAttribute_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 CATALOG_ATTRIBUTE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.CatalogAttribute catalogAttribute_; + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + @java.lang.Override + public boolean hasCatalogAttribute() { + return catalogAttribute_ != null; + } + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute() { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + return getCatalogAttribute(); + } + + 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_); + } + if (catalogAttribute_ != null) { + output.writeMessage(2, getCatalogAttribute()); + } + 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_); + } + if (catalogAttribute_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogAttribute()); + } + 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.AddCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest other = + (com.google.cloud.retail.v2beta.AddCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (hasCatalogAttribute() != other.hasCatalogAttribute()) return false; + if (hasCatalogAttribute()) { + if (!getCatalogAttribute().equals(other.getCatalogAttribute())) 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 (hasCatalogAttribute()) { + hash = (37 * hash) + CATALOG_ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getCatalogAttribute().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest 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.AddCatalogAttributeRequest 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.AddCatalogAttribute][google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddCatalogAttributeRequest) + com.google.cloud.retail.v2beta.AddCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.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_ = ""; + + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + 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_AddCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddCatalogAttributeRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddCatalogAttributeRequest build() { + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2beta.AddCatalogAttributeRequest result = + new com.google.cloud.retail.v2beta.AddCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + if (catalogAttributeBuilder_ == null) { + result.catalogAttribute_ = catalogAttribute_; + } else { + result.catalogAttribute_ = catalogAttributeBuilder_.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.AddCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.AddCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddCatalogAttributeRequest other) { + if (other == com.google.cloud.retail.v2beta.AddCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (other.hasCatalogAttribute()) { + mergeCatalogAttribute(other.getCatalogAttribute()); + } + 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.AddCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddCatalogAttributeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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.cloud.retail.v2beta.CatalogAttribute catalogAttribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder> + catalogAttributeBuilder_; + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + public boolean hasCatalogAttribute() { + return catalogAttributeBuilder_ != null || catalogAttribute_ != null; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } else { + return catalogAttributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute(com.google.cloud.retail.v2beta.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogAttribute_ = value; + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute( + com.google.cloud.retail.v2beta.CatalogAttribute.Builder builderForValue) { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = builderForValue.build(); + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogAttribute(com.google.cloud.retail.v2beta.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (catalogAttribute_ != null) { + catalogAttribute_ = + com.google.cloud.retail.v2beta.CatalogAttribute.newBuilder(catalogAttribute_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogAttribute_ = value; + } + onChanged(); + } else { + catalogAttributeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + onChanged(); + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CatalogAttribute.Builder getCatalogAttributeBuilder() { + + onChanged(); + return getCatalogAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + if (catalogAttributeBuilder_ != null) { + return catalogAttributeBuilder_.getMessageOrBuilder(); + } else { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + } + /** + * + * + *
+     * Required. The
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder> + getCatalogAttributeFieldBuilder() { + if (catalogAttributeBuilder_ == null) { + catalogAttributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder>( + getCatalogAttribute(), getParentForChildren(), isClean()); + catalogAttribute_ = null; + } + return catalogAttributeBuilder_; + } + + @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.AddCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddCatalogAttributeRequest) + private static final com.google.cloud.retail.v2beta.AddCatalogAttributeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2beta.AddCatalogAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddCatalogAttributeRequest(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.AddCatalogAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..dc6e1df1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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 AddCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + boolean hasCatalogAttribute(); + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute(); + /** + * + * + *
+   * Required. The
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java new file mode 100644 index 00000000..0909a27f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java @@ -0,0 +1,844 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for AddControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddControlRequest} + */ +public final class AddControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddControlRequest) + AddControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddControlRequest.newBuilder() to construct. + private AddControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddControlRequest() { + servingConfig_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddControlRequest( + 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(); + + servingConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_AddControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddControlRequest.class, + com.google.cloud.retail.v2beta.AddControlRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object servingConfig_; + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTROL_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, controlId_); + } + 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(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, controlId_); + } + 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.AddControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddControlRequest other = + (com.google.cloud.retail.v2beta.AddControlRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getControlId().equals(other.getControlId())) 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) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.AddControlRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest 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.AddControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest 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.AddControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest 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.AddControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest 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.AddControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest 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.AddControlRequest 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.AddControlRequest 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.AddControlRequest 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 AddControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddControlRequest) + com.google.cloud.retail.v2beta.AddControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_AddControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddControlRequest.class, + com.google.cloud.retail.v2beta.AddControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddControlRequest.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(); + servingConfig_ = ""; + + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddControlRequest build() { + com.google.cloud.retail.v2beta.AddControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddControlRequest buildPartial() { + com.google.cloud.retail.v2beta.AddControlRequest result = + new com.google.cloud.retail.v2beta.AddControlRequest(this); + result.servingConfig_ = servingConfig_; + result.controlId_ = controlId_; + 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.AddControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.AddControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddControlRequest other) { + if (other == com.google.cloud.retail.v2beta.AddControlRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + onChanged(); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.AddControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.AddControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + + servingConfig_ = getDefaultInstance().getServingConfig(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfig_ = value; + onChanged(); + return this; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config - if id is not found a NOT_FOUND error is returned.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.AddControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddControlRequest) + private static final com.google.cloud.retail.v2beta.AddControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddControlRequest(); + } + + public static com.google.cloud.retail.v2beta.AddControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddControlRequest(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.AddControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java new file mode 100644 index 00000000..870921a0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config - if id is not found a NOT_FOUND error is returned.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..28d558cd --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadata.java @@ -0,0 +1,463 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the AddFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} + */ +public final class AddFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) + AddFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesMetadata.newBuilder() to construct. + private AddFulfillmentPlacesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesMetadata( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.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.AddFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) 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.AddFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata 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.AddFulfillmentPlacesMetadata 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 related to the progress of the AddFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata(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.AddFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata other) { + if (other == com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata.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.AddFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) 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.AddFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesMetadata(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.AddFulfillmentPlacesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..0766fcd8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesMetadataOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequest.java new file mode 100644 index 00000000..214b7e80 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequest.java @@ -0,0 +1,1803 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [AddFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} + */ +public final class AddFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) + AddFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesRequest.newBuilder() to construct. + private AddFulfillmentPlacesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (addTime_ != null) { + subBuilder = addTime_.toBuilder(); + } + addTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addTime_); + addTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int ADD_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp addTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + @java.lang.Override + public boolean hasAddTime() { + return addTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAddTime() { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + return getAddTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (addTime_ != null) { + output.writeMessage(4, getAddTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (addTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAddTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.AddFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasAddTime() != other.hasAddTime()) return false; + if (hasAddTime()) { + if (!getAddTime().equals(other.getAddTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasAddTime()) { + hash = (37 * hash) + ADD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAddTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest 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.AddFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [AddFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.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(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (addTimeBuilder_ == null) { + addTime_ = null; + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (addTimeBuilder_ == null) { + result.addTime_ = addTime_; + } else { + result.addTime_ = addTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.AddFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest other) { + if (other == com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasAddTime()) { + mergeAddTime(other.getAddTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.AddFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+     * as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery" to be added for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+     * Duplicate IDs will be automatically ignored.
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * If the total number of place IDs exceeds 2000 for this
+     * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+     * adding, then the update will be rejected.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp addTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + addTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + public boolean hasAddTime() { + return addTimeBuilder_ != null || addTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + public com.google.protobuf.Timestamp getAddTime() { + if (addTimeBuilder_ == null) { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } else { + return addTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addTime_ = value; + onChanged(); + } else { + addTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder setAddTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (addTimeBuilder_ == null) { + addTime_ = builderForValue.build(); + onChanged(); + } else { + addTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder mergeAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (addTime_ != null) { + addTime_ = + com.google.protobuf.Timestamp.newBuilder(addTime_).mergeFrom(value).buildPartial(); + } else { + addTime_ = value; + } + onChanged(); + } else { + addTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public Builder clearAddTime() { + if (addTimeBuilder_ == null) { + addTime_ = null; + onChanged(); + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getAddTimeBuilder() { + + onChanged(); + return getAddTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + if (addTimeBuilder_ != null) { + return addTimeBuilder_.getMessageOrBuilder(); + } else { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAddTimeFieldBuilder() { + if (addTimeBuilder_ == null) { + addTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAddTime(), getParentForChildren(), isClean()); + addTime_ = null; + } + return addTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.AddFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesRequest(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.AddFulfillmentPlacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..b0fb2982 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,275 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such
+   * as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery" to be added for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type].
+   * Duplicate IDs will be automatically ignored.
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * If the total number of place IDs exceeds 2000 for this
+   * [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after
+   * adding, then the update will be rejected.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return Whether the addTime field is set. + */ + boolean hasAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + * + * @return The addTime. + */ + com.google.protobuf.Timestamp getAddTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponse.java new file mode 100644 index 00000000..92403c6b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponse.java @@ -0,0 +1,463 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the AddFulfillmentPlacesRequest.  Currently empty because
+ * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} + */ +public final class AddFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) + AddFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddFulfillmentPlacesResponse.newBuilder() to construct. + private AddFulfillmentPlacesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddFulfillmentPlacesResponse( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.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.AddFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) 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.AddFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse 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.AddFulfillmentPlacesResponse 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 AddFulfillmentPlacesRequest.  Currently empty because
+   * there is no meaningful response populated from the [AddFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse(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.AddFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse other) { + if (other == com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse.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.AddFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) 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.AddFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2beta.AddFulfillmentPlacesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddFulfillmentPlacesResponse(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.AddFulfillmentPlacesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..b9d97464 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddFulfillmentPlacesResponseOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadata.java new file mode 100644 index 00000000..0eebdf37 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadata.java @@ -0,0 +1,463 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the AddLocalInventories operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [AddLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesMetadata} + */ +public final class AddLocalInventoriesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddLocalInventoriesMetadata) + AddLocalInventoriesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesMetadata.newBuilder() to construct. + private AddLocalInventoriesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesMetadata( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.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.AddLocalInventoriesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata other = + (com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata) 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.AddLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata 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.AddLocalInventoriesMetadata 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 related to the progress of the AddLocalInventories operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [AddLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddLocalInventoriesMetadata) + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata build() { + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata buildPartial() { + com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata result = + new com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata(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.AddLocalInventoriesMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata other) { + if (other == com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata.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.AddLocalInventoriesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata) 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.AddLocalInventoriesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddLocalInventoriesMetadata) + private static final com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata(); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesMetadata(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.AddLocalInventoriesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadataOrBuilder.java new file mode 100644 index 00000000..26be2f24 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesMetadataOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddLocalInventoriesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddLocalInventoriesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequest.java new file mode 100644 index 00000000..e1422a41 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequest.java @@ -0,0 +1,2075 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [AddLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesRequest} + */ +public final class AddLocalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddLocalInventoriesRequest) + AddLocalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesRequest.newBuilder() to construct. + private AddLocalInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesRequest() { + product_ = ""; + localInventories_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + localInventories_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + localInventories_.add( + input.readMessage( + com.google.cloud.retail.v2beta.LocalInventory.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (addMask_ != null) { + subBuilder = addMask_.toBuilder(); + } + addMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addMask_); + addMask_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (addTime_ != null) { + subBuilder = addTime_.toBuilder(); + } + addTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(addTime_); + addTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCAL_INVENTORIES_FIELD_NUMBER = 2; + private java.util.List localInventories_; + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getLocalInventoriesList() { + return localInventories_; + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getLocalInventoriesOrBuilderList() { + return localInventories_; + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getLocalInventoriesCount() { + return localInventories_.size(); + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index) { + return localInventories_.get(index); + } + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + return localInventories_.get(index); + } + + public static final int ADD_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask addMask_; + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + @java.lang.Override + public boolean hasAddMask() { + return addMask_ != null; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getAddMask() { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder() { + return getAddMask(); + } + + public static final int ADD_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp addTime_; + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + @java.lang.Override + public boolean hasAddTime() { + return addTime_ != null; + } + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAddTime() { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + return getAddTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 6; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the local inventory will still be processed and retained for at
+   * most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + for (int i = 0; i < localInventories_.size(); i++) { + output.writeMessage(2, localInventories_.get(i)); + } + if (addMask_ != null) { + output.writeMessage(4, getAddMask()); + } + if (addTime_ != null) { + output.writeMessage(5, getAddTime()); + } + if (allowMissing_ != false) { + output.writeBool(6, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + for (int i = 0; i < localInventories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, localInventories_.get(i)); + } + if (addMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAddMask()); + } + if (addTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAddTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowMissing_); + } + 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.AddLocalInventoriesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest other = + (com.google.cloud.retail.v2beta.AddLocalInventoriesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getLocalInventoriesList().equals(other.getLocalInventoriesList())) return false; + if (hasAddMask() != other.hasAddMask()) return false; + if (hasAddMask()) { + if (!getAddMask().equals(other.getAddMask())) return false; + } + if (hasAddTime() != other.hasAddTime()) return false; + if (hasAddTime()) { + if (!getAddTime().equals(other.getAddTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + if (getLocalInventoriesCount() > 0) { + hash = (37 * hash) + LOCAL_INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventoriesList().hashCode(); + } + if (hasAddMask()) { + hash = (37 * hash) + ADD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getAddMask().hashCode(); + } + if (hasAddTime()) { + hash = (37 * hash) + ADD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAddTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest 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.AddLocalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [AddLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddLocalInventoriesRequest) + com.google.cloud.retail.v2beta.AddLocalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLocalInventoriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + product_ = ""; + + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + localInventoriesBuilder_.clear(); + } + if (addMaskBuilder_ == null) { + addMask_ = null; + } else { + addMask_ = null; + addMaskBuilder_ = null; + } + if (addTimeBuilder_ == null) { + addTime_ = null; + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesRequest build() { + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesRequest buildPartial() { + com.google.cloud.retail.v2beta.AddLocalInventoriesRequest result = + new com.google.cloud.retail.v2beta.AddLocalInventoriesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + if (localInventoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.localInventories_ = localInventories_; + } else { + result.localInventories_ = localInventoriesBuilder_.build(); + } + if (addMaskBuilder_ == null) { + result.addMask_ = addMask_; + } else { + result.addMask_ = addMaskBuilder_.build(); + } + if (addTimeBuilder_ == null) { + result.addTime_ = addTime_; + } else { + result.addTime_ = addTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.AddLocalInventoriesRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.AddLocalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddLocalInventoriesRequest other) { + if (other == com.google.cloud.retail.v2beta.AddLocalInventoriesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (localInventoriesBuilder_ == null) { + if (!other.localInventories_.isEmpty()) { + if (localInventories_.isEmpty()) { + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocalInventoriesIsMutable(); + localInventories_.addAll(other.localInventories_); + } + onChanged(); + } + } else { + if (!other.localInventories_.isEmpty()) { + if (localInventoriesBuilder_.isEmpty()) { + localInventoriesBuilder_.dispose(); + localInventoriesBuilder_ = null; + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + localInventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocalInventoriesFieldBuilder() + : null; + } else { + localInventoriesBuilder_.addAllMessages(other.localInventories_); + } + } + } + if (other.hasAddMask()) { + mergeAddMask(other.getAddMask()); + } + if (other.hasAddTime()) { + mergeAddTime(other.getAddTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.AddLocalInventoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddLocalInventoriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.util.List localInventories_ = + java.util.Collections.emptyList(); + + private void ensureLocalInventoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + localInventories_ = + new java.util.ArrayList( + localInventories_); + bitField0_ |= 0x00000001; + } + } + + 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_; + + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getLocalInventoriesList() { + if (localInventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(localInventories_); + } else { + return localInventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getLocalInventoriesCount() { + if (localInventoriesBuilder_ == null) { + return localInventories_.size(); + } else { + return localInventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLocalInventories() { + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + localInventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.remove(index); + onChanged(); + } else { + localInventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder getLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getLocalInventoriesOrBuilderList() { + if (localInventoriesBuilder_ != null) { + return localInventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localInventories_); + } + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder addLocalInventoriesBuilder() { + return getLocalInventoriesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder addLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of inventory information at difference places. Each place
+     * is identified by its place ID. At most 3000 inventories are allowed per
+     * request.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + localInventories_ = null; + } + return localInventoriesBuilder_; + } + + private com.google.protobuf.FieldMask addMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + addMaskBuilder_; + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + public boolean hasAddMask() { + return addMaskBuilder_ != null || addMask_ != null; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + public com.google.protobuf.FieldMask getAddMask() { + if (addMaskBuilder_ == null) { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } else { + return addMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder setAddMask(com.google.protobuf.FieldMask value) { + if (addMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addMask_ = value; + onChanged(); + } else { + addMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder setAddMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (addMaskBuilder_ == null) { + addMask_ = builderForValue.build(); + onChanged(); + } else { + addMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder mergeAddMask(com.google.protobuf.FieldMask value) { + if (addMaskBuilder_ == null) { + if (addMask_ != null) { + addMask_ = + com.google.protobuf.FieldMask.newBuilder(addMask_).mergeFrom(value).buildPartial(); + } else { + addMask_ = value; + } + onChanged(); + } else { + addMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public Builder clearAddMask() { + if (addMaskBuilder_ == null) { + addMask_ = null; + onChanged(); + } else { + addMask_ = null; + addMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public com.google.protobuf.FieldMask.Builder getAddMaskBuilder() { + + onChanged(); + return getAddMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder() { + if (addMaskBuilder_ != null) { + return addMaskBuilder_.getMessageOrBuilder(); + } else { + return addMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : addMask_; + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided list of
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+     * field is updated to the provided value.
+     * If a field is set while the place does not have a previous local inventory,
+     * the local inventory at that store is created.
+     * If a field is set while the value of that field is not provided, the
+     * original field value, if it exists, is deleted.
+     * If the mask is not set or set with empty paths, all inventory fields will
+     * be updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getAddMaskFieldBuilder() { + if (addMaskBuilder_ == null) { + addMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getAddMask(), getParentForChildren(), isClean()); + addMask_ = null; + } + return addMaskBuilder_; + } + + private com.google.protobuf.Timestamp addTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + addTimeBuilder_; + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + public boolean hasAddTime() { + return addTimeBuilder_ != null || addTime_ != null; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + public com.google.protobuf.Timestamp getAddTime() { + if (addTimeBuilder_ == null) { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } else { + return addTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder setAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + addTime_ = value; + onChanged(); + } else { + addTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder setAddTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (addTimeBuilder_ == null) { + addTime_ = builderForValue.build(); + onChanged(); + } else { + addTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder mergeAddTime(com.google.protobuf.Timestamp value) { + if (addTimeBuilder_ == null) { + if (addTime_ != null) { + addTime_ = + com.google.protobuf.Timestamp.newBuilder(addTime_).mergeFrom(value).buildPartial(); + } else { + addTime_ = value; + } + onChanged(); + } else { + addTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public Builder clearAddTime() { + if (addTimeBuilder_ == null) { + addTime_ = null; + onChanged(); + } else { + addTime_ = null; + addTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getAddTimeBuilder() { + + onChanged(); + return getAddTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder() { + if (addTimeBuilder_ != null) { + return addTimeBuilder_.getMessageOrBuilder(); + } else { + return addTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : addTime_; + } + } + /** + * + * + *
+     * The time when the inventory updates are issued. Used to prevent
+     * out-of-order updates on local inventory fields. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAddTimeFieldBuilder() { + if (addTimeBuilder_ == null) { + addTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAddTime(), getParentForChildren(), isClean()); + addTime_ = null; + } + return addTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory will still be processed and retained for at
+     * most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.AddLocalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddLocalInventoriesRequest) + private static final com.google.cloud.retail.v2beta.AddLocalInventoriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddLocalInventoriesRequest(); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesRequest(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.AddLocalInventoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequestOrBuilder.java new file mode 100644 index 00000000..a6b92212 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesRequestOrBuilder.java @@ -0,0 +1,260 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddLocalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddLocalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getLocalInventoriesList(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getLocalInventoriesCount(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getLocalInventoriesOrBuilderList(); + /** + * + * + *
+   * Required. A list of inventory information at difference places. Each place
+   * is identified by its place ID. At most 3000 inventories are allowed per
+   * request.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder(int index); + + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return Whether the addMask field is set. + */ + boolean hasAddMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + * + * @return The addMask. + */ + com.google.protobuf.FieldMask getAddMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided list of
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The
+   * field is updated to the provided value.
+   * If a field is set while the place does not have a previous local inventory,
+   * the local inventory at that store is created.
+   * If a field is set while the value of that field is not provided, the
+   * original field value, if it exists, is deleted.
+   * If the mask is not set or set with empty paths, all inventory fields will
+   * be updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask add_mask = 4; + */ + com.google.protobuf.FieldMaskOrBuilder getAddMaskOrBuilder(); + + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return Whether the addTime field is set. + */ + boolean hasAddTime(); + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + * + * @return The addTime. + */ + com.google.protobuf.Timestamp getAddTime(); + /** + * + * + *
+   * The time when the inventory updates are issued. Used to prevent
+   * out-of-order updates on local inventory fields. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp add_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getAddTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the local inventory will still be processed and retained for at
+   * most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 6; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponse.java new file mode 100644 index 00000000..62849d51 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponse.java @@ -0,0 +1,463 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the [AddLocalInventories][] API.  Currently empty because
+ * there is no meaningful response populated from the [AddLocalInventories][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesResponse} + */ +public final class AddLocalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AddLocalInventoriesResponse) + AddLocalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddLocalInventoriesResponse.newBuilder() to construct. + private AddLocalInventoriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddLocalInventoriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddLocalInventoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AddLocalInventoriesResponse( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.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.AddLocalInventoriesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse other = + (com.google.cloud.retail.v2beta.AddLocalInventoriesResponse) 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.AddLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse 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.AddLocalInventoriesResponse 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 [AddLocalInventories][] API.  Currently empty because
+   * there is no meaningful response populated from the [AddLocalInventories][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AddLocalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AddLocalInventoriesResponse) + com.google.cloud.retail.v2beta.AddLocalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.class, + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesResponse build() { + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AddLocalInventoriesResponse buildPartial() { + com.google.cloud.retail.v2beta.AddLocalInventoriesResponse result = + new com.google.cloud.retail.v2beta.AddLocalInventoriesResponse(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.AddLocalInventoriesResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.AddLocalInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AddLocalInventoriesResponse other) { + if (other == com.google.cloud.retail.v2beta.AddLocalInventoriesResponse.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.AddLocalInventoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.AddLocalInventoriesResponse) 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.AddLocalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AddLocalInventoriesResponse) + private static final com.google.cloud.retail.v2beta.AddLocalInventoriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AddLocalInventoriesResponse(); + } + + public static com.google.cloud.retail.v2beta.AddLocalInventoriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddLocalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddLocalInventoriesResponse(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.AddLocalInventoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponseOrBuilder.java new file mode 100644 index 00000000..b49f49e4 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddLocalInventoriesResponseOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface AddLocalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AddLocalInventoriesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributeConfigLevel.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributeConfigLevel.java new file mode 100644 index 00000000..943dbe32 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributeConfigLevel.java @@ -0,0 +1,185 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * At which level we offer configuration for attributes.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.AttributeConfigLevel} + */ +public enum AttributeConfigLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Value used when unset. Defaults to
+   * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2beta.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
+   * 
+ * + * ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + */ + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + */ + PRODUCT_LEVEL_ATTRIBUTE_CONFIG(1), + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [CatalogConfig.attribute_configs][].
+   * 
+ * + * CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + */ + CATALOG_LEVEL_ATTRIBUTE_CONFIG(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Value used when unset. Defaults to
+   * [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2beta.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
+   * 
+ * + * ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + */ + public static final int ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + */ + public static final int PRODUCT_LEVEL_ATTRIBUTE_CONFIG_VALUE = 1; + /** + * + * + *
+   * At this level, we honor the attribute configurations set in
+   * [CatalogConfig.attribute_configs][].
+   * 
+ * + * CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; + */ + public static final int CATALOG_LEVEL_ATTRIBUTE_CONFIG_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 AttributeConfigLevel 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 AttributeConfigLevel forNumber(int value) { + switch (value) { + case 0: + return ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED; + case 1: + return PRODUCT_LEVEL_ATTRIBUTE_CONFIG; + case 2: + return CATALOG_LEVEL_ATTRIBUTE_CONFIG; + 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 AttributeConfigLevel findValueByNumber(int number) { + return AttributeConfigLevel.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.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final AttributeConfigLevel[] VALUES = values(); + + public static AttributeConfigLevel 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 AttributeConfigLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.AttributeConfigLevel) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfig.java new file mode 100644 index 00000000..17ecaf3c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfig.java @@ -0,0 +1,1289 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Catalog level attribute config.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AttributesConfig} + */ +public final class AttributesConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.AttributesConfig) + AttributesConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttributesConfig.newBuilder() to construct. + private AttributesConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttributesConfig() { + name_ = ""; + attributeConfigLevel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttributesConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttributesConfig( + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + catalogAttributes_ = + com.google.protobuf.MapField.newMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + catalogAttributes__ = + input.readMessage( + CatalogAttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + catalogAttributes_ + .getMutableMap() + .put(catalogAttributes__.getKey(), catalogAttributes__.getValue()); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + attributeConfigLevel_ = rawValue; + 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.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AttributesConfig.class, + com.google.cloud.retail.v2beta.AttributesConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 CATALOG_ATTRIBUTES_FIELD_NUMBER = 2; + + private static final class CatalogAttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + catalogAttributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + internalGetCatalogAttributes() { + if (catalogAttributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + return catalogAttributes_; + } + + public int getCatalogAttributesCount() { + return internalGetCatalogAttributes().getMap().size(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public boolean containsCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCatalogAttributes().getMap().containsKey(key); + } + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCatalogAttributes() { + return getCatalogAttributesMap(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public java.util.Map + getCatalogAttributesMap() { + return internalGetCatalogAttributes().getMap(); + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CatalogAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ATTRIBUTE_CONFIG_LEVEL_FIELD_NUMBER = 3; + private int attributeConfigLevel_; + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + @java.lang.Override + public int getAttributeConfigLevelValue() { + return attributeConfigLevel_; + } + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributeConfigLevel getAttributeConfigLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.AttributeConfigLevel result = + com.google.cloud.retail.v2beta.AttributeConfigLevel.valueOf(attributeConfigLevel_); + return result == null + ? com.google.cloud.retail.v2beta.AttributeConfigLevel.UNRECOGNIZED + : result; + } + + 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_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetCatalogAttributes(), + CatalogAttributesDefaultEntryHolder.defaultEntry, + 2); + if (attributeConfigLevel_ + != com.google.cloud.retail.v2beta.AttributeConfigLevel.ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, attributeConfigLevel_); + } + 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_); + } + for (java.util.Map.Entry + entry : internalGetCatalogAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + catalogAttributes__ = + CatalogAttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, catalogAttributes__); + } + if (attributeConfigLevel_ + != com.google.cloud.retail.v2beta.AttributeConfigLevel.ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, attributeConfigLevel_); + } + 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.AttributesConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.AttributesConfig other = + (com.google.cloud.retail.v2beta.AttributesConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetCatalogAttributes().equals(other.internalGetCatalogAttributes())) return false; + if (attributeConfigLevel_ != other.attributeConfigLevel_) 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(); + if (!internalGetCatalogAttributes().getMap().isEmpty()) { + hash = (37 * hash) + CATALOG_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetCatalogAttributes().hashCode(); + } + hash = (37 * hash) + ATTRIBUTE_CONFIG_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + attributeConfigLevel_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.AttributesConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig 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.AttributesConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig 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.AttributesConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig 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.AttributesConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig 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.AttributesConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig 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.AttributesConfig 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.AttributesConfig 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.AttributesConfig 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; + } + /** + * + * + *
+   * Catalog level attribute config.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.AttributesConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.AttributesConfig) + com.google.cloud.retail.v2beta.AttributesConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableCatalogAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.AttributesConfig.class, + com.google.cloud.retail.v2beta.AttributesConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.AttributesConfig.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_ = ""; + + internalGetMutableCatalogAttributes().clear(); + attributeConfigLevel_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributesConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributesConfig build() { + com.google.cloud.retail.v2beta.AttributesConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributesConfig buildPartial() { + com.google.cloud.retail.v2beta.AttributesConfig result = + new com.google.cloud.retail.v2beta.AttributesConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.catalogAttributes_ = internalGetCatalogAttributes(); + result.catalogAttributes_.makeImmutable(); + result.attributeConfigLevel_ = attributeConfigLevel_; + 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.AttributesConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.AttributesConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.AttributesConfig other) { + if (other == com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableCatalogAttributes().mergeFrom(other.internalGetCatalogAttributes()); + if (other.attributeConfigLevel_ != 0) { + setAttributeConfigLevelValue(other.getAttributeConfigLevelValue()); + } + 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.AttributesConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.AttributesConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the attribute
+     * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + catalogAttributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + internalGetCatalogAttributes() { + if (catalogAttributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + return catalogAttributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CatalogAttribute> + internalGetMutableCatalogAttributes() { + onChanged(); + ; + if (catalogAttributes_ == null) { + catalogAttributes_ = + com.google.protobuf.MapField.newMapField( + CatalogAttributesDefaultEntryHolder.defaultEntry); + } + if (!catalogAttributes_.isMutable()) { + catalogAttributes_ = catalogAttributes_.copy(); + } + return catalogAttributes_; + } + + public int getCatalogAttributesCount() { + return internalGetCatalogAttributes().getMap().size(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public boolean containsCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCatalogAttributes().getMap().containsKey(key); + } + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getCatalogAttributes() { + return getCatalogAttributesMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public java.util.Map + getCatalogAttributesMap() { + return internalGetCatalogAttributes().getMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CatalogAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetCatalogAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCatalogAttributes() { + internalGetMutableCatalogAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder removeCatalogAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableCatalogAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableCatalogAttributes() { + return internalGetMutableCatalogAttributes().getMutableMap(); + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder putCatalogAttributes( + java.lang.String key, com.google.cloud.retail.v2beta.CatalogAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableCatalogAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Enable attribute(s) config at catalog level.
+     * For example, indexable, dynamic_facetable, or searchable for each
+     * attribute.
+     * The key is catalog attribute's name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * The maximum number of catalog attributes allowed in a request is 1000.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + public Builder putAllCatalogAttributes( + java.util.Map values) { + internalGetMutableCatalogAttributes().getMutableMap().putAll(values); + return this; + } + + private int attributeConfigLevel_ = 0; + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + @java.lang.Override + public int getAttributeConfigLevelValue() { + return attributeConfigLevel_; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for attributeConfigLevel to set. + * @return This builder for chaining. + */ + public Builder setAttributeConfigLevelValue(int value) { + + attributeConfigLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributeConfigLevel getAttributeConfigLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.AttributeConfigLevel result = + com.google.cloud.retail.v2beta.AttributeConfigLevel.valueOf(attributeConfigLevel_); + return result == null + ? com.google.cloud.retail.v2beta.AttributeConfigLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The attributeConfigLevel to set. + * @return This builder for chaining. + */ + public Builder setAttributeConfigLevel( + com.google.cloud.retail.v2beta.AttributeConfigLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + attributeConfigLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The
+     * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+     * used for this catalog.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAttributeConfigLevel() { + + attributeConfigLevel_ = 0; + 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.AttributesConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.AttributesConfig) + private static final com.google.cloud.retail.v2beta.AttributesConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.AttributesConfig(); + } + + public static com.google.cloud.retail.v2beta.AttributesConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttributesConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttributesConfig(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.AttributesConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigName.java new file mode 100644 index 00000000..4e553282 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigName.java @@ -0,0 +1,223 @@ +/* + * 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 AttributesConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected AttributesConfigName() { + project = null; + location = null; + catalog = null; + } + + private AttributesConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AttributesConfigName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static AttributesConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "AttributesConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (AttributesConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AttributesConfigName that = ((AttributesConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(AttributesConfigName attributesConfigName) { + this.project = attributesConfigName.project; + this.location = attributesConfigName.location; + this.catalog = attributesConfigName.catalog; + } + + public AttributesConfigName build() { + return new AttributesConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigOrBuilder.java new file mode 100644 index 00000000..d6e25c51 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AttributesConfigOrBuilder.java @@ -0,0 +1,185 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface AttributesConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.AttributesConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the attribute
+   * config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + int getCatalogAttributesCount(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + boolean containsCatalogAttributes(java.lang.String key); + /** Use {@link #getCatalogAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getCatalogAttributes(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + java.util.Map + getCatalogAttributesMap(); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + + /* nullable */ + com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2beta.CatalogAttribute defaultValue); + /** + * + * + *
+   * Enable attribute(s) config at catalog level.
+   * For example, indexable, dynamic_facetable, or searchable for each
+   * attribute.
+   * The key is catalog attribute's name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * The maximum number of catalog attributes allowed in a request is 1000.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CatalogAttribute> catalog_attributes = 2; + * + */ + com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for attributeConfigLevel. + */ + int getAttributeConfigLevelValue(); + /** + * + * + *
+   * Output only. The
+   * [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel]
+   * used for this catalog.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributeConfigLevel attribute_config_level = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributeConfigLevel. + */ + com.google.cloud.retail.v2beta.AttributeConfigLevel getAttributeConfigLevel(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Audience.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Audience.java new file mode 100644 index 00000000..bc9c3d28 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Audience.java @@ -0,0 +1,1261 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * An intended audience of the [Product][google.cloud.retail.v2beta.Product] for
+ * whom it's sold.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Audience} + */ +public final class Audience extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Audience) + AudienceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Audience.newBuilder() to construct. + private Audience(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Audience() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Audience(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Audience( + 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)) { + genders_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + genders_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ageGroups_.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)) { + genders_ = genders_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Audience.class, + com.google.cloud.retail.v2beta.Audience.Builder.class); + } + + public static final int GENDERS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList genders_; + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_; + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + + public static final int AGE_GROUPS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ageGroups_; + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_; + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.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 < genders_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, genders_.getRaw(i)); + } + for (int i = 0; i < ageGroups_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ageGroups_.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 < genders_.size(); i++) { + dataSize += computeStringSizeNoTag(genders_.getRaw(i)); + } + size += dataSize; + size += 1 * getGendersList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ageGroups_.size(); i++) { + dataSize += computeStringSizeNoTag(ageGroups_.getRaw(i)); + } + size += dataSize; + size += 1 * getAgeGroupsList().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.Audience)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Audience other = (com.google.cloud.retail.v2beta.Audience) obj; + + if (!getGendersList().equals(other.getGendersList())) return false; + if (!getAgeGroupsList().equals(other.getAgeGroupsList())) 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 (getGendersCount() > 0) { + hash = (37 * hash) + GENDERS_FIELD_NUMBER; + hash = (53 * hash) + getGendersList().hashCode(); + } + if (getAgeGroupsCount() > 0) { + hash = (37 * hash) + AGE_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getAgeGroupsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Audience parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Audience 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.Audience parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Audience 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.Audience parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Audience 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.Audience parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Audience 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.Audience parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Audience 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.Audience 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.Audience 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.Audience 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; + } + /** + * + * + *
+   * An intended audience of the [Product][google.cloud.retail.v2beta.Product] for
+   * whom it's sold.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Audience} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Audience) + com.google.cloud.retail.v2beta.AudienceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Audience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Audience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Audience.class, + com.google.cloud.retail.v2beta.Audience.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Audience.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(); + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + ageGroups_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Audience_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Audience getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Audience.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Audience build() { + com.google.cloud.retail.v2beta.Audience result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Audience buildPartial() { + com.google.cloud.retail.v2beta.Audience result = + new com.google.cloud.retail.v2beta.Audience(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + genders_ = genders_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.genders_ = genders_; + if (((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = ageGroups_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ageGroups_ = ageGroups_; + 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.Audience) { + return mergeFrom((com.google.cloud.retail.v2beta.Audience) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Audience other) { + if (other == com.google.cloud.retail.v2beta.Audience.getDefaultInstance()) return this; + if (!other.genders_.isEmpty()) { + if (genders_.isEmpty()) { + genders_ = other.genders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGendersIsMutable(); + genders_.addAll(other.genders_); + } + onChanged(); + } + if (!other.ageGroups_.isEmpty()) { + if (ageGroups_.isEmpty()) { + ageGroups_ = other.ageGroups_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAgeGroupsIsMutable(); + ageGroups_.addAll(other.ageGroups_); + } + 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.Audience parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Audience) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList genders_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGendersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + genders_ = new com.google.protobuf.LazyStringArrayList(genders_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + public com.google.protobuf.ProtocolStringList getGendersList() { + return genders_.getUnmodifiableView(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + public int getGendersCount() { + return genders_.size(); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + public java.lang.String getGenders(int index) { + return genders_.get(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + public com.google.protobuf.ByteString getGendersBytes(int index) { + return genders_.getByteString(index); + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param index The index to set the value at. + * @param value The genders to set. + * @return This builder for chaining. + */ + public Builder setGenders(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The genders to add. + * @return This builder for chaining. + */ + public Builder addGenders(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param values The genders to add. + * @return This builder for chaining. + */ + public Builder addAllGenders(java.lang.Iterable values) { + ensureGendersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, genders_); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @return This builder for chaining. + */ + public Builder clearGenders() { + genders_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The genders of the audience. Strongly encouraged to use the standard
+     * values: "male", "female", "unisex".
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+     * property
+     * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+     * 
+ * + * repeated string genders = 1; + * + * @param value The bytes of the genders to add. + * @return This builder for chaining. + */ + public Builder addGendersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGendersIsMutable(); + genders_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ageGroups_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAgeGroupsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ageGroups_ = new com.google.protobuf.LazyStringArrayList(ageGroups_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + public com.google.protobuf.ProtocolStringList getAgeGroupsList() { + return ageGroups_.getUnmodifiableView(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + public int getAgeGroupsCount() { + return ageGroups_.size(); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + public java.lang.String getAgeGroups(int index) { + return ageGroups_.get(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + public com.google.protobuf.ByteString getAgeGroupsBytes(int index) { + return ageGroups_.getByteString(index); + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param index The index to set the value at. + * @param value The ageGroups to set. + * @return This builder for chaining. + */ + public Builder setAgeGroups(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroups(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAgeGroupsIsMutable(); + ageGroups_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param values The ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAllAgeGroups(java.lang.Iterable values) { + ensureAgeGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ageGroups_); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @return This builder for chaining. + */ + public Builder clearAgeGroups() { + ageGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The age groups of the audience. Strongly encouraged to use the standard
+     * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+     * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+     * teens or older).
+     * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+     * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * Google Merchant Center property
+     * [age_group](https://support.google.com/merchants/answer/6324463).
+     * Schema.org property
+     * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+     * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+     * 
+ * + * repeated string age_groups = 2; + * + * @param value The bytes of the ageGroups to add. + * @return This builder for chaining. + */ + public Builder addAgeGroupsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAgeGroupsIsMutable(); + ageGroups_.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.Audience) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Audience) + private static final com.google.cloud.retail.v2beta.Audience DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Audience(); + } + + public static com.google.cloud.retail.v2beta.Audience getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Audience parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Audience(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.Audience getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AudienceOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AudienceOrBuilder.java new file mode 100644 index 00000000..1cf62142 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AudienceOrBuilder.java @@ -0,0 +1,203 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface AudienceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Audience) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return A list containing the genders. + */ + java.util.List getGendersList(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @return The count of genders. + */ + int getGendersCount(); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the element to return. + * @return The genders at the given index. + */ + java.lang.String getGenders(int index); + /** + * + * + *
+   * The genders of the audience. Strongly encouraged to use the standard
+   * values: "male", "female", "unisex".
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [gender](https://support.google.com/merchants/answer/6324479). Schema.org
+   * property
+   * [Product.audience.suggestedGender](https://schema.org/suggestedGender).
+   * 
+ * + * repeated string genders = 1; + * + * @param index The index of the value to return. + * @return The bytes of the genders at the given index. + */ + com.google.protobuf.ByteString getGendersBytes(int index); + + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return A list containing the ageGroups. + */ + java.util.List getAgeGroupsList(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @return The count of ageGroups. + */ + int getAgeGroupsCount(); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the element to return. + * @return The ageGroups at the given index. + */ + java.lang.String getAgeGroups(int index); + /** + * + * + *
+   * The age groups of the audience. Strongly encouraged to use the standard
+   * values: "newborn" (up to 3 months old), "infant" (3–12 months old),
+   * "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
+   * teens or older).
+   * At most 5 values are allowed. Each value must be a UTF-8 encoded string
+   * with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * Google Merchant Center property
+   * [age_group](https://support.google.com/merchants/answer/6324463).
+   * Schema.org property
+   * [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
+   * [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
+   * 
+ * + * repeated string age_groups = 2; + * + * @param index The index of the value to return. + * @return The bytes of the ageGroups at the given index. + */ + com.google.protobuf.ByteString getAgeGroupsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java new file mode 100644 index 00000000..a34a5b26 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java @@ -0,0 +1,1937 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * BigQuery source import data from.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BigQuerySource} + */ +public final class BigQuerySource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.BigQuerySource) + BigQuerySourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQuerySource.newBuilder() to construct. + private BigQuerySource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQuerySource() { + projectId_ = ""; + datasetId_ = ""; + tableId_ = ""; + gcsStagingDir_ = ""; + dataSchema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQuerySource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BigQuerySource( + 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(); + + datasetId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + tableId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + gcsStagingDir_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataSchema_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 50: + { + com.google.type.Date.Builder subBuilder = null; + if (partitionCase_ == 6) { + subBuilder = ((com.google.type.Date) partition_).toBuilder(); + } + partition_ = input.readMessage(com.google.type.Date.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.type.Date) partition_); + partition_ = subBuilder.buildPartial(); + } + partitionCase_ = 6; + 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BigQuerySource.class, + com.google.cloud.retail.v2beta.BigQuerySource.Builder.class); + } + + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public enum PartitionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PARTITION_DATE(6), + PARTITION_NOT_SET(0); + private final int value; + + private PartitionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PartitionCase valueOf(int value) { + return forNumber(value); + } + + public static PartitionCase forNumber(int value) { + switch (value) { + case 6: + return PARTITION_DATE; + case 0: + return PARTITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public static final int PARTITION_DATE_FIELD_NUMBER = 6; + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object datasetId_; + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object tableId_; + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + @java.lang.Override + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + 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(); + tableId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCS_STAGING_DIR_FIELD_NUMBER = 3; + private volatile java.lang.Object gcsStagingDir_; + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + @java.lang.Override + public java.lang.String getGcsStagingDir() { + java.lang.Object ref = gcsStagingDir_; + 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(); + gcsStagingDir_ = s; + return s; + } + } + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsStagingDirBytes() { + java.lang.Object ref = gcsStagingDir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsStagingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_SCHEMA_FIELD_NUMBER = 4; + private volatile java.lang.Object dataSchema_; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + @java.lang.Override + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + 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(); + dataSchema_ = s; + return s; + } + } + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, gcsStagingDir_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dataSchema_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, projectId_); + } + if (partitionCase_ == 6) { + output.writeMessage(6, (com.google.type.Date) partition_); + } + 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(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, gcsStagingDir_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dataSchema_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, projectId_); + } + if (partitionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.type.Date) partition_); + } + 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.BigQuerySource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.BigQuerySource other = + (com.google.cloud.retail.v2beta.BigQuerySource) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getTableId().equals(other.getTableId())) return false; + if (!getGcsStagingDir().equals(other.getGcsStagingDir())) return false; + if (!getDataSchema().equals(other.getDataSchema())) return false; + if (!getPartitionCase().equals(other.getPartitionCase())) return false; + switch (partitionCase_) { + case 6: + if (!getPartitionDate().equals(other.getPartitionDate())) return false; + break; + case 0: + default: + } + 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTableId().hashCode(); + hash = (37 * hash) + GCS_STAGING_DIR_FIELD_NUMBER; + hash = (53 * hash) + getGcsStagingDir().hashCode(); + hash = (37 * hash) + DATA_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDataSchema().hashCode(); + switch (partitionCase_) { + case 6: + hash = (37 * hash) + PARTITION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getPartitionDate().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.BigQuerySource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource 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.BigQuerySource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource 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.BigQuerySource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource 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.BigQuerySource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource 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.BigQuerySource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource 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.BigQuerySource 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.BigQuerySource 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.BigQuerySource 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; + } + /** + * + * + *
+   * BigQuery source import data from.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BigQuerySource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.BigQuerySource) + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BigQuerySource.class, + com.google.cloud.retail.v2beta.BigQuerySource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.BigQuerySource.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(); + projectId_ = ""; + + datasetId_ = ""; + + tableId_ = ""; + + gcsStagingDir_ = ""; + + dataSchema_ = ""; + + partitionCase_ = 0; + partition_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource build() { + com.google.cloud.retail.v2beta.BigQuerySource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource buildPartial() { + com.google.cloud.retail.v2beta.BigQuerySource result = + new com.google.cloud.retail.v2beta.BigQuerySource(this); + if (partitionCase_ == 6) { + if (partitionDateBuilder_ == null) { + result.partition_ = partition_; + } else { + result.partition_ = partitionDateBuilder_.build(); + } + } + result.projectId_ = projectId_; + result.datasetId_ = datasetId_; + result.tableId_ = tableId_; + result.gcsStagingDir_ = gcsStagingDir_; + result.dataSchema_ = dataSchema_; + result.partitionCase_ = partitionCase_; + 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.BigQuerySource) { + return mergeFrom((com.google.cloud.retail.v2beta.BigQuerySource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.BigQuerySource other) { + if (other == com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + onChanged(); + } + if (!other.getGcsStagingDir().isEmpty()) { + gcsStagingDir_ = other.gcsStagingDir_; + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + onChanged(); + } + switch (other.getPartitionCase()) { + case PARTITION_DATE: + { + mergePartitionDate(other.getPartitionDate()); + break; + } + case PARTITION_NOT_SET: + { + break; + } + } + 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.BigQuerySource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.BigQuerySource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int partitionCase_ = 0; + private java.lang.Object partition_; + + public PartitionCase getPartitionCase() { + return PartitionCase.forNumber(partitionCase_); + } + + public Builder clearPartition() { + partitionCase_ = 0; + partition_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + partitionDateBuilder_; + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 6; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } else { + if (partitionCase_ == 6) { + return partitionDateBuilder_.getMessage(); + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + onChanged(); + } else { + partitionDateBuilder_.setMessage(value); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder setPartitionDate(com.google.type.Date.Builder builderForValue) { + if (partitionDateBuilder_ == null) { + partition_ = builderForValue.build(); + onChanged(); + } else { + partitionDateBuilder_.setMessage(builderForValue.build()); + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder mergePartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6 && partition_ != com.google.type.Date.getDefaultInstance()) { + partition_ = + com.google.type.Date.newBuilder((com.google.type.Date) partition_) + .mergeFrom(value) + .buildPartial(); + } else { + partition_ = value; + } + onChanged(); + } else { + if (partitionCase_ == 6) { + partitionDateBuilder_.mergeFrom(value); + } else { + partitionDateBuilder_.setMessage(value); + } + } + partitionCase_ = 6; + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public Builder clearPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + onChanged(); + } + } else { + if (partitionCase_ == 6) { + partitionCase_ = 0; + partition_ = null; + } + partitionDateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + public com.google.type.Date.Builder getPartitionDateBuilder() { + return getPartitionDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if ((partitionCase_ == 6) && (partitionDateBuilder_ != null)) { + return partitionDateBuilder_.getMessageOrBuilder(); + } else { + if (partitionCase_ == 6) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.type.Date partition_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getPartitionDateFieldBuilder() { + if (partitionDateBuilder_ == null) { + if (!(partitionCase_ == 6)) { + partition_ = com.google.type.Date.getDefaultInstance(); + } + partitionDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + (com.google.type.Date) partition_, getParentForChildren(), isClean()); + partition_ = null; + } + partitionCase_ = 6; + onChanged(); + ; + return partitionDateBuilder_; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID (can be project # or ID) that the BigQuery source is in with
+     * a length limit of 128 characters. If not specified, inherits the project
+     * ID from the parent request.
+     * 
+ * + * string project_id = 5; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + datasetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + + datasetId_ = getDefaultInstance().getDatasetId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + datasetId_ = value; + onChanged(); + return this; + } + + private java.lang.Object tableId_ = ""; + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableId to set. + * @return This builder for chaining. + */ + public Builder setTableId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tableId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + + tableId_ = getDefaultInstance().getTableId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableId to set. + * @return This builder for chaining. + */ + public Builder setTableIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tableId_ = value; + onChanged(); + return this; + } + + private java.lang.Object gcsStagingDir_ = ""; + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + public java.lang.String getGcsStagingDir() { + java.lang.Object ref = gcsStagingDir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gcsStagingDir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + public com.google.protobuf.ByteString getGcsStagingDirBytes() { + java.lang.Object ref = gcsStagingDir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gcsStagingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @param value The gcsStagingDir to set. + * @return This builder for chaining. + */ + public Builder setGcsStagingDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gcsStagingDir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @return This builder for chaining. + */ + public Builder clearGcsStagingDir() { + + gcsStagingDir_ = getDefaultInstance().getGcsStagingDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Intermediate Cloud Storage directory used for the import with a length
+     * limit of 2,000 characters. Can be specified if one wants to have the
+     * BigQuery export to a specific Cloud Storage directory.
+     * 
+ * + * string gcs_staging_dir = 3; + * + * @param value The bytes for gcsStagingDir to set. + * @return This builder for chaining. + */ + public Builder setGcsStagingDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gcsStagingDir_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataSchema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @param value The dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataSchema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + + dataSchema_ = getDefaultInstance().getDataSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `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.
+     *   The schema is available here:
+     *   https://support.google.com/analytics/answer/7029846.
+     * Supported values for auto-completion imports:
+     * * `suggestions` (default): One JSON completion suggestion per line.
+     * * `denylist`:  One JSON deny suggestion per line.
+     * * `allowlist`:  One JSON allow suggestion per line.
+     * 
+ * + * string data_schema = 4; + * + * @param value The bytes for dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataSchema_ = 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.BigQuerySource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.BigQuerySource) + private static final com.google.cloud.retail.v2beta.BigQuerySource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.BigQuerySource(); + } + + public static com.google.cloud.retail.v2beta.BigQuerySource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQuerySource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BigQuerySource(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.BigQuerySource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java new file mode 100644 index 00000000..79ab5181 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java @@ -0,0 +1,248 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface BigQuerySourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.BigQuerySource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return Whether the partitionDate field is set. + */ + 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + * + * @return The partitionDate. + */ + 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`.
+   * 
+ * + * .google.type.Date partition_date = 6; + */ + com.google.type.DateOrBuilder getPartitionDateOrBuilder(); + + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * The project ID (can be project # or ID) that the BigQuery source is in with
+   * a length limit of 128 characters. If not specified, inherits the project
+   * ID from the parent request.
+   * 
+ * + * string project_id = 5; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + /** + * + * + *
+   * Required. The BigQuery data set to copy the data from with a length limit
+   * of 1,024 characters.
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + java.lang.String getTableId(); + /** + * + * + *
+   * Required. The BigQuery table to copy the data from with a length limit of
+   * 1,024 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + com.google.protobuf.ByteString getTableIdBytes(); + + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The gcsStagingDir. + */ + java.lang.String getGcsStagingDir(); + /** + * + * + *
+   * Intermediate Cloud Storage directory used for the import with a length
+   * limit of 2,000 characters. Can be specified if one wants to have the
+   * BigQuery export to a specific Cloud Storage directory.
+   * 
+ * + * string gcs_staging_dir = 3; + * + * @return The bytes for gcsStagingDir. + */ + com.google.protobuf.ByteString getGcsStagingDirBytes(); + + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The dataSchema. + */ + java.lang.String getDataSchema(); + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `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.
+   *   The schema is available here:
+   *   https://support.google.com/analytics/answer/7029846.
+   * Supported values for auto-completion imports:
+   * * `suggestions` (default): One JSON completion suggestion per line.
+   * * `denylist`:  One JSON deny suggestion per line.
+   * * `allowlist`:  One JSON allow suggestion per line.
+   * 
+ * + * string data_schema = 4; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); + + public com.google.cloud.retail.v2beta.BigQuerySource.PartitionCase getPartitionCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BranchName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BranchName.java new file mode 100644 index 00000000..a1da44f8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BranchName.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 BranchName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_BRANCH = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String branch; + + @Deprecated + protected BranchName() { + project = null; + location = null; + catalog = null; + branch = null; + } + + private BranchName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + branch = Preconditions.checkNotNull(builder.getBranch()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BranchName of(String project, String location, String catalog, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .build(); + } + + public static String format(String project, String location, String catalog, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .build() + .toString(); + } + + public static BranchName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_BRANCH.validatedMatch( + formattedString, "BranchName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("branch")); + } + + 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 (BranchName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_BRANCH.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 (branch != null) { + fieldMapBuilder.put("branch", branch); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_BRANCH.instantiate( + "project", project, "location", location, "catalog", catalog, "branch", branch); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BranchName that = ((BranchName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.branch, that.branch); + } + 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(branch); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String branch; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + 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 setBranch(String branch) { + this.branch = branch; + return this; + } + + private Builder(BranchName branchName) { + this.project = branchName.project; + this.location = branchName.location; + this.catalog = branchName.catalog; + this.branch = branchName.branch; + } + + public BranchName build() { + return new BranchName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Catalog.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Catalog.java new file mode 100644 index 00000000..30262d6b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Catalog.java @@ -0,0 +1,1513 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The catalog configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Catalog} + */ +public final class Catalog extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Catalog) + CatalogOrBuilder { + private static final long serialVersionUID = 0L; + // Use Catalog.newBuilder() to construct. + private Catalog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Catalog() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Catalog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Catalog( + 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; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 34: + { + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder subBuilder = null; + if (productLevelConfig_ != null) { + subBuilder = productLevelConfig_.toBuilder(); + } + productLevelConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ProductLevelConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(productLevelConfig_); + productLevelConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder subBuilder = null; + if (merchantCenterLinkingConfig_ != null) { + subBuilder = merchantCenterLinkingConfig_.toBuilder(); + } + merchantCenterLinkingConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(merchantCenterLinkingConfig_); + merchantCenterLinkingConfig_ = 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.CatalogProto + .internal_static_google_cloud_retail_v2beta_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Catalog.class, + com.google.cloud.retail.v2beta.Catalog.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 PRODUCT_LEVEL_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.retail.v2beta.ProductLevelConfig productLevelConfig_; + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + @java.lang.Override + public boolean hasProductLevelConfig() { + return productLevelConfig_ != null; + } + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductLevelConfig getProductLevelConfig() { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2beta.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder + getProductLevelConfigOrBuilder() { + return getProductLevelConfig(); + } + + public static final int MERCHANT_CENTER_LINKING_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchantCenterLinkingConfig_; + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + @java.lang.Override + public boolean hasMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfig_ != null; + } + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig + getMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder() { + return getMerchantCenterLinkingConfig(); + } + + 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 (productLevelConfig_ != null) { + output.writeMessage(4, getProductLevelConfig()); + } + if (merchantCenterLinkingConfig_ != null) { + output.writeMessage(6, getMerchantCenterLinkingConfig()); + } + 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 (productLevelConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProductLevelConfig()); + } + if (merchantCenterLinkingConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, getMerchantCenterLinkingConfig()); + } + 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.Catalog)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Catalog other = (com.google.cloud.retail.v2beta.Catalog) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasProductLevelConfig() != other.hasProductLevelConfig()) return false; + if (hasProductLevelConfig()) { + if (!getProductLevelConfig().equals(other.getProductLevelConfig())) return false; + } + if (hasMerchantCenterLinkingConfig() != other.hasMerchantCenterLinkingConfig()) return false; + if (hasMerchantCenterLinkingConfig()) { + if (!getMerchantCenterLinkingConfig().equals(other.getMerchantCenterLinkingConfig())) + 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(); + if (hasProductLevelConfig()) { + hash = (37 * hash) + PRODUCT_LEVEL_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getProductLevelConfig().hashCode(); + } + if (hasMerchantCenterLinkingConfig()) { + hash = (37 * hash) + MERCHANT_CENTER_LINKING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getMerchantCenterLinkingConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Catalog parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Catalog 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.Catalog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Catalog 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.Catalog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Catalog 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.Catalog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Catalog 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.Catalog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Catalog 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.Catalog 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.Catalog 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.Catalog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The catalog configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Catalog} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Catalog) + com.google.cloud.retail.v2beta.CatalogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_Catalog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_Catalog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Catalog.class, + com.google.cloud.retail.v2beta.Catalog.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Catalog.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_ = ""; + + displayName_ = ""; + + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = null; + } else { + productLevelConfig_ = null; + productLevelConfigBuilder_ = null; + } + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = null; + } else { + merchantCenterLinkingConfig_ = null; + merchantCenterLinkingConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_Catalog_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Catalog getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Catalog.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Catalog build() { + com.google.cloud.retail.v2beta.Catalog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Catalog buildPartial() { + com.google.cloud.retail.v2beta.Catalog result = + new com.google.cloud.retail.v2beta.Catalog(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (productLevelConfigBuilder_ == null) { + result.productLevelConfig_ = productLevelConfig_; + } else { + result.productLevelConfig_ = productLevelConfigBuilder_.build(); + } + if (merchantCenterLinkingConfigBuilder_ == null) { + result.merchantCenterLinkingConfig_ = merchantCenterLinkingConfig_; + } else { + result.merchantCenterLinkingConfig_ = merchantCenterLinkingConfigBuilder_.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.Catalog) { + return mergeFrom((com.google.cloud.retail.v2beta.Catalog) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Catalog other) { + if (other == com.google.cloud.retail.v2beta.Catalog.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasProductLevelConfig()) { + mergeProductLevelConfig(other.getProductLevelConfig()); + } + if (other.hasMerchantCenterLinkingConfig()) { + mergeMerchantCenterLinkingConfig(other.getMerchantCenterLinkingConfig()); + } + 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.Catalog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Catalog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The fully qualified resource name of the catalog.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The catalog display name.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 com.google.cloud.retail.v2beta.ProductLevelConfig productLevelConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductLevelConfig, + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder, + com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder> + productLevelConfigBuilder_; + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + public boolean hasProductLevelConfig() { + return productLevelConfigBuilder_ != null || productLevelConfig_ != null; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + public com.google.cloud.retail.v2beta.ProductLevelConfig getProductLevelConfig() { + if (productLevelConfigBuilder_ == null) { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2beta.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } else { + return productLevelConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProductLevelConfig(com.google.cloud.retail.v2beta.ProductLevelConfig value) { + if (productLevelConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productLevelConfig_ = value; + onChanged(); + } else { + productLevelConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProductLevelConfig( + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder builderForValue) { + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = builderForValue.build(); + onChanged(); + } else { + productLevelConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProductLevelConfig( + com.google.cloud.retail.v2beta.ProductLevelConfig value) { + if (productLevelConfigBuilder_ == null) { + if (productLevelConfig_ != null) { + productLevelConfig_ = + com.google.cloud.retail.v2beta.ProductLevelConfig.newBuilder(productLevelConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + productLevelConfig_ = value; + } + onChanged(); + } else { + productLevelConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProductLevelConfig() { + if (productLevelConfigBuilder_ == null) { + productLevelConfig_ = null; + onChanged(); + } else { + productLevelConfig_ = null; + productLevelConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductLevelConfig.Builder + getProductLevelConfigBuilder() { + + onChanged(); + return getProductLevelConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder + getProductLevelConfigOrBuilder() { + if (productLevelConfigBuilder_ != null) { + return productLevelConfigBuilder_.getMessageOrBuilder(); + } else { + return productLevelConfig_ == null + ? com.google.cloud.retail.v2beta.ProductLevelConfig.getDefaultInstance() + : productLevelConfig_; + } + } + /** + * + * + *
+     * Required. The product level configuration.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductLevelConfig, + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder, + com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder> + getProductLevelConfigFieldBuilder() { + if (productLevelConfigBuilder_ == null) { + productLevelConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductLevelConfig, + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder, + com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder>( + getProductLevelConfig(), getParentForChildren(), isClean()); + productLevelConfig_ = null; + } + return productLevelConfigBuilder_; + } + + private com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchantCenterLinkingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder> + merchantCenterLinkingConfigBuilder_; + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + public boolean hasMerchantCenterLinkingConfig() { + return merchantCenterLinkingConfigBuilder_ != null || merchantCenterLinkingConfig_ != null; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig + getMerchantCenterLinkingConfig() { + if (merchantCenterLinkingConfigBuilder_ == null) { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } else { + return merchantCenterLinkingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder setMerchantCenterLinkingConfig( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig value) { + if (merchantCenterLinkingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + merchantCenterLinkingConfig_ = value; + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder setMerchantCenterLinkingConfig( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder builderForValue) { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = builderForValue.build(); + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder mergeMerchantCenterLinkingConfig( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig value) { + if (merchantCenterLinkingConfigBuilder_ == null) { + if (merchantCenterLinkingConfig_ != null) { + merchantCenterLinkingConfig_ = + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.newBuilder( + merchantCenterLinkingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + merchantCenterLinkingConfig_ = value; + } + onChanged(); + } else { + merchantCenterLinkingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public Builder clearMerchantCenterLinkingConfig() { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfig_ = null; + onChanged(); + } else { + merchantCenterLinkingConfig_ = null; + merchantCenterLinkingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder + getMerchantCenterLinkingConfigBuilder() { + + onChanged(); + return getMerchantCenterLinkingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder() { + if (merchantCenterLinkingConfigBuilder_ != null) { + return merchantCenterLinkingConfigBuilder_.getMessageOrBuilder(); + } else { + return merchantCenterLinkingConfig_ == null + ? com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.getDefaultInstance() + : merchantCenterLinkingConfig_; + } + } + /** + * + * + *
+     * The Merchant Center linking configuration.
+     * Once a link is added, the data stream from Merchant Center to Cloud Retail
+     * will be enabled automatically. The requester must have access to the
+     * merchant center account in order to make changes to this field.
+     * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder> + getMerchantCenterLinkingConfigFieldBuilder() { + if (merchantCenterLinkingConfigBuilder_ == null) { + merchantCenterLinkingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder>( + getMerchantCenterLinkingConfig(), getParentForChildren(), isClean()); + merchantCenterLinkingConfig_ = null; + } + return merchantCenterLinkingConfigBuilder_; + } + + @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.Catalog) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Catalog) + private static final com.google.cloud.retail.v2beta.Catalog DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Catalog(); + } + + public static com.google.cloud.retail.v2beta.Catalog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Catalog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Catalog(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.Catalog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java new file mode 100644 index 00000000..5fa09a0f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java @@ -0,0 +1,2240 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Catalog level attribute config for an attribute. For example, if customers
+ * want to enable/disable facet for a specific attribute.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CatalogAttribute} + */ +public final class CatalogAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CatalogAttribute) + CatalogAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CatalogAttribute.newBuilder() to construct. + private CatalogAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CatalogAttribute() { + key_ = ""; + type_ = 0; + indexableOption_ = 0; + dynamicFacetableOption_ = 0; + searchableOption_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CatalogAttribute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CatalogAttribute( + 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(); + + key_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + indexableOption_ = rawValue; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + dynamicFacetableOption_ = rawValue; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + searchableOption_ = rawValue; + break; + } + case 72: + { + inUse_ = input.readBool(); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + 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.CatalogProto + .internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CatalogAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CatalogAttribute.class, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder.class); + } + + /** + * + * + *
+   * The type of an attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.CatalogAttribute.AttributeType} + */ + public enum AttributeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the attribute is unknown.
+     * Used when type cannot be derived from attribute that is not
+     * [in_use][google.cloud.retail.v2beta.CatalogAttribute.in_use].
+     * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * + * + *
+     * Textual attribute.
+     * 
+ * + * TEXTUAL = 1; + */ + TEXTUAL(1), + /** + * + * + *
+     * Numerical attribute.
+     * 
+ * + * NUMERICAL = 2; + */ + NUMERICAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The type of the attribute is unknown.
+     * Used when type cannot be derived from attribute that is not
+     * [in_use][google.cloud.retail.v2beta.CatalogAttribute.in_use].
+     * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+     * Textual attribute.
+     * 
+ * + * TEXTUAL = 1; + */ + public static final int TEXTUAL_VALUE = 1; + /** + * + * + *
+     * Numerical attribute.
+     * 
+ * + * NUMERICAL = 2; + */ + public static final int NUMERICAL_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 AttributeType 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 AttributeType forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return TEXTUAL; + case 2: + return NUMERICAL; + 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 AttributeType findValueByNumber(int number) { + return AttributeType.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(0); + } + + private static final AttributeType[] VALUES = values(); + + public static AttributeType 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 AttributeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.AttributeType) + } + + /** + * + * + *
+   * The status of the indexable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.CatalogAttribute.IndexableOption} + */ + public enum IndexableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [INDEXABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + INDEXABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Indexable option enabled for an attribute.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + INDEXABLE_ENABLED(1), + /** + * + * + *
+     * Indexable option disabled for an attribute.
+     * 
+ * + * INDEXABLE_DISABLED = 2; + */ + INDEXABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [INDEXABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int INDEXABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indexable option enabled for an attribute.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + public static final int INDEXABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Indexable option disabled for an attribute.
+     * 
+ * + * INDEXABLE_DISABLED = 2; + */ + public static final int INDEXABLE_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 IndexableOption 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 IndexableOption forNumber(int value) { + switch (value) { + case 0: + return INDEXABLE_OPTION_UNSPECIFIED; + case 1: + return INDEXABLE_ENABLED; + case 2: + return INDEXABLE_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 IndexableOption findValueByNumber(int number) { + return IndexableOption.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(1); + } + + private static final IndexableOption[] VALUES = values(); + + public static IndexableOption 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 IndexableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.IndexableOption) + } + + /** + * + * + *
+   * The status of the dynamic facetable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption} + */ + public enum DynamicFacetableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Dynamic facetable option enabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + DYNAMIC_FACETABLE_ENABLED(1), + /** + * + * + *
+     * Dynamic facetable option disabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_DISABLED = 2; + */ + DYNAMIC_FACETABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int DYNAMIC_FACETABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Dynamic facetable option enabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + public static final int DYNAMIC_FACETABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Dynamic facetable option disabled for an attribute.
+     * 
+ * + * DYNAMIC_FACETABLE_DISABLED = 2; + */ + public static final int DYNAMIC_FACETABLE_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 DynamicFacetableOption 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 DynamicFacetableOption forNumber(int value) { + switch (value) { + case 0: + return DYNAMIC_FACETABLE_OPTION_UNSPECIFIED; + case 1: + return DYNAMIC_FACETABLE_ENABLED; + case 2: + return DYNAMIC_FACETABLE_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 DynamicFacetableOption findValueByNumber(int number) { + return DynamicFacetableOption.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(2); + } + + private static final DynamicFacetableOption[] VALUES = values(); + + public static DynamicFacetableOption 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 DynamicFacetableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption) + } + + /** + * + * + *
+   * The status of the searchable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.CatalogAttribute.SearchableOption} + */ + public enum SearchableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + SEARCHABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Searchable option enabled for an attribute.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + SEARCHABLE_ENABLED(1), + /** + * + * + *
+     * Searchable option disabled for an attribute.
+     * 
+ * + * SEARCHABLE_DISABLED = 2; + */ + SEARCHABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int SEARCHABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Searchable option enabled for an attribute.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + public static final int SEARCHABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Searchable option disabled for an attribute.
+     * 
+ * + * SEARCHABLE_DISABLED = 2; + */ + public static final int 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 SearchableOption 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 SearchableOption forNumber(int value) { + switch (value) { + case 0: + return SEARCHABLE_OPTION_UNSPECIFIED; + case 1: + return SEARCHABLE_ENABLED; + case 2: + return 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 SearchableOption findValueByNumber(int number) { + return SearchableOption.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(3); + } + + private static final SearchableOption[] VALUES = values(); + + public static SearchableOption 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 SearchableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.SearchableOption) + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IN_USE_FIELD_NUMBER = 9; + private boolean inUse_; + /** + * + * + *
+   * Output only. Indicates whether this attribute has been used by any
+   * products. `True` if at least one
+   * [Product][google.cloud.retail.v2beta.Product] is using this attribute in
+   * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * Otherwise, this field is `False`.
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
+   * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+   * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
+   * Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
+   * are not in use by products can be deleted.
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
+   * in use by products cannot be deleted; however, their configuration
+   * properties will reset to default values upon removal request.
+   * After catalog changes, it takes about 10 minutes for this field to update.
+   * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + + public static final int TYPE_FIELD_NUMBER = 10; + private int type_; + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType result = + com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.valueOf(type_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNRECOGNIZED + : result; + } + + public static final int INDEXABLE_OPTION_FIELD_NUMBER = 5; + private int indexableOption_; + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption getIndexableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.valueOf(indexableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.UNRECOGNIZED + : result; + } + + public static final int DYNAMIC_FACETABLE_OPTION_FIELD_NUMBER = 6; + private int dynamicFacetableOption_; + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.valueOf( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.UNRECOGNIZED + : result; + } + + public static final int SEARCHABLE_OPTION_FIELD_NUMBER = 7; + private int searchableOption_; + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+   * there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+   * there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption getSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.valueOf(searchableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.UNRECOGNIZED + : result; + } + + 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (indexableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, searchableOption_); + } + if (inUse_ != false) { + output.writeBool(9, inUse_); + } + if (type_ + != com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { + output.writeEnum(10, type_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (indexableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, searchableOption_); + } + if (inUse_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, inUse_); + } + if (type_ + != com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, type_); + } + 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.CatalogAttribute)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CatalogAttribute other = + (com.google.cloud.retail.v2beta.CatalogAttribute) obj; + + if (!getKey().equals(other.getKey())) return false; + if (getInUse() != other.getInUse()) return false; + if (type_ != other.type_) return false; + if (indexableOption_ != other.indexableOption_) return false; + if (dynamicFacetableOption_ != other.dynamicFacetableOption_) return false; + if (searchableOption_ != other.searchableOption_) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInUse()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + INDEXABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + indexableOption_; + hash = (37 * hash) + DYNAMIC_FACETABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + dynamicFacetableOption_; + hash = (37 * hash) + SEARCHABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + searchableOption_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute 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.CatalogAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute 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.CatalogAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute 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.CatalogAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute 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.CatalogAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute 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.CatalogAttribute 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.CatalogAttribute 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.CatalogAttribute 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; + } + /** + * + * + *
+   * Catalog level attribute config for an attribute. For example, if customers
+   * want to enable/disable facet for a specific attribute.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CatalogAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CatalogAttribute) + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CatalogAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CatalogAttribute.class, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CatalogAttribute.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(); + key_ = ""; + + inUse_ = false; + + type_ = 0; + + indexableOption_ = 0; + + dynamicFacetableOption_ = 0; + + searchableOption_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute build() { + com.google.cloud.retail.v2beta.CatalogAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute buildPartial() { + com.google.cloud.retail.v2beta.CatalogAttribute result = + new com.google.cloud.retail.v2beta.CatalogAttribute(this); + result.key_ = key_; + result.inUse_ = inUse_; + result.type_ = type_; + result.indexableOption_ = indexableOption_; + result.dynamicFacetableOption_ = dynamicFacetableOption_; + result.searchableOption_ = searchableOption_; + 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.CatalogAttribute) { + return mergeFrom((com.google.cloud.retail.v2beta.CatalogAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CatalogAttribute other) { + if (other == com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getInUse() != false) { + setInUse(other.getInUse()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.indexableOption_ != 0) { + setIndexableOptionValue(other.getIndexableOptionValue()); + } + if (other.dynamicFacetableOption_ != 0) { + setDynamicFacetableOptionValue(other.getDynamicFacetableOptionValue()); + } + if (other.searchableOption_ != 0) { + setSearchableOptionValue(other.getSearchableOptionValue()); + } + 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.CatalogAttribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.CatalogAttribute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribute name.
+     * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+     * `attributes.xyz`.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private boolean inUse_; + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2beta.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2beta.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The inUse to set. + * @return This builder for chaining. + */ + public Builder setInUse(boolean value) { + + inUse_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether this attribute has been used by any
+     * products. `True` if at least one
+     * [Product][google.cloud.retail.v2beta.Product] is using this attribute in
+     * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * Otherwise, this field is `False`.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
+     * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+     * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
+     * Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
+     * are not in use by products can be deleted.
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
+     * in use by products cannot be deleted; however, their configuration
+     * properties will reset to default values upon removal request.
+     * After catalog changes, it takes about 10 minutes for this field to update.
+     * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearInUse() { + + inUse_ = false; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType result = + com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.valueOf(type_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this attribute. This is derived from the attribute
+     * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int indexableOption_ = 0; + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @param value The enum numeric value on the wire for indexableOption to set. + * @return This builder for chaining. + */ + public Builder setIndexableOptionValue(int value) { + + indexableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption getIndexableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.valueOf(indexableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @param value The indexableOption to set. + * @return This builder for chaining. + */ + public Builder setIndexableOption( + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + indexableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+     * are indexed so that it can be filtered, faceted, or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearIndexableOption() { + + indexableOption_ = 0; + onChanged(); + return this; + } + + private int dynamicFacetableOption_ = 0; + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @param value The enum numeric value on the wire for dynamicFacetableOption to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacetableOptionValue(int value) { + + dynamicFacetableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.valueOf( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @param value The dynamicFacetableOption to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacetableOption( + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + dynamicFacetableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+     * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+     * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+     * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacetableOption() { + + dynamicFacetableOption_ = 0; + onChanged(); + return this; + } + + private int searchableOption_ = 0; + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+     * there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+     * there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @param value The enum numeric value on the wire for searchableOption to set. + * @return This builder for chaining. + */ + public Builder setSearchableOptionValue(int value) { + + searchableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+     * there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption getSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.valueOf( + searchableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+     * there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @param value The searchableOption to set. + * @return This builder for chaining. + */ + public Builder setSearchableOption( + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + searchableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+     * are searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+     * will not be searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+     * there are no text values associated to numerical attributes.
+     * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchableOption() { + + searchableOption_ = 0; + 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.CatalogAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CatalogAttribute) + private static final com.google.cloud.retail.v2beta.CatalogAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CatalogAttribute(); + } + + public static com.google.cloud.retail.v2beta.CatalogAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CatalogAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CatalogAttribute(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.CatalogAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java new file mode 100644 index 00000000..55cc5b72 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java @@ -0,0 +1,224 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface CatalogAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CatalogAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Required. Attribute name.
+   * For example: `color`, `brands`, `attributes.custom_attribute`, such as
+   * `attributes.xyz`.
+   * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Output only. Indicates whether this attribute has been used by any
+   * products. `True` if at least one
+   * [Product][google.cloud.retail.v2beta.Product] is using this attribute in
+   * [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * Otherwise, this field is `False`.
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
+   * pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
+   * or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
+   * Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
+   * are not in use by products can be deleted.
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
+   * in use by products cannot be deleted; however, their configuration
+   * properties will reset to default values upon removal request.
+   * After catalog changes, it takes about 10 minutes for this field to update.
+   * 
+ * + * bool in_use = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The inUse. + */ + boolean getInUse(); + + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Output only. The type of this attribute. This is derived from the attribute
+   * in [Product.attributes][google.cloud.retail.v2beta.Product.attributes].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.AttributeType type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The type. + */ + com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType getType(); + + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * @return The enum numeric value on the wire for indexableOption. + */ + int getIndexableOptionValue(); + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
+   * are indexed so that it can be filtered, faceted, or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.IndexableOption indexable_option = 5; + * + * @return The indexableOption. + */ + com.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption getIndexableOption(); + + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + int getDynamicFacetableOptionValue(); + /** + * + * + *
+   * If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
+   * facet. Could only be DYNAMIC_FACETABLE_DISABLED if
+   * [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option]
+   * is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption dynamic_facetable_option = 6; + * + * + * @return The dynamicFacetableOption. + */ + com.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption + getDynamicFacetableOption(); + + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+   * there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + int getSearchableOptionValue(); + /** + * + * + *
+   * When
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
+   * are searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
+   * will not be searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
+   * there are no text values associated to numerical attributes.
+   * 
+ * + * .google.cloud.retail.v2beta.CatalogAttribute.SearchableOption searchable_option = 7; + * + * + * @return The searchableOption. + */ + com.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption getSearchableOption(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogName.java new file mode 100644 index 00000000..eaab1f81 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogName.java @@ -0,0 +1,223 @@ +/* + * 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 CatalogName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected CatalogName() { + project = null; + location = null; + catalog = null; + } + + private CatalogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CatalogName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static CatalogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "CatalogName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (CatalogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CatalogName that = ((CatalogName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(CatalogName catalogName) { + this.project = catalogName.project; + this.location = catalogName.location; + this.catalog = catalogName.catalog; + } + + public CatalogName build() { + return new CatalogName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogOrBuilder.java new file mode 100644 index 00000000..32e69e4e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogOrBuilder.java @@ -0,0 +1,179 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface CatalogOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Catalog) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. The fully qualified resource name of the catalog.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Immutable. The catalog display name.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the productLevelConfig field is set. + */ + boolean hasProductLevelConfig(); + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The productLevelConfig. + */ + com.google.cloud.retail.v2beta.ProductLevelConfig getProductLevelConfig(); + /** + * + * + *
+   * Required. The product level configuration.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductLevelConfig product_level_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder getProductLevelConfigOrBuilder(); + + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return Whether the merchantCenterLinkingConfig field is set. + */ + boolean hasMerchantCenterLinkingConfig(); + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + * + * @return The merchantCenterLinkingConfig. + */ + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig getMerchantCenterLinkingConfig(); + /** + * + * + *
+   * The Merchant Center linking configuration.
+   * Once a link is added, the data stream from Merchant Center to Cloud Retail
+   * will be enabled automatically. The requester must have access to the
+   * merchant center account in order to make changes to this field.
+   * 
+ * + * + * .google.cloud.retail.v2beta.MerchantCenterLinkingConfig merchant_center_linking_config = 6; + * + */ + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder + getMerchantCenterLinkingConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java new file mode 100644 index 00000000..7b37df8b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java @@ -0,0 +1,252 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public final class CatalogProto { + private CatalogProto() {} + + 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_ProductLevelConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ProductLevelConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CatalogAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AttributesConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompletionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_MerchantCenterLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Catalog_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Catalog_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/catalog.pro" + + "to\022\032google.cloud.retail.v2beta\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032\'google/cloud/retail/v2beta/c" + + "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\"\253\006\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" + + "ibuteTypeB\003\340A\003\022V\n\020indexable_option\030\005 \001(\016" + + "2<.google.cloud.retail.v2beta.CatalogAtt" + + "ribute.IndexableOption\022e\n\030dynamic_faceta" + + "ble_option\030\006 \001(\0162C.google.cloud.retail.v" + + "2beta.CatalogAttribute.DynamicFacetableO" + + "ption\022X\n\021searchable_option\030\007 \001(\0162=.googl" + + "e.cloud.retail.v2beta.CatalogAttribute.S" + + "earchableOption\"8\n\rAttributeType\022\013\n\007UNKN" + + "OWN\020\000\022\013\n\007TEXTUAL\020\001\022\r\n\tNUMERICAL\020\002\"b\n\017Ind" + + "exableOption\022 \n\034INDEXABLE_OPTION_UNSPECI" + + "FIED\020\000\022\025\n\021INDEXABLE_ENABLED\020\001\022\026\n\022INDEXAB" + + "LE_DISABLED\020\002\"\201\001\n\026DynamicFacetableOption" + + "\022(\n$DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" + + "\020\000\022\035\n\031DYNAMIC_FACETABLE_ENABLED\020\001\022\036\n\032DYN" + + "AMIC_FACETABLE_DISABLED\020\002\"f\n\020SearchableO" + + "ption\022!\n\035SEARCHABLE_OPTION_UNSPECIFIED\020\000" + + "\022\026\n\022SEARCHABLE_ENABLED\020\001\022\027\n\023SEARCHABLE_D" + + "ISABLED\020\002\"\302\003\n\020AttributesConfig\022\024\n\004name\030\001" + + " \001(\tB\006\340A\002\340A\005\022_\n\022catalog_attributes\030\002 \003(\013" + + "2C.google.cloud.retail.v2beta.Attributes" + + "Config.CatalogAttributesEntry\022U\n\026attribu" + + "te_config_level\030\003 \001(\01620.google.cloud.ret" + + "ail.v2beta.AttributeConfigLevelB\003\340A\003\032f\n\026" + + "CatalogAttributesEntry\022\013\n\003key\030\001 \001(\t\022;\n\005v" + + "alue\030\002 \001(\0132,.google.cloud.retail.v2beta." + + "CatalogAttribute:\0028\001:x\352Au\n&retail.google" + + "apis.com/AttributesConfig\022Kprojects/{pro" + + "ject}/locations/{location}/catalogs/{cat" + + "alog}/attributesConfig\"\245\005\n\020CompletionCon" + + "fig\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022\026\n\016matching_or" + + "der\030\002 \001(\t\022\027\n\017max_suggestions\030\003 \001(\005\022\031\n\021mi" + + "n_prefix_length\030\004 \001(\005\022\025\n\rauto_learning\030\013" + + " \001(\010\022\\\n\030suggestions_input_config\030\005 \001(\01325" + + ".google.cloud.retail.v2beta.CompletionDa" + + "taInputConfigB\003\340A\003\022.\n!last_suggestions_i" + + "mport_operation\030\006 \001(\tB\003\340A\003\022Y\n\025denylist_i" + + "nput_config\030\007 \001(\01325.google.cloud.retail." + + "v2beta.CompletionDataInputConfigB\003\340A\003\022+\n" + + "\036last_denylist_import_operation\030\010 \001(\tB\003\340" + + "A\003\022Z\n\026allowlist_input_config\030\t \001(\01325.goo" + + "gle.cloud.retail.v2beta.CompletionDataIn" + + "putConfigB\003\340A\003\022,\n\037last_allowlist_import_" + + "operation\030\n \001(\tB\003\340A\003:x\352Au\n&retail.google" + + "apis.com/CompletionConfig\022Kprojects/{pro" + + "ject}/locations/{location}/catalogs/{cat" + + "alog}/completionConfig\"\222\001\n\022MerchantCente" + + "rLink\022\'\n\032merchant_center_account_id\030\001 \001(" + + "\003B\003\340A\002\022\021\n\tbranch_id\030\002 \001(\t\022\024\n\014destination" + + "s\030\003 \003(\t\022\023\n\013region_code\030\004 \001(\t\022\025\n\rlanguage" + + "_code\030\005 \001(\t\"\\\n\033MerchantCenterLinkingConf" + + "ig\022=\n\005links\030\001 \003(\0132..google.cloud.retail." + + "v2beta.MerchantCenterLink\"\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\024product_level_config\030\004 \001(\0132" + + "..google.cloud.retail.v2beta.ProductLeve" + + "lConfigB\003\340A\002\022_\n\036merchant_center_linking_" + + "config\030\006 \001(\01327.google.cloud.retail.v2bet" + + "a.MerchantCenterLinkingConfig:^\352A[\n\035reta" + + "il.googleapis.com/Catalog\022:projects/{pro" + + "ject}/locations/{location}/catalogs/{cat" + + "alog}B\325\001\n\036com.google.cloud.retail.v2beta" + + "B\014CatalogProtoP\001Z@google.golang.org/genp" + + "roto/googleapis/cloud/retail/v2beta;reta" + + "il\242\002\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta" + + "\312\002\032Google\\Cloud\\Retail\\V2beta\352\002\035Google::" + + "Cloud::Retail::V2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_ProductLevelConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_ProductLevelConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ProductLevelConfig_descriptor, + new java.lang.String[] { + "IngestionProductType", "MerchantCenterProductIdField", + }); + internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_CatalogAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CatalogAttribute_descriptor, + new java.lang.String[] { + "Key", + "InUse", + "Type", + "IndexableOption", + "DynamicFacetableOption", + "SearchableOption", + }); + internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_AttributesConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor, + new java.lang.String[] { + "Name", "CatalogAttributes", "AttributeConfigLevel", + }); + internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AttributesConfig_CatalogAttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_CompletionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor, + new java.lang.String[] { + "Name", + "MatchingOrder", + "MaxSuggestions", + "MinPrefixLength", + "AutoLearning", + "SuggestionsInputConfig", + "LastSuggestionsImportOperation", + "DenylistInputConfig", + "LastDenylistImportOperation", + "AllowlistInputConfig", + "LastAllowlistImportOperation", + }); + internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_MerchantCenterLink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor, + new java.lang.String[] { + "MerchantCenterAccountId", "BranchId", "Destinations", "RegionCode", "LanguageCode", + }); + internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor, + new java.lang.String[] { + "Links", + }); + internal_static_google_cloud_retail_v2beta_Catalog_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_Catalog_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Catalog_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "ProductLevelConfig", "MerchantCenterLinkingConfig", + }); + 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.cloud.retail.v2beta.ImportConfigProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java new file mode 100644 index 00000000..6aff9507 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java @@ -0,0 +1,354 @@ +/* + * 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 final class CatalogServiceProto { + private CatalogServiceProto() {} + + 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_ListCatalogsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_ReplaceCatalogAttributeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/retail/v2beta/catalog_ser" + + "vice.proto\022\032google.cloud.retail.v2beta\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032(googl" + + "e/cloud/retail/v2beta/catalog.proto\032\033goo" + + "gle/protobuf/empty.proto\032 google/protobu" + + "f/field_mask.proto\032\037google/protobuf/time" + + "stamp.proto\"w\n\023ListCatalogsRequest\0229\n\006pa" + + "rent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis" + + ".com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\"f\n\024ListCatalogsResponse\0225\n\010" + + "catalogs\030\001 \003(\0132#.google.cloud.retail.v2b" + + "eta.Catalog\022\027\n\017next_page_token\030\002 \001(\t\"\202\001\n" + + "\024UpdateCatalogRequest\0229\n\007catalog\030\001 \001(\0132#" + + ".google.cloud.retail.v2beta.CatalogB\003\340A\002" + + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMask\"\241\001\n\027SetDefaultBranchRequest\0223\n" + + "\007catalog\030\001 \001(\tB\"\372A\037\n\035retail.googleapis.c" + + "om/Catalog\0224\n\tbranch_id\030\002 \001(\tB!\372A\036\n\034reta" + + "il.googleapis.com/Branch\022\014\n\004note\030\003 \001(\t\022\r" + + "\n\005force\030\004 \001(\010\"N\n\027GetDefaultBranchRequest" + + "\0223\n\007catalog\030\001 \001(\tB\"\372A\037\n\035retail.googleapi" + + "s.com/Catalog\"\211\001\n\030GetDefaultBranchRespon" + + "se\0221\n\006branch\030\001 \001(\tB!\372A\036\n\034retail.googleap" + + "is.com/Branch\022,\n\010set_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022\014\n\004note\030\003 \001(\t\"Z\n\032Get" + + "CompletionConfigRequest\022<\n\004name\030\001 \001(\tB.\340" + + "A\002\372A(\n&retail.googleapis.com/CompletionC" + + "onfig\"\236\001\n\035UpdateCompletionConfigRequest\022" + + "L\n\021completion_config\030\001 \001(\0132,.google.clou" + + "d.retail.v2beta.CompletionConfigB\003\340A\002\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.Fie" + + "ldMask\"Z\n\032GetAttributesConfigRequest\022<\n\004" + + "name\030\001 \001(\tB.\340A\002\372A(\n&retail.googleapis.co" + + "m/AttributesConfig\"\236\001\n\035UpdateAttributesC" + + "onfigRequest\022L\n\021attributes_config\030\001 \001(\0132" + + ",.google.cloud.retail.v2beta.AttributesC" + + "onfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\"\265\001\n\032AddCatalogAttrib" + + "uteRequest\022I\n\021attributes_config\030\001 \001(\tB.\340" + + "A\002\372A(\n&retail.googleapis.com/AttributesC" + + "onfig\022L\n\021catalog_attribute\030\002 \001(\0132,.googl" + + "e.cloud.retail.v2beta.CatalogAttributeB\003" + + "\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" + + "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" + }; + 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.CatalogProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_descriptor, + new java.lang.String[] { + "Catalogs", "NextPageToken", + }); + internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor, + new java.lang.String[] { + "Catalog", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_descriptor, + new java.lang.String[] { + "Catalog", "BranchId", "Note", "Force", + }); + internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_descriptor, + new java.lang.String[] { + "Catalog", + }); + internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_descriptor, + new java.lang.String[] { + "Branch", "SetTime", "Note", + }); + internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor, + new java.lang.String[] { + "CompletionConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "CatalogAttribute", + }); + internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "Key", + }); + internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "CatalogAttribute", "UpdateMask", + }); + 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); + 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.CatalogProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequest.java new file mode 100644 index 00000000..1be2ee0c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequest.java @@ -0,0 +1,1130 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for CollectUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CollectUserEventRequest} + */ +public final class CollectUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CollectUserEventRequest) + CollectUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CollectUserEventRequest.newBuilder() to construct. + private CollectUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CollectUserEventRequest() { + parent_ = ""; + userEvent_ = ""; + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CollectUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CollectUserEventRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + userEvent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 32: + { + ets_ = input.readInt64(); + 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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CollectUserEventRequest.class, + com.google.cloud.retail.v2beta.CollectUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_FIELD_NUMBER = 2; + private volatile java.lang.Object userEvent_; + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + @java.lang.Override + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + 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(); + userEvent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 3; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETS_FIELD_NUMBER = 4; + private long ets_; + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + @java.lang.Override + public long getEts() { + return ets_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userEvent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userEvent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (ets_ != 0L) { + output.writeInt64(4, ets_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userEvent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userEvent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (ets_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ets_); + } + 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.CollectUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CollectUserEventRequest other = + (com.google.cloud.retail.v2beta.CollectUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserEvent().equals(other.getUserEvent())) return false; + if (!getUri().equals(other.getUri())) return false; + if (getEts() != other.getEts()) 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) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + ETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEts()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest 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.CollectUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest 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.CollectUserEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest 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.CollectUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest 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.CollectUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest 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.CollectUserEventRequest 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.CollectUserEventRequest 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.CollectUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for CollectUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CollectUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CollectUserEventRequest) + com.google.cloud.retail.v2beta.CollectUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CollectUserEventRequest.class, + com.google.cloud.retail.v2beta.CollectUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CollectUserEventRequest.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_ = ""; + + userEvent_ = ""; + + uri_ = ""; + + ets_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CollectUserEventRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CollectUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CollectUserEventRequest build() { + com.google.cloud.retail.v2beta.CollectUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CollectUserEventRequest buildPartial() { + com.google.cloud.retail.v2beta.CollectUserEventRequest result = + new com.google.cloud.retail.v2beta.CollectUserEventRequest(this); + result.parent_ = parent_; + result.userEvent_ = userEvent_; + result.uri_ = uri_; + result.ets_ = ets_; + 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.CollectUserEventRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CollectUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CollectUserEventRequest other) { + if (other == com.google.cloud.retail.v2beta.CollectUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getUserEvent().isEmpty()) { + userEvent_ = other.userEvent_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getEts() != 0L) { + setEts(other.getEts()); + } + 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.CollectUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CollectUserEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 java.lang.Object userEvent_ = ""; + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + public java.lang.String getUserEvent() { + java.lang.Object ref = userEvent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userEvent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + public com.google.protobuf.ByteString getUserEventBytes() { + java.lang.Object ref = userEvent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userEvent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserEvent() { + + userEvent_ = getDefaultInstance().getUserEvent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+     * characters.
+     * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userEvent to set. + * @return This builder for chaining. + */ + public Builder setUserEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userEvent_ = value; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URL including cgi-parameters but excluding the hash fragment with a
+     * length limit of 5,000 characters. This is often more useful than the
+     * referer URL, because many browsers only send the domain for 3rd party
+     * requests.
+     * 
+ * + * string uri = 3; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private long ets_; + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + @java.lang.Override + public long getEts() { + return ets_; + } + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @param value The ets to set. + * @return This builder for chaining. + */ + public Builder setEts(long value) { + + ets_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * int64 ets = 4; + * + * @return This builder for chaining. + */ + public Builder clearEts() { + + ets_ = 0L; + 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.CollectUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CollectUserEventRequest) + private static final com.google.cloud.retail.v2beta.CollectUserEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CollectUserEventRequest(); + } + + public static com.google.cloud.retail.v2beta.CollectUserEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CollectUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CollectUserEventRequest(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.CollectUserEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequestOrBuilder.java new file mode 100644 index 00000000..566165c1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CollectUserEventRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CollectUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CollectUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userEvent. + */ + java.lang.String getUserEvent(); + /** + * + * + *
+   * Required. URL encoded UserEvent proto with a length limit of 2,000,000
+   * characters.
+   * 
+ * + * string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userEvent. + */ + com.google.protobuf.ByteString getUserEventBytes(); + + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The URL including cgi-parameters but excluding the hash fragment with a
+   * length limit of 5,000 characters. This is often more useful than the
+   * referer URL, because many browsers only send the domain for 3rd party
+   * requests.
+   * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * int64 ets = 4; + * + * @return The ets. + */ + long getEts(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfo.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfo.java new file mode 100644 index 00000000..7d12f577 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfo.java @@ -0,0 +1,1259 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The color information of a [Product][google.cloud.retail.v2beta.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ColorInfo} + */ +public final class ColorInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ColorInfo) + ColorInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ColorInfo.newBuilder() to construct. + private ColorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColorInfo() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColorInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ColorInfo( + 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)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + colorFamilies_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + colors_.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)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ColorInfo.class, + com.google.cloud.retail.v2beta.ColorInfo.Builder.class); + } + + public static final int COLOR_FAMILIES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList colorFamilies_; + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_; + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + + public static final int COLORS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList colors_; + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_; + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.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 < colorFamilies_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, colorFamilies_.getRaw(i)); + } + for (int i = 0; i < colors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, colors_.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 < colorFamilies_.size(); i++) { + dataSize += computeStringSizeNoTag(colorFamilies_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorFamiliesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < colors_.size(); i++) { + dataSize += computeStringSizeNoTag(colors_.getRaw(i)); + } + size += dataSize; + size += 1 * getColorsList().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.ColorInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ColorInfo other = (com.google.cloud.retail.v2beta.ColorInfo) obj; + + if (!getColorFamiliesList().equals(other.getColorFamiliesList())) return false; + if (!getColorsList().equals(other.getColorsList())) 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 (getColorFamiliesCount() > 0) { + hash = (37 * hash) + COLOR_FAMILIES_FIELD_NUMBER; + hash = (53 * hash) + getColorFamiliesList().hashCode(); + } + if (getColorsCount() > 0) { + hash = (37 * hash) + COLORS_FIELD_NUMBER; + hash = (53 * hash) + getColorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ColorInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ColorInfo 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.ColorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ColorInfo 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.ColorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ColorInfo 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.ColorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ColorInfo 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.ColorInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ColorInfo 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.ColorInfo 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.ColorInfo 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.ColorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The color information of a [Product][google.cloud.retail.v2beta.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ColorInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ColorInfo) + com.google.cloud.retail.v2beta.ColorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_ColorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ColorInfo.class, + com.google.cloud.retail.v2beta.ColorInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ColorInfo.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(); + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + colors_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ColorInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ColorInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ColorInfo build() { + com.google.cloud.retail.v2beta.ColorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ColorInfo buildPartial() { + com.google.cloud.retail.v2beta.ColorInfo result = + new com.google.cloud.retail.v2beta.ColorInfo(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = colorFamilies_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.colorFamilies_ = colorFamilies_; + if (((bitField0_ & 0x00000002) != 0)) { + colors_ = colors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.colors_ = colors_; + 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.ColorInfo) { + return mergeFrom((com.google.cloud.retail.v2beta.ColorInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ColorInfo other) { + if (other == com.google.cloud.retail.v2beta.ColorInfo.getDefaultInstance()) return this; + if (!other.colorFamilies_.isEmpty()) { + if (colorFamilies_.isEmpty()) { + colorFamilies_ = other.colorFamilies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColorFamiliesIsMutable(); + colorFamilies_.addAll(other.colorFamilies_); + } + onChanged(); + } + if (!other.colors_.isEmpty()) { + if (colors_.isEmpty()) { + colors_ = other.colors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureColorsIsMutable(); + colors_.addAll(other.colors_); + } + 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.ColorInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ColorInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList colorFamilies_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorFamiliesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + colorFamilies_ = new com.google.protobuf.LazyStringArrayList(colorFamilies_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + public com.google.protobuf.ProtocolStringList getColorFamiliesList() { + return colorFamilies_.getUnmodifiableView(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + public int getColorFamiliesCount() { + return colorFamilies_.size(); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + public java.lang.String getColorFamilies(int index) { + return colorFamilies_.get(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + public com.google.protobuf.ByteString getColorFamiliesBytes(int index) { + return colorFamilies_.getByteString(index); + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param index The index to set the value at. + * @param value The colorFamilies to set. + * @return This builder for chaining. + */ + public Builder setColorFamilies(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamilies(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param values The colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addAllColorFamilies(java.lang.Iterable values) { + ensureColorFamiliesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colorFamilies_); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @return This builder for chaining. + */ + public Builder clearColorFamilies() { + colorFamilies_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard color families. Strongly recommended to use the following
+     * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+     * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+     * "Mixed". Normally it is expected to have only 1 color family. May consider
+     * using single "Mixed" instead of multiple values.
+     * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string color_families = 1; + * + * @param value The bytes of the colorFamilies to add. + * @return This builder for chaining. + */ + public Builder addColorFamiliesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorFamiliesIsMutable(); + colorFamilies_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList colors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureColorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + colors_ = new com.google.protobuf.LazyStringArrayList(colors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + public com.google.protobuf.ProtocolStringList getColorsList() { + return colors_.getUnmodifiableView(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + public int getColorsCount() { + return colors_.size(); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + public java.lang.String getColors(int index) { + return colors_.get(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + public com.google.protobuf.ByteString getColorsBytes(int index) { + return colors_.getByteString(index); + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param index The index to set the value at. + * @param value The colors to set. + * @return This builder for chaining. + */ + public Builder setColors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The colors to add. + * @return This builder for chaining. + */ + public Builder addColors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColorsIsMutable(); + colors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param values The colors to add. + * @return This builder for chaining. + */ + public Builder addAllColors(java.lang.Iterable values) { + ensureColorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, colors_); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @return This builder for chaining. + */ + public Builder clearColors() { + colors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The color display names, which may be different from standard color family
+     * names, such as the color aliases used in the website frontend. Normally
+     * it is expected to have only 1 color. May consider using single "Mixed"
+     * instead of multiple values.
+     * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * repeated string colors = 2; + * + * @param value The bytes of the colors to add. + * @return This builder for chaining. + */ + public Builder addColorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColorsIsMutable(); + colors_.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.ColorInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ColorInfo) + private static final com.google.cloud.retail.v2beta.ColorInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ColorInfo(); + } + + public static com.google.cloud.retail.v2beta.ColorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColorInfo(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.ColorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfoOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfoOrBuilder.java new file mode 100644 index 00000000..00d05db8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ColorInfoOrBuilder.java @@ -0,0 +1,203 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface ColorInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ColorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return A list containing the colorFamilies. + */ + java.util.List getColorFamiliesList(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @return The count of colorFamilies. + */ + int getColorFamiliesCount(); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the element to return. + * @return The colorFamilies at the given index. + */ + java.lang.String getColorFamilies(int index); + /** + * + * + *
+   * The standard color families. Strongly recommended to use the following
+   * standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
+   * "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
+   * "Mixed". Normally it is expected to have only 1 color family. May consider
+   * using single "Mixed" instead of multiple values.
+   * A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string color_families = 1; + * + * @param index The index of the value to return. + * @return The bytes of the colorFamilies at the given index. + */ + com.google.protobuf.ByteString getColorFamiliesBytes(int index); + + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return A list containing the colors. + */ + java.util.List getColorsList(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @return The count of colors. + */ + int getColorsCount(); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the element to return. + * @return The colors at the given index. + */ + java.lang.String getColors(int index); + /** + * + * + *
+   * The color display names, which may be different from standard color family
+   * names, such as the color aliases used in the website frontend. Normally
+   * it is expected to have only 1 color. May consider using single "Mixed"
+   * instead of multiple values.
+   * A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * repeated string colors = 2; + * + * @param index The index of the value to return. + * @return The bytes of the colors at the given index. + */ + com.google.protobuf.ByteString getColorsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CommonProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CommonProto.java new file mode 100644 index 00000000..09b6743e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CommonProto.java @@ -0,0 +1,453 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public final class CommonProto { + private CommonProto() {} + + 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_Condition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Condition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Condition_TimeRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_BoostAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_FilterAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Audience_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Audience_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ColorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_FulfillmentInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Image_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Image_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Interval_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PriceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Rating_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Rating_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UserInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_LocalInventory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_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/common.prot" + + "o\022\032google.cloud.retail.v2beta\032\037google/ap" + + "i/field_behavior.proto\032\037google/protobuf/" + + "timestamp.proto\"\270\002\n\tCondition\022D\n\013query_t" + + "erms\030\001 \003(\0132/.google.cloud.retail.v2beta." + + "Condition.QueryTerm\022J\n\021active_time_range" + + "\030\003 \003(\0132/.google.cloud.retail.v2beta.Cond" + + "ition.TimeRange\032.\n\tQueryTerm\022\r\n\005value\030\001 " + + "\001(\t\022\022\n\nfull_match\030\002 \001(\010\032i\n\tTimeRange\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\"\241\t\n\004Rule\022D\n\014boost_action\030\002 \001(" + + "\0132,.google.cloud.retail.v2beta.Rule.Boos" + + "tActionH\000\022J\n\017redirect_action\030\003 \001(\0132/.goo" + + "gle.cloud.retail.v2beta.Rule.RedirectAct" + + "ionH\000\022W\n\026oneway_synonyms_action\030\006 \001(\01325." + + "google.cloud.retail.v2beta.Rule.OnewaySy" + + "nonymsActionH\000\022X\n\027do_not_associate_actio" + + "n\030\007 \001(\01325.google.cloud.retail.v2beta.Rul" + + "e.DoNotAssociateActionH\000\022P\n\022replacement_" + + "action\030\010 \001(\01322.google.cloud.retail.v2bet" + + "a.Rule.ReplacementActionH\000\022F\n\rignore_act" + + "ion\030\t \001(\0132-.google.cloud.retail.v2beta.R" + + "ule.IgnoreActionH\000\022F\n\rfilter_action\030\n \001(" + + "\0132-.google.cloud.retail.v2beta.Rule.Filt" + + "erActionH\000\022W\n\026twoway_synonyms_action\030\013 \001" + + "(\01325.google.cloud.retail.v2beta.Rule.Two" + + "waySynonymsActionH\000\022=\n\tcondition\030\001 \001(\0132%" + + ".google.cloud.retail.v2beta.ConditionB\003\340" + + "A\002\0325\n\013BoostAction\022\r\n\005boost\030\001 \001(\002\022\027\n\017prod" + + "ucts_filter\030\002 \001(\t\032\036\n\014FilterAction\022\016\n\006fil" + + "ter\030\001 \001(\t\032&\n\016RedirectAction\022\024\n\014redirect_" + + "uri\030\001 \001(\t\032(\n\024TwowaySynonymsAction\022\020\n\010syn" + + "onyms\030\001 \003(\t\032S\n\024OnewaySynonymsAction\022\023\n\013q" + + "uery_terms\030\003 \003(\t\022\020\n\010synonyms\030\004 \003(\t\022\024\n\014on" + + "eway_terms\030\002 \003(\t\032Z\n\024DoNotAssociateAction" + + "\022\023\n\013query_terms\030\002 \003(\t\022\036\n\026do_not_associat" + + "e_terms\030\003 \003(\t\022\r\n\005terms\030\001 \003(\t\032P\n\021Replacem" + + "entAction\022\023\n\013query_terms\030\002 \003(\t\022\030\n\020replac" + + "ement_term\030\003 \001(\t\022\014\n\004term\030\001 \001(\t\032$\n\014Ignore" + + "Action\022\024\n\014ignore_terms\030\001 \003(\tB\010\n\006action\"/" + + "\n\010Audience\022\017\n\007genders\030\001 \003(\t\022\022\n\nage_group" + + "s\030\002 \003(\t\"3\n\tColorInfo\022\026\n\016color_families\030\001" + + " \003(\t\022\016\n\006colors\030\002 \003(\t\"~\n\017CustomAttribute\022" + + "\014\n\004text\030\001 \003(\t\022\017\n\007numbers\030\002 \003(\001\022\027\n\nsearch" + + "able\030\003 \001(\010H\000\210\001\001\022\026\n\tindexable\030\004 \001(\010H\001\210\001\001B" + + "\r\n\013_searchableB\014\n\n_indexable\"2\n\017Fulfillm" + + "entInfo\022\014\n\004type\030\001 \001(\t\022\021\n\tplace_ids\030\002 \003(\t" + + "\"8\n\005Image\022\020\n\003uri\030\001 \001(\tB\003\340A\002\022\016\n\006height\030\002 " + + "\001(\005\022\r\n\005width\030\003 \001(\005\"x\n\010Interval\022\021\n\007minimu" + + "m\030\001 \001(\001H\000\022\033\n\021exclusive_minimum\030\002 \001(\001H\000\022\021" + + "\n\007maximum\030\003 \001(\001H\001\022\033\n\021exclusive_maximum\030\004" + + " \001(\001H\001B\005\n\003minB\005\n\003max\"\225\003\n\tPriceInfo\022\025\n\rcu" + + "rrency_code\030\001 \001(\t\022\r\n\005price\030\002 \001(\002\022\026\n\016orig" + + "inal_price\030\003 \001(\002\022\014\n\004cost\030\004 \001(\002\0228\n\024price_" + + "effective_time\030\005 \001(\0132\032.google.protobuf.T" + + "imestamp\0225\n\021price_expire_time\030\006 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022J\n\013price_range\030\007" + + " \001(\01320.google.cloud.retail.v2beta.PriceI" + + "nfo.PriceRangeB\003\340A\003\032\177\n\nPriceRange\0223\n\005pri" + + "ce\030\001 \001(\0132$.google.cloud.retail.v2beta.In" + + "terval\022<\n\016original_price\030\002 \001(\0132$.google." + + "cloud.retail.v2beta.Interval\"P\n\006Rating\022\024" + + "\n\014rating_count\030\001 \001(\005\022\026\n\016average_rating\030\002" + + " \001(\002\022\030\n\020rating_histogram\030\003 \003(\005\"`\n\010UserIn" + + "fo\022\017\n\007user_id\030\001 \001(\t\022\022\n\nip_address\030\002 \001(\t\022" + + "\022\n\nuser_agent\030\003 \001(\t\022\033\n\023direct_user_reque" + + "st\030\004 \001(\010\"\255\002\n\016LocalInventory\022\020\n\010place_id\030" + + "\001 \001(\t\0229\n\nprice_info\030\002 \001(\0132%.google.cloud" + + ".retail.v2beta.PriceInfo\022N\n\nattributes\030\003" + + " \003(\0132:.google.cloud.retail.v2beta.LocalI" + + "nventory.AttributesEntry\022\036\n\021fulfillment_" + + "types\030\004 \003(\tB\003\340A\004\032^\n\017AttributesEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022:\n\005value\030\002 \001(\0132+.google.cloud.r" + + "etail.v2beta.CustomAttribute:\0028\001*\206\001\n\024Att" + + "ributeConfigLevel\022&\n\"ATTRIBUTE_CONFIG_LE" + + "VEL_UNSPECIFIED\020\000\022\"\n\036PRODUCT_LEVEL_ATTRI" + + "BUTE_CONFIG\020\001\022\"\n\036CATALOG_LEVEL_ATTRIBUTE" + + "_CONFIG\020\002*i\n\014SolutionType\022\035\n\031SOLUTION_TY" + + "PE_UNSPECIFIED\020\000\022 \n\034SOLUTION_TYPE_RECOMM" + + "ENDATION\020\001\022\030\n\024SOLUTION_TYPE_SEARCH\020\002*\213\001\n" + + "\025SearchSolutionUseCase\022(\n$SEARCH_SOLUTIO" + + "N_USE_CASE_UNSPECIFIED\020\000\022#\n\037SEARCH_SOLUT" + + "ION_USE_CASE_SEARCH\020\001\022#\n\037SEARCH_SOLUTION" + + "_USE_CASE_BROWSE\020\002B\324\001\n\036com.google.cloud." + + "retail.v2betaB\013CommonProtoP\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( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_Condition_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_Condition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Condition_descriptor, + new java.lang.String[] { + "QueryTerms", "ActiveTimeRange", + }); + internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor = + internal_static_google_cloud_retail_v2beta_Condition_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor, + new java.lang.String[] { + "Value", "FullMatch", + }); + internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor = + internal_static_google_cloud_retail_v2beta_Condition_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2beta_Condition_TimeRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", + }); + internal_static_google_cloud_retail_v2beta_Rule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_descriptor, + new java.lang.String[] { + "BoostAction", + "RedirectAction", + "OnewaySynonymsAction", + "DoNotAssociateAction", + "ReplacementAction", + "IgnoreAction", + "FilterAction", + "TwowaySynonymsAction", + "Condition", + "Action", + }); + internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_Rule_BoostAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor, + new java.lang.String[] { + "Boost", "ProductsFilter", + }); + internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2beta_Rule_FilterAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor, + new java.lang.String[] { + "Filter", + }); + internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor, + new java.lang.String[] { + "RedirectUri", + }); + internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor, + new java.lang.String[] { + "Synonyms", + }); + internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor, + new java.lang.String[] { + "QueryTerms", "Synonyms", "OnewayTerms", + }); + internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor, + new java.lang.String[] { + "QueryTerms", "DoNotAssociateTerms", "Terms", + }); + internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(6); + internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor, + new java.lang.String[] { + "QueryTerms", "ReplacementTerm", "Term", + }); + internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor = + internal_static_google_cloud_retail_v2beta_Rule_descriptor.getNestedTypes().get(7); + internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor, + new java.lang.String[] { + "IgnoreTerms", + }); + internal_static_google_cloud_retail_v2beta_Audience_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_Audience_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Audience_descriptor, + new java.lang.String[] { + "Genders", "AgeGroups", + }); + internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_ColorInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ColorInfo_descriptor, + new java.lang.String[] { + "ColorFamilies", "Colors", + }); + internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor, + new java.lang.String[] { + "Text", "Numbers", "Searchable", "Indexable", "Searchable", "Indexable", + }); + internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_FulfillmentInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor, + new java.lang.String[] { + "Type", "PlaceIds", + }); + internal_static_google_cloud_retail_v2beta_Image_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_Image_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Image_descriptor, + new java.lang.String[] { + "Uri", "Height", "Width", + }); + internal_static_google_cloud_retail_v2beta_Interval_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_Interval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Interval_descriptor, + new java.lang.String[] { + "Minimum", "ExclusiveMinimum", "Maximum", "ExclusiveMaximum", "Min", "Max", + }); + internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2beta_PriceInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor, + new java.lang.String[] { + "CurrencyCode", + "Price", + "OriginalPrice", + "Cost", + "PriceEffectiveTime", + "PriceExpireTime", + "PriceRange", + }); + internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor = + internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor, + new java.lang.String[] { + "Price", "OriginalPrice", + }); + internal_static_google_cloud_retail_v2beta_Rating_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2beta_Rating_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Rating_descriptor, + new java.lang.String[] { + "RatingCount", "AverageRating", "RatingHistogram", + }); + internal_static_google_cloud_retail_v2beta_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2beta_UserInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserInfo_descriptor, + new java.lang.String[] { + "UserId", "IpAddress", "UserAgent", "DirectUserRequest", + }); + internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2beta_LocalInventory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor, + new java.lang.String[] { + "PlaceId", "PriceInfo", "Attributes", "FulfillmentTypes", + }); + internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequest.java new file mode 100644 index 00000000..19dda265 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequest.java @@ -0,0 +1,1994 @@ +/* + * 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/completion_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Auto-complete parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryRequest} + */ +public final class CompleteQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompleteQueryRequest) + CompleteQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryRequest.newBuilder() to construct. + private CompleteQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryRequest() { + catalog_ = ""; + query_ = ""; + visitorId_ = ""; + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deviceType_ = ""; + dataset_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryRequest( + 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(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + languageCodes_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + deviceType_ = s; + break; + } + case 40: + { + maxSuggestions_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataset_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = 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)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryRequest.class, + com.google.cloud.retail.v2beta.CompleteQueryRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languageCodes_; + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return languageCodes_; + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object deviceType_; + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATASET_FIELD_NUMBER = 6; + private volatile java.lang.Object dataset_; + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + @java.lang.Override + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + 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(); + dataset_ = s; + return s; + } + } + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_SUGGESTIONS_FIELD_NUMBER = 5; + private int maxSuggestions_; + /** + * + * + *
+   * Completion max suggestions. If left unset or set to 0, then will fallback
+   * to the configured value
+   * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions].
+   * The maximum allowed max suggestions is 20. If it is set higher, it will be
+   * capped by 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + for (int i = 0; i < languageCodes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCodes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceType_); + } + if (maxSuggestions_ != 0) { + output.writeInt32(5, maxSuggestions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dataset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, visitorId_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + { + int dataSize = 0; + for (int i = 0; i < languageCodes_.size(); i++) { + dataSize += computeStringSizeNoTag(languageCodes_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguageCodesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deviceType_); + } + if (maxSuggestions_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxSuggestions_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataset_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dataset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, visitorId_); + } + 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.CompleteQueryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompleteQueryRequest other = + (com.google.cloud.retail.v2beta.CompleteQueryRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getLanguageCodesList().equals(other.getLanguageCodesList())) return false; + if (!getDeviceType().equals(other.getDeviceType())) return false; + if (!getDataset().equals(other.getDataset())) return false; + if (getMaxSuggestions() != other.getMaxSuggestions()) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (getLanguageCodesCount() > 0) { + hash = (37 * hash) + LANGUAGE_CODES_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCodesList().hashCode(); + } + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + hash = (37 * hash) + MAX_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxSuggestions(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest 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.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest 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.CompleteQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest 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.CompleteQueryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest 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.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest 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.CompleteQueryRequest 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.CompleteQueryRequest 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.CompleteQueryRequest 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; + } + /** + * + * + *
+   * Auto-complete parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompleteQueryRequest) + com.google.cloud.retail.v2beta.CompleteQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryRequest.class, + com.google.cloud.retail.v2beta.CompleteQueryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CompleteQueryRequest.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(); + catalog_ = ""; + + query_ = ""; + + visitorId_ = ""; + + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + deviceType_ = ""; + + dataset_ = ""; + + maxSuggestions_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompleteQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryRequest build() { + com.google.cloud.retail.v2beta.CompleteQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryRequest buildPartial() { + com.google.cloud.retail.v2beta.CompleteQueryRequest result = + new com.google.cloud.retail.v2beta.CompleteQueryRequest(this); + int from_bitField0_ = bitField0_; + result.catalog_ = catalog_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = languageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languageCodes_ = languageCodes_; + result.deviceType_ = deviceType_; + result.dataset_ = dataset_; + result.maxSuggestions_ = maxSuggestions_; + 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.CompleteQueryRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CompleteQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CompleteQueryRequest other) { + if (other == com.google.cloud.retail.v2beta.CompleteQueryRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.languageCodes_.isEmpty()) { + if (languageCodes_.isEmpty()) { + languageCodes_ = other.languageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguageCodesIsMutable(); + languageCodes_.addAll(other.languageCodes_); + } + onChanged(); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + onChanged(); + } + if (!other.getDataset().isEmpty()) { + dataset_ = other.dataset_; + onChanged(); + } + if (other.getMaxSuggestions() != 0) { + setMaxSuggestions(other.getMaxSuggestions()); + } + 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.CompleteQueryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CompleteQueryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Catalog for which the completion is performed.
+     * Full resource name of catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The query used to generate suggestions.
+     * The maximum number of allowed characters is 255.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required field. A unique identifier for tracking visitors. For example,
+     * this could be implemented with an HTTP cookie, which should be able to
+     * uniquely identify a visitor on a single device. This unique identifier
+     * should not change if the visitor logs in or out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 7; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languageCodes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + languageCodes_ = new com.google.protobuf.LazyStringArrayList(languageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + public com.google.protobuf.ProtocolStringList getLanguageCodesList() { + return languageCodes_.getUnmodifiableView(); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + public int getLanguageCodesCount() { + return languageCodes_.size(); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + public java.lang.String getLanguageCodes(int index) { + return languageCodes_.get(index); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + public com.google.protobuf.ByteString getLanguageCodesBytes(int index) { + return languageCodes_.getByteString(index); + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param index The index to set the value at. + * @param value The languageCodes to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param values The languageCodes to add. + * @return This builder for chaining. + */ + public Builder addAllLanguageCodes(java.lang.Iterable values) { + ensureLanguageCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languageCodes_); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCodes() { + languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The language filters applied to the output suggestions. If set, it should
+     * contain the language of the query. If not set, suggestions are returned
+     * without considering language restrictions. This is the BCP-47 language
+     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+     * number of language codes is 3.
+     * 
+ * + * repeated string language_codes = 3; + * + * @param value The bytes of the languageCodes to add. + * @return This builder for chaining. + */ + public Builder addLanguageCodesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguageCodesIsMutable(); + languageCodes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object deviceType_ = ""; + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + + deviceType_ = getDefaultInstance().getDeviceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The device type context for completion suggestions.
+     * It is useful to apply different suggestions on different device types, e.g.
+     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+     * types.
+     * Supported formats:
+     * * `UNKNOWN_DEVICE_TYPE`
+     * * `DESKTOP`
+     * * `MOBILE`
+     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+     * 
+ * + * string device_type = 4; + * + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataset_ = ""; + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @param value The dataset to set. + * @return This builder for chaining. + */ + public Builder setDataset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @return This builder for chaining. + */ + public Builder clearDataset() { + + dataset_ = getDefaultInstance().getDataset(); + onChanged(); + return this; + } + /** + * + * + *
+     * Determines which dataset to use for fetching completion. "user-data" will
+     * use the imported dataset through
+     * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+     * "cloud-retail" will use the dataset generated by cloud retail based on user
+     * events. If leave empty, it will use the "user-data".
+     * Current supported values:
+     * * user-data
+     * * cloud-retail
+     *   This option requires additional allowlisting. Before using cloud-retail,
+     *   contact Cloud Retail support team first.
+     * 
+ * + * string dataset = 6; + * + * @param value The bytes for dataset to set. + * @return This builder for chaining. + */ + public Builder setDatasetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataset_ = value; + onChanged(); + return this; + } + + private int maxSuggestions_; + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @param value The maxSuggestions to set. + * @return This builder for chaining. + */ + public Builder setMaxSuggestions(int value) { + + maxSuggestions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion max suggestions. If left unset or set to 0, then will fallback
+     * to the configured value
+     * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions].
+     * The maximum allowed max suggestions is 20. If it is set higher, it will be
+     * capped by 20.
+     * 
+ * + * int32 max_suggestions = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxSuggestions() { + + maxSuggestions_ = 0; + 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.CompleteQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompleteQueryRequest) + private static final com.google.cloud.retail.v2beta.CompleteQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CompleteQueryRequest(); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryRequest(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.CompleteQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequestOrBuilder.java new file mode 100644 index 00000000..0b4d7d43 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryRequestOrBuilder.java @@ -0,0 +1,292 @@ +/* + * 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/completion_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CompleteQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompleteQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Required. Catalog for which the completion is performed.
+   * Full resource name of catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The query used to generate suggestions.
+   * The maximum number of allowed characters is 255.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required field. A unique identifier for tracking visitors. For example,
+   * this could be implemented with an HTTP cookie, which should be able to
+   * uniquely identify a visitor on a single device. This unique identifier
+   * should not change if the visitor logs in or out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 7; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return A list containing the languageCodes. + */ + java.util.List getLanguageCodesList(); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @return The count of languageCodes. + */ + int getLanguageCodesCount(); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the element to return. + * @return The languageCodes at the given index. + */ + java.lang.String getLanguageCodes(int index); + /** + * + * + *
+   * The language filters applied to the output suggestions. If set, it should
+   * contain the language of the query. If not set, suggestions are returned
+   * without considering language restrictions. This is the BCP-47 language
+   * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
+   * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
+   * number of language codes is 3.
+   * 
+ * + * repeated string language_codes = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languageCodes at the given index. + */ + com.google.protobuf.ByteString getLanguageCodesBytes(int index); + + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + * + * + *
+   * The device type context for completion suggestions.
+   * It is useful to apply different suggestions on different device types, e.g.
+   * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
+   * types.
+   * Supported formats:
+   * * `UNKNOWN_DEVICE_TYPE`
+   * * `DESKTOP`
+   * * `MOBILE`
+   * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
+   * 
+ * + * string device_type = 4; + * + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString getDeviceTypeBytes(); + + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The dataset. + */ + java.lang.String getDataset(); + /** + * + * + *
+   * Determines which dataset to use for fetching completion. "user-data" will
+   * use the imported dataset through
+   * [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData].
+   * "cloud-retail" will use the dataset generated by cloud retail based on user
+   * events. If leave empty, it will use the "user-data".
+   * Current supported values:
+   * * user-data
+   * * cloud-retail
+   *   This option requires additional allowlisting. Before using cloud-retail,
+   *   contact Cloud Retail support team first.
+   * 
+ * + * string dataset = 6; + * + * @return The bytes for dataset. + */ + com.google.protobuf.ByteString getDatasetBytes(); + + /** + * + * + *
+   * Completion max suggestions. If left unset or set to 0, then will fallback
+   * to the configured value
+   * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions].
+   * The maximum allowed max suggestions is 20. If it is set higher, it will be
+   * capped by 20.
+   * 
+ * + * int32 max_suggestions = 5; + * + * @return The maxSuggestions. + */ + int getMaxSuggestions(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponse.java new file mode 100644 index 00000000..cb8c8bef --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponse.java @@ -0,0 +1,3987 @@ +/* + * 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/completion_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the auto-complete query.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse} + */ +public final class CompleteQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompleteQueryResponse) + CompleteQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompleteQueryResponse.newBuilder() to construct. + private CompleteQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompleteQueryResponse() { + completionResults_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + recentSearchResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompleteQueryResponse( + 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)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult>(); + mutable_bitField0_ |= 0x00000001; + } + completionResults_.add( + input.readMessage( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult>(); + mutable_bitField0_ |= 0x00000002; + } + recentSearchResults_.add( + input.readMessage( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + .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)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.Builder.class); + } + + public interface CompletionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + java.lang.String getSuggestion(); + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + com.google.protobuf.ByteString getSuggestionBytes(); + + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + int getAttributesCount(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute defaultValue); + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Resource that represents completion results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} + */ + public static final class CompletionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + CompletionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionResult.newBuilder() to construct. + private CompletionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionResult() { + suggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionResult( + 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(); + + suggestion_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + 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.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder.class); + } + + public static final int SUGGESTION_FIELD_NUMBER = 1; + private volatile java.lang.Object suggestion_; + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + @java.lang.Override + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + 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(); + suggestion_ = s; + return s; + } + } + /** + * + * + *
+     * The suggestion for the query.
+     * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Custom attributes for the suggestion term.
+     * * For "user-data", the attributes are additional custom attributes
+     * ingested through BigQuery.
+     * * For "cloud-retail", the attributes are product attributes generated
+     * by Cloud Retail.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(suggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, suggestion_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2); + 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(suggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, suggestion_); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__); + } + 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.CompleteQueryResponse.CompletionResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult other = + (com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) obj; + + if (!getSuggestion().equals(other.getSuggestion())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) 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) + SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSuggestion().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + 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.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult 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.CompleteQueryResponse.CompletionResult 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; + } + /** + * + * + *
+     * Resource that represents completion results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.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(); + suggestion_ = ""; + + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult build() { + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult buildPartial() { + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult result = + new com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult(this); + int from_bitField0_ = bitField0_; + result.suggestion_ = suggestion_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + 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.CompleteQueryResponse.CompletionResult) { + return mergeFrom( + (com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult other) { + if (other + == com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + .getDefaultInstance()) return this; + if (!other.getSuggestion().isEmpty()) { + suggestion_ = other.suggestion_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + 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.CompleteQueryResponse.CompletionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object suggestion_ = ""; + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The suggestion. + */ + public java.lang.String getSuggestion() { + java.lang.Object ref = suggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + suggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return The bytes for suggestion. + */ + public com.google.protobuf.ByteString getSuggestionBytes() { + java.lang.Object ref = suggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + suggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + suggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return This builder for chaining. + */ + public Builder clearSuggestion() { + + suggestion_ = getDefaultInstance().getSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @param value The bytes for suggestion to set. + * @return This builder for chaining. + */ + public Builder setSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + suggestion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Custom attributes for the suggestion term.
+       * * For "user-data", the attributes are additional custom attributes
+       * ingested through BigQuery.
+       * * For "cloud-retail", the attributes are product attributes generated
+       * by Cloud Retail.
+       * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 2; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + 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.CompleteQueryResponse.CompletionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult) + private static final com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult(); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionResult(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.CompleteQueryResponse.CompletionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RecentSearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + java.lang.String getRecentSearch(); + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + com.google.protobuf.ByteString getRecentSearchBytes(); + } + /** + * + * + *
+   * Recent search of this user.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} + */ + public static final class RecentSearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + RecentSearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecentSearchResult.newBuilder() to construct. + private RecentSearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecentSearchResult() { + recentSearch_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecentSearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RecentSearchResult( + 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(); + + recentSearch_ = 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.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + .class); + } + + public static final int RECENT_SEARCH_FIELD_NUMBER = 1; + private volatile java.lang.Object recentSearch_; + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + @java.lang.Override + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + 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(); + recentSearch_ = s; + return s; + } + } + /** + * + * + *
+     * The recent search query.
+     * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = 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(recentSearch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, recentSearch_); + } + 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(recentSearch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, recentSearch_); + } + 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.CompleteQueryResponse.RecentSearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult other = + (com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) obj; + + if (!getRecentSearch().equals(other.getRecentSearch())) 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) + RECENT_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearch().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + 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.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult 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.CompleteQueryResponse.RecentSearchResult 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; + } + /** + * + * + *
+     * Recent search of this user.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.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(); + recentSearch_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult build() { + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + buildPartial() { + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult result = + new com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult(this); + result.recentSearch_ = recentSearch_; + 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.CompleteQueryResponse.RecentSearchResult) { + return mergeFrom( + (com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult other) { + if (other + == com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()) return this; + if (!other.getRecentSearch().isEmpty()) { + recentSearch_ = other.recentSearch_; + 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.CompleteQueryResponse.RecentSearchResult parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object recentSearch_ = ""; + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The recentSearch. + */ + public java.lang.String getRecentSearch() { + java.lang.Object ref = recentSearch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recentSearch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return The bytes for recentSearch. + */ + public com.google.protobuf.ByteString getRecentSearchBytes() { + java.lang.Object ref = recentSearch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recentSearch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recentSearch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @return This builder for chaining. + */ + public Builder clearRecentSearch() { + + recentSearch_ = getDefaultInstance().getRecentSearch(); + onChanged(); + return this; + } + /** + * + * + *
+       * The recent search query.
+       * 
+ * + * string recent_search = 1; + * + * @param value The bytes for recentSearch to set. + * @return This builder for chaining. + */ + public Builder setRecentSearchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recentSearch_ = 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.CompleteQueryResponse.RecentSearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult) + private static final com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult(); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecentSearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecentSearchResult(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.CompleteQueryResponse.RecentSearchResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int COMPLETION_RESULTS_FIELD_NUMBER = 1; + private java.util.List + completionResults_; + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List + getCompletionResultsList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + return completionResults_; + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public int getCompletionResultsCount() { + return completionResults_.size(); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult getCompletionResults( + int index) { + return completionResults_.get(index); + } + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + return completionResults_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECENT_SEARCH_RESULTS_FIELD_NUMBER = 3; + private java.util.List + recentSearchResults_; + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List + getRecentSearchResultsList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + return recentSearchResults_; + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public int getRecentSearchResultsCount() { + return recentSearchResults_.size(); + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + getRecentSearchResults(int index) { + return recentSearchResults_.get(index); + } + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + return recentSearchResults_.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 { + for (int i = 0; i < completionResults_.size(); i++) { + output.writeMessage(1, completionResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + output.writeMessage(3, recentSearchResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < completionResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, completionResults_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributionToken_); + } + for (int i = 0; i < recentSearchResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, recentSearchResults_.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.CompleteQueryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompleteQueryResponse other = + (com.google.cloud.retail.v2beta.CompleteQueryResponse) obj; + + if (!getCompletionResultsList().equals(other.getCompletionResultsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getRecentSearchResultsList().equals(other.getRecentSearchResultsList())) 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 (getCompletionResultsCount() > 0) { + hash = (37 * hash) + COMPLETION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getCompletionResultsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getRecentSearchResultsCount() > 0) { + hash = (37 * hash) + RECENT_SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getRecentSearchResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse 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.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse 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.CompleteQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse 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.CompleteQueryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse 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.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse 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.CompleteQueryResponse 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.CompleteQueryResponse 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.CompleteQueryResponse 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 auto-complete query.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompleteQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompleteQueryResponse) + com.google.cloud.retail.v2beta.CompleteQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompleteQueryResponse.class, + com.google.cloud.retail.v2beta.CompleteQueryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CompleteQueryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCompletionResultsFieldBuilder(); + getRecentSearchResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + completionResultsBuilder_.clear(); + } + attributionToken_ = ""; + + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CompletionServiceProto + .internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompleteQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse build() { + com.google.cloud.retail.v2beta.CompleteQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompleteQueryResponse buildPartial() { + com.google.cloud.retail.v2beta.CompleteQueryResponse result = + new com.google.cloud.retail.v2beta.CompleteQueryResponse(this); + int from_bitField0_ = bitField0_; + if (completionResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + completionResults_ = java.util.Collections.unmodifiableList(completionResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.completionResults_ = completionResults_; + } else { + result.completionResults_ = completionResultsBuilder_.build(); + } + result.attributionToken_ = attributionToken_; + if (recentSearchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = java.util.Collections.unmodifiableList(recentSearchResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.recentSearchResults_ = recentSearchResults_; + } else { + result.recentSearchResults_ = recentSearchResultsBuilder_.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.CompleteQueryResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.CompleteQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CompleteQueryResponse other) { + if (other == com.google.cloud.retail.v2beta.CompleteQueryResponse.getDefaultInstance()) + return this; + if (completionResultsBuilder_ == null) { + if (!other.completionResults_.isEmpty()) { + if (completionResults_.isEmpty()) { + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCompletionResultsIsMutable(); + completionResults_.addAll(other.completionResults_); + } + onChanged(); + } + } else { + if (!other.completionResults_.isEmpty()) { + if (completionResultsBuilder_.isEmpty()) { + completionResultsBuilder_.dispose(); + completionResultsBuilder_ = null; + completionResults_ = other.completionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + completionResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCompletionResultsFieldBuilder() + : null; + } else { + completionResultsBuilder_.addAllMessages(other.completionResults_); + } + } + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (recentSearchResultsBuilder_ == null) { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResults_.isEmpty()) { + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.addAll(other.recentSearchResults_); + } + onChanged(); + } + } else { + if (!other.recentSearchResults_.isEmpty()) { + if (recentSearchResultsBuilder_.isEmpty()) { + recentSearchResultsBuilder_.dispose(); + recentSearchResultsBuilder_ = null; + recentSearchResults_ = other.recentSearchResults_; + bitField0_ = (bitField0_ & ~0x00000002); + recentSearchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRecentSearchResultsFieldBuilder() + : null; + } else { + recentSearchResultsBuilder_.addAllMessages(other.recentSearchResults_); + } + } + } + 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.CompleteQueryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CompleteQueryResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + completionResults_ = java.util.Collections.emptyList(); + + private void ensureCompletionResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + completionResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult>( + completionResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder> + completionResultsBuilder_; + + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List + getCompletionResultsList() { + if (completionResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(completionResults_); + } else { + return completionResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public int getCompletionResultsCount() { + if (completionResultsBuilder_ == null) { + return completionResults_.size(); + } else { + return completionResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + getCompletionResults(int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.set(index, value); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder setCompletionResults( + int index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.set(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult value) { + if (completionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletionResultsIsMutable(); + completionResults_.add(index, value); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addCompletionResults( + int index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + builderForValue) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.add(index, builderForValue.build()); + onChanged(); + } else { + completionResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder addAllCompletionResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult> + values) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, completionResults_); + onChanged(); + } else { + completionResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder clearCompletionResults() { + if (completionResultsBuilder_ == null) { + completionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + completionResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public Builder removeCompletionResults(int index) { + if (completionResultsBuilder_ == null) { + ensureCompletionResultsIsMutable(); + completionResults_.remove(index); + onChanged(); + } else { + completionResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + getCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index) { + if (completionResultsBuilder_ == null) { + return completionResults_.get(index); + } else { + return completionResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList() { + if (completionResultsBuilder_ != null) { + return completionResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(completionResults_); + } + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder() { + return getCompletionResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder + addCompletionResultsBuilder(int index) { + return getCompletionResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matching suggestions. The result list is ordered and the
+     * first result is top suggestion.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder> + getCompletionResultsBuilderList() { + return getCompletionResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsFieldBuilder() { + if (completionResultsBuilder_ == null) { + completionResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder>( + completionResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + completionResults_ = null; + } + return completionResultsBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique complete token. This should be included in the
+     * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+     * for search events resulting from this completion, which enables accurate
+     * attribution of complete model performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.util.List + recentSearchResults_ = java.util.Collections.emptyList(); + + private void ensureRecentSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + recentSearchResults_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult>( + recentSearchResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder> + recentSearchResultsBuilder_; + + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List + getRecentSearchResultsList() { + if (recentSearchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } else { + return recentSearchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public int getRecentSearchResultsCount() { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.size(); + } else { + return recentSearchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + getRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder setRecentSearchResults( + int index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult value) { + if (recentSearchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, value); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addRecentSearchResults( + int index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + builderForValue) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + recentSearchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder addAllRecentSearchResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult> + values) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recentSearchResults_); + onChanged(); + } else { + recentSearchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder clearRecentSearchResults() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + recentSearchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public Builder removeRecentSearchResults(int index) { + if (recentSearchResultsBuilder_ == null) { + ensureRecentSearchResultsIsMutable(); + recentSearchResults_.remove(index); + onChanged(); + } else { + recentSearchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + getRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index) { + if (recentSearchResultsBuilder_ == null) { + return recentSearchResults_.get(index); + } else { + return recentSearchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList() { + if (recentSearchResultsBuilder_ != null) { + return recentSearchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(recentSearchResults_); + } + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder() { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder + addRecentSearchResultsBuilder(int index) { + return getRecentSearchResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Matched recent searches of this user. The maximum number of recent searches
+     * is 10. This field is a restricted feature. Contact Retail Search support
+     * team if you are interested in enabling it.
+     * This feature is only available when
+     * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+     * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+     * imported. The recent searches satisfy the follow rules:
+     *  * They are ordered from latest to oldest.
+     *  * They are matched with
+     *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+     *  case insensitively.
+     *  * They are transformed to lower cases.
+     *  * They are UTF-8 safe.
+     * Recent searches are deduplicated. More recent searches will be reserved
+     * when duplication happens.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + public java.util.List< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder> + getRecentSearchResultsBuilderList() { + return getRecentSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsFieldBuilder() { + if (recentSearchResultsBuilder_ == null) { + recentSearchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult.Builder, + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder>( + recentSearchResults_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + recentSearchResults_ = null; + } + return recentSearchResultsBuilder_; + } + + @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.CompleteQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompleteQueryResponse) + private static final com.google.cloud.retail.v2beta.CompleteQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CompleteQueryResponse(); + } + + public static com.google.cloud.retail.v2beta.CompleteQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompleteQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompleteQueryResponse(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.CompleteQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponseOrBuilder.java new file mode 100644 index 00000000..876e2178 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompleteQueryResponseOrBuilder.java @@ -0,0 +1,264 @@ +/* + * 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/completion_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CompleteQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompleteQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List + getCompletionResultsList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult getCompletionResults( + int index); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + int getCompletionResultsCount(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder> + getCompletionResultsOrBuilderList(); + /** + * + * + *
+   * Results of the matching suggestions. The result list is ordered and the
+   * first result is top suggestion.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult completion_results = 1; + * + */ + com.google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResultOrBuilder + getCompletionResultsOrBuilder(int index); + + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique complete token. This should be included in the
+   * [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail]
+   * for search events resulting from this completion, which enables accurate
+   * attribution of complete model performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List + getRecentSearchResultsList(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult getRecentSearchResults( + int index); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + int getRecentSearchResultsCount(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder> + getRecentSearchResultsOrBuilderList(); + /** + * + * + *
+   * Matched recent searches of this user. The maximum number of recent searches
+   * is 10. This field is a restricted feature. Contact Retail Search support
+   * team if you are interested in enabling it.
+   * This feature is only available when
+   * [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id]
+   * field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is
+   * imported. The recent searches satisfy the follow rules:
+   *  * They are ordered from latest to oldest.
+   *  * They are matched with
+   *  [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query]
+   *  case insensitively.
+   *  * They are transformed to lower cases.
+   *  * They are UTF-8 safe.
+   * Recent searches are deduplicated. More recent searches will be reserved
+   * when duplication happens.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResult recent_search_results = 3; + * + */ + com.google.cloud.retail.v2beta.CompleteQueryResponse.RecentSearchResultOrBuilder + getRecentSearchResultsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfig.java new file mode 100644 index 00000000..89d0066b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfig.java @@ -0,0 +1,2776 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Catalog level autocomplete config for customers to customize autocomplete
+ * feature's settings.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionConfig} + */ +public final class CompletionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompletionConfig) + CompletionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionConfig.newBuilder() to construct. + private CompletionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionConfig() { + name_ = ""; + matchingOrder_ = ""; + lastSuggestionsImportOperation_ = ""; + lastDenylistImportOperation_ = ""; + lastAllowlistImportOperation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionConfig( + 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; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + matchingOrder_ = s; + break; + } + case 24: + { + maxSuggestions_ = input.readInt32(); + break; + } + case 32: + { + minPrefixLength_ = input.readInt32(); + break; + } + case 42: + { + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder subBuilder = null; + if (suggestionsInputConfig_ != null) { + subBuilder = suggestionsInputConfig_.toBuilder(); + } + suggestionsInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(suggestionsInputConfig_); + suggestionsInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastSuggestionsImportOperation_ = s; + break; + } + case 58: + { + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder subBuilder = null; + if (denylistInputConfig_ != null) { + subBuilder = denylistInputConfig_.toBuilder(); + } + denylistInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(denylistInputConfig_); + denylistInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastDenylistImportOperation_ = s; + break; + } + case 74: + { + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder subBuilder = null; + if (allowlistInputConfig_ != null) { + subBuilder = allowlistInputConfig_.toBuilder(); + } + allowlistInputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allowlistInputConfig_); + allowlistInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + lastAllowlistImportOperation_ = s; + break; + } + case 88: + { + autoLearning_ = 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.CatalogProto + .internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CompletionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionConfig.class, + com.google.cloud.retail.v2beta.CompletionConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 MATCHING_ORDER_FIELD_NUMBER = 2; + private volatile java.lang.Object matchingOrder_; + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + @java.lang.Override + public java.lang.String getMatchingOrder() { + java.lang.Object ref = matchingOrder_; + 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(); + matchingOrder_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMatchingOrderBytes() { + java.lang.Object ref = matchingOrder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + matchingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_SUGGESTIONS_FIELD_NUMBER = 3; + private int maxSuggestions_; + /** + * + * + *
+   * The maximum number of autocomplete suggestions returned per term. The
+   * maximum allowed max suggestions is 20. Default value is 20. If left unset
+   * or set to 0, then will fallback to default value.
+   * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + + public static final int MIN_PREFIX_LENGTH_FIELD_NUMBER = 4; + private int minPrefixLength_; + /** + * + * + *
+   * The minimum number of characters needed to be typed in order to get
+   * suggestions. Default value is 2. If left unset or set to 0, then will
+   * fallback to default value.
+   * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + + public static final int AUTO_LEARNING_FIELD_NUMBER = 11; + private boolean autoLearning_; + /** + * + * + *
+   * If set to true, the auto learning function is enabled. Auto learning uses
+   * user data to generate suggestions using ML techniques. Default value is
+   * false. Only after enabling auto learning can users use `cloud-retail`
+   * data in
+   * [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
+   * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + @java.lang.Override + public boolean getAutoLearning() { + return autoLearning_; + } + + public static final int SUGGESTIONS_INPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.retail.v2beta.CompletionDataInputConfig suggestionsInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + @java.lang.Override + public boolean hasSuggestionsInputConfig() { + return suggestionsInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getSuggestionsInputConfig() { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder() { + return getSuggestionsInputConfig(); + } + + public static final int LAST_SUGGESTIONS_IMPORT_OPERATION_FIELD_NUMBER = 6; + private volatile java.lang.Object lastSuggestionsImportOperation_; + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + @java.lang.Override + public java.lang.String getLastSuggestionsImportOperation() { + java.lang.Object ref = lastSuggestionsImportOperation_; + 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(); + lastSuggestionsImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastSuggestionsImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENYLIST_INPUT_CONFIG_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2beta.CompletionDataInputConfig denylistInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + @java.lang.Override + public boolean hasDenylistInputConfig() { + return denylistInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getDenylistInputConfig() { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder() { + return getDenylistInputConfig(); + } + + public static final int LAST_DENYLIST_IMPORT_OPERATION_FIELD_NUMBER = 8; + private volatile java.lang.Object lastDenylistImportOperation_; + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + @java.lang.Override + public java.lang.String getLastDenylistImportOperation() { + java.lang.Object ref = lastDenylistImportOperation_; + 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(); + lastDenylistImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastDenylistImportOperationBytes() { + java.lang.Object ref = lastDenylistImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastDenylistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOWLIST_INPUT_CONFIG_FIELD_NUMBER = 9; + private com.google.cloud.retail.v2beta.CompletionDataInputConfig allowlistInputConfig_; + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + @java.lang.Override + public boolean hasAllowlistInputConfig() { + return allowlistInputConfig_ != null; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getAllowlistInputConfig() { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder() { + return getAllowlistInputConfig(); + } + + public static final int LAST_ALLOWLIST_IMPORT_OPERATION_FIELD_NUMBER = 10; + private volatile java.lang.Object lastAllowlistImportOperation_; + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + @java.lang.Override + public java.lang.String getLastAllowlistImportOperation() { + java.lang.Object ref = lastAllowlistImportOperation_; + 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(); + lastAllowlistImportOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastAllowlistImportOperationBytes() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAllowlistImportOperation_ = 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(matchingOrder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, matchingOrder_); + } + if (maxSuggestions_ != 0) { + output.writeInt32(3, maxSuggestions_); + } + if (minPrefixLength_ != 0) { + output.writeInt32(4, minPrefixLength_); + } + if (suggestionsInputConfig_ != null) { + output.writeMessage(5, getSuggestionsInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastSuggestionsImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 6, lastSuggestionsImportOperation_); + } + if (denylistInputConfig_ != null) { + output.writeMessage(7, getDenylistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastDenylistImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, lastDenylistImportOperation_); + } + if (allowlistInputConfig_ != null) { + output.writeMessage(9, getAllowlistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAllowlistImportOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, lastAllowlistImportOperation_); + } + if (autoLearning_ != false) { + output.writeBool(11, autoLearning_); + } + 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(matchingOrder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, matchingOrder_); + } + if (maxSuggestions_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSuggestions_); + } + if (minPrefixLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, minPrefixLength_); + } + if (suggestionsInputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSuggestionsInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastSuggestionsImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 6, lastSuggestionsImportOperation_); + } + if (denylistInputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDenylistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastDenylistImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(8, lastDenylistImportOperation_); + } + if (allowlistInputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getAllowlistInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAllowlistImportOperation_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 10, lastAllowlistImportOperation_); + } + if (autoLearning_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, autoLearning_); + } + 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.CompletionConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompletionConfig other = + (com.google.cloud.retail.v2beta.CompletionConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getMatchingOrder().equals(other.getMatchingOrder())) return false; + if (getMaxSuggestions() != other.getMaxSuggestions()) return false; + if (getMinPrefixLength() != other.getMinPrefixLength()) return false; + if (getAutoLearning() != other.getAutoLearning()) return false; + if (hasSuggestionsInputConfig() != other.hasSuggestionsInputConfig()) return false; + if (hasSuggestionsInputConfig()) { + if (!getSuggestionsInputConfig().equals(other.getSuggestionsInputConfig())) return false; + } + if (!getLastSuggestionsImportOperation().equals(other.getLastSuggestionsImportOperation())) + return false; + if (hasDenylistInputConfig() != other.hasDenylistInputConfig()) return false; + if (hasDenylistInputConfig()) { + if (!getDenylistInputConfig().equals(other.getDenylistInputConfig())) return false; + } + if (!getLastDenylistImportOperation().equals(other.getLastDenylistImportOperation())) + return false; + if (hasAllowlistInputConfig() != other.hasAllowlistInputConfig()) return false; + if (hasAllowlistInputConfig()) { + if (!getAllowlistInputConfig().equals(other.getAllowlistInputConfig())) return false; + } + if (!getLastAllowlistImportOperation().equals(other.getLastAllowlistImportOperation())) + 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) + MATCHING_ORDER_FIELD_NUMBER; + hash = (53 * hash) + getMatchingOrder().hashCode(); + hash = (37 * hash) + MAX_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxSuggestions(); + hash = (37 * hash) + MIN_PREFIX_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getMinPrefixLength(); + hash = (37 * hash) + AUTO_LEARNING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoLearning()); + if (hasSuggestionsInputConfig()) { + hash = (37 * hash) + SUGGESTIONS_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSuggestionsInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_SUGGESTIONS_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastSuggestionsImportOperation().hashCode(); + if (hasDenylistInputConfig()) { + hash = (37 * hash) + DENYLIST_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDenylistInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_DENYLIST_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastDenylistImportOperation().hashCode(); + if (hasAllowlistInputConfig()) { + hash = (37 * hash) + ALLOWLIST_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAllowlistInputConfig().hashCode(); + } + hash = (37 * hash) + LAST_ALLOWLIST_IMPORT_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getLastAllowlistImportOperation().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompletionConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig 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.CompletionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig 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.CompletionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig 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.CompletionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig 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.CompletionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig 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.CompletionConfig 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.CompletionConfig 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.CompletionConfig 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; + } + /** + * + * + *
+   * Catalog level autocomplete config for customers to customize autocomplete
+   * feature's settings.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompletionConfig) + com.google.cloud.retail.v2beta.CompletionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CompletionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionConfig.class, + com.google.cloud.retail.v2beta.CompletionConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CompletionConfig.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_ = ""; + + matchingOrder_ = ""; + + maxSuggestions_ = 0; + + minPrefixLength_ = 0; + + autoLearning_ = false; + + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = null; + } else { + suggestionsInputConfig_ = null; + suggestionsInputConfigBuilder_ = null; + } + lastSuggestionsImportOperation_ = ""; + + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = null; + } else { + denylistInputConfig_ = null; + denylistInputConfigBuilder_ = null; + } + lastDenylistImportOperation_ = ""; + + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = null; + } else { + allowlistInputConfig_ = null; + allowlistInputConfigBuilder_ = null; + } + lastAllowlistImportOperation_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_CompletionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionConfig build() { + com.google.cloud.retail.v2beta.CompletionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionConfig buildPartial() { + com.google.cloud.retail.v2beta.CompletionConfig result = + new com.google.cloud.retail.v2beta.CompletionConfig(this); + result.name_ = name_; + result.matchingOrder_ = matchingOrder_; + result.maxSuggestions_ = maxSuggestions_; + result.minPrefixLength_ = minPrefixLength_; + result.autoLearning_ = autoLearning_; + if (suggestionsInputConfigBuilder_ == null) { + result.suggestionsInputConfig_ = suggestionsInputConfig_; + } else { + result.suggestionsInputConfig_ = suggestionsInputConfigBuilder_.build(); + } + result.lastSuggestionsImportOperation_ = lastSuggestionsImportOperation_; + if (denylistInputConfigBuilder_ == null) { + result.denylistInputConfig_ = denylistInputConfig_; + } else { + result.denylistInputConfig_ = denylistInputConfigBuilder_.build(); + } + result.lastDenylistImportOperation_ = lastDenylistImportOperation_; + if (allowlistInputConfigBuilder_ == null) { + result.allowlistInputConfig_ = allowlistInputConfig_; + } else { + result.allowlistInputConfig_ = allowlistInputConfigBuilder_.build(); + } + result.lastAllowlistImportOperation_ = lastAllowlistImportOperation_; + 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.CompletionConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.CompletionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CompletionConfig other) { + if (other == com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getMatchingOrder().isEmpty()) { + matchingOrder_ = other.matchingOrder_; + onChanged(); + } + if (other.getMaxSuggestions() != 0) { + setMaxSuggestions(other.getMaxSuggestions()); + } + if (other.getMinPrefixLength() != 0) { + setMinPrefixLength(other.getMinPrefixLength()); + } + if (other.getAutoLearning() != false) { + setAutoLearning(other.getAutoLearning()); + } + if (other.hasSuggestionsInputConfig()) { + mergeSuggestionsInputConfig(other.getSuggestionsInputConfig()); + } + if (!other.getLastSuggestionsImportOperation().isEmpty()) { + lastSuggestionsImportOperation_ = other.lastSuggestionsImportOperation_; + onChanged(); + } + if (other.hasDenylistInputConfig()) { + mergeDenylistInputConfig(other.getDenylistInputConfig()); + } + if (!other.getLastDenylistImportOperation().isEmpty()) { + lastDenylistImportOperation_ = other.lastDenylistImportOperation_; + onChanged(); + } + if (other.hasAllowlistInputConfig()) { + mergeAllowlistInputConfig(other.getAllowlistInputConfig()); + } + if (!other.getLastAllowlistImportOperation().isEmpty()) { + lastAllowlistImportOperation_ = other.lastAllowlistImportOperation_; + 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.CompletionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.CompletionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Fully qualified name
+     * `projects/*/locations/*/catalogs/*/completionConfig`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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 matchingOrder_ = ""; + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + public java.lang.String getMatchingOrder() { + java.lang.Object ref = matchingOrder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + matchingOrder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + public com.google.protobuf.ByteString getMatchingOrderBytes() { + java.lang.Object ref = matchingOrder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + matchingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @param value The matchingOrder to set. + * @return This builder for chaining. + */ + public Builder setMatchingOrder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + matchingOrder_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @return This builder for chaining. + */ + public Builder clearMatchingOrder() { + + matchingOrder_ = getDefaultInstance().getMatchingOrder(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the matching order for autocomplete suggestions, e.g., a query
+     * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+     * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+     * suggest "red shoes". Currently supported values:
+     * * 'out-of-order'
+     * * 'exact-prefix'
+     * Default value: 'exact-prefix'.
+     * 
+ * + * string matching_order = 2; + * + * @param value The bytes for matchingOrder to set. + * @return This builder for chaining. + */ + public Builder setMatchingOrderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + matchingOrder_ = value; + onChanged(); + return this; + } + + private int maxSuggestions_; + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + @java.lang.Override + public int getMaxSuggestions() { + return maxSuggestions_; + } + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @param value The maxSuggestions to set. + * @return This builder for chaining. + */ + public Builder setMaxSuggestions(int value) { + + maxSuggestions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of autocomplete suggestions returned per term. The
+     * maximum allowed max suggestions is 20. Default value is 20. If left unset
+     * or set to 0, then will fallback to default value.
+     * 
+ * + * int32 max_suggestions = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxSuggestions() { + + maxSuggestions_ = 0; + onChanged(); + return this; + } + + private int minPrefixLength_; + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + @java.lang.Override + public int getMinPrefixLength() { + return minPrefixLength_; + } + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @param value The minPrefixLength to set. + * @return This builder for chaining. + */ + public Builder setMinPrefixLength(int value) { + + minPrefixLength_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum number of characters needed to be typed in order to get
+     * suggestions. Default value is 2. If left unset or set to 0, then will
+     * fallback to default value.
+     * 
+ * + * int32 min_prefix_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearMinPrefixLength() { + + minPrefixLength_ = 0; + onChanged(); + return this; + } + + private boolean autoLearning_; + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + @java.lang.Override + public boolean getAutoLearning() { + return autoLearning_; + } + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @param value The autoLearning to set. + * @return This builder for chaining. + */ + public Builder setAutoLearning(boolean value) { + + autoLearning_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, the auto learning function is enabled. Auto learning uses
+     * user data to generate suggestions using ML techniques. Default value is
+     * false. Only after enabling auto learning can users use `cloud-retail`
+     * data in
+     * [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
+     * 
+ * + * bool auto_learning = 11; + * + * @return This builder for chaining. + */ + public Builder clearAutoLearning() { + + autoLearning_ = false; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.CompletionDataInputConfig suggestionsInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + suggestionsInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + public boolean hasSuggestionsInputConfig() { + return suggestionsInputConfigBuilder_ != null || suggestionsInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getSuggestionsInputConfig() { + if (suggestionsInputConfigBuilder_ == null) { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } else { + return suggestionsInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSuggestionsInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (suggestionsInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + suggestionsInputConfig_ = value; + onChanged(); + } else { + suggestionsInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSuggestionsInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder builderForValue) { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = builderForValue.build(); + onChanged(); + } else { + suggestionsInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSuggestionsInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (suggestionsInputConfigBuilder_ == null) { + if (suggestionsInputConfig_ != null) { + suggestionsInputConfig_ = + com.google.cloud.retail.v2beta.CompletionDataInputConfig.newBuilder( + suggestionsInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + suggestionsInputConfig_ = value; + } + onChanged(); + } else { + suggestionsInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSuggestionsInputConfig() { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfig_ = null; + onChanged(); + } else { + suggestionsInputConfig_ = null; + suggestionsInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder + getSuggestionsInputConfigBuilder() { + + onChanged(); + return getSuggestionsInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder() { + if (suggestionsInputConfigBuilder_ != null) { + return suggestionsInputConfigBuilder_.getMessageOrBuilder(); + } else { + return suggestionsInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : suggestionsInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + getSuggestionsInputConfigFieldBuilder() { + if (suggestionsInputConfigBuilder_ == null) { + suggestionsInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder>( + getSuggestionsInputConfig(), getParentForChildren(), isClean()); + suggestionsInputConfig_ = null; + } + return suggestionsInputConfigBuilder_; + } + + private java.lang.Object lastSuggestionsImportOperation_ = ""; + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + public java.lang.String getLastSuggestionsImportOperation() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastSuggestionsImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + public com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes() { + java.lang.Object ref = lastSuggestionsImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastSuggestionsImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastSuggestionsImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastSuggestionsImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastSuggestionsImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastSuggestionsImportOperation() { + + lastSuggestionsImportOperation_ = getDefaultInstance().getLastSuggestionsImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the LRO corresponding to the latest suggestion terms
+     * list import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastSuggestionsImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastSuggestionsImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastSuggestionsImportOperation_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.CompletionDataInputConfig denylistInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + denylistInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + public boolean hasDenylistInputConfig() { + return denylistInputConfigBuilder_ != null || denylistInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getDenylistInputConfig() { + if (denylistInputConfigBuilder_ == null) { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } else { + return denylistInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDenylistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (denylistInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + denylistInputConfig_ = value; + onChanged(); + } else { + denylistInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDenylistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder builderForValue) { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = builderForValue.build(); + onChanged(); + } else { + denylistInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDenylistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (denylistInputConfigBuilder_ == null) { + if (denylistInputConfig_ != null) { + denylistInputConfig_ = + com.google.cloud.retail.v2beta.CompletionDataInputConfig.newBuilder( + denylistInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + denylistInputConfig_ = value; + } + onChanged(); + } else { + denylistInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDenylistInputConfig() { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfig_ = null; + onChanged(); + } else { + denylistInputConfig_ = null; + denylistInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder + getDenylistInputConfigBuilder() { + + onChanged(); + return getDenylistInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder() { + if (denylistInputConfigBuilder_ != null) { + return denylistInputConfigBuilder_.getMessageOrBuilder(); + } else { + return denylistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : denylistInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the / autocomplete denylist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + getDenylistInputConfigFieldBuilder() { + if (denylistInputConfigBuilder_ == null) { + denylistInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder>( + getDenylistInputConfig(), getParentForChildren(), isClean()); + denylistInputConfig_ = null; + } + return denylistInputConfigBuilder_; + } + + private java.lang.Object lastDenylistImportOperation_ = ""; + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + public java.lang.String getLastDenylistImportOperation() { + java.lang.Object ref = lastDenylistImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastDenylistImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + public com.google.protobuf.ByteString getLastDenylistImportOperationBytes() { + java.lang.Object ref = lastDenylistImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastDenylistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastDenylistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastDenylistImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastDenylistImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastDenylistImportOperation() { + + lastDenylistImportOperation_ = getDefaultInstance().getLastDenylistImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest denylist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastDenylistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastDenylistImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastDenylistImportOperation_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.CompletionDataInputConfig allowlistInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + allowlistInputConfigBuilder_; + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + public boolean hasAllowlistInputConfig() { + return allowlistInputConfigBuilder_ != null || allowlistInputConfig_ != null; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getAllowlistInputConfig() { + if (allowlistInputConfigBuilder_ == null) { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } else { + return allowlistInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllowlistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (allowlistInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allowlistInputConfig_ = value; + onChanged(); + } else { + allowlistInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllowlistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder builderForValue) { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = builderForValue.build(); + onChanged(); + } else { + allowlistInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAllowlistInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (allowlistInputConfigBuilder_ == null) { + if (allowlistInputConfig_ != null) { + allowlistInputConfig_ = + com.google.cloud.retail.v2beta.CompletionDataInputConfig.newBuilder( + allowlistInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + allowlistInputConfig_ = value; + } + onChanged(); + } else { + allowlistInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAllowlistInputConfig() { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfig_ = null; + onChanged(); + } else { + allowlistInputConfig_ = null; + allowlistInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder + getAllowlistInputConfigBuilder() { + + onChanged(); + return getAllowlistInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder() { + if (allowlistInputConfigBuilder_ != null) { + return allowlistInputConfigBuilder_.getMessageOrBuilder(); + } else { + return allowlistInputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : allowlistInputConfig_; + } + } + /** + * + * + *
+     * Output only. The input config for the import of the source data that
+     * contains the autocomplete allowlist phrases uploaded by the customer.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + getAllowlistInputConfigFieldBuilder() { + if (allowlistInputConfigBuilder_ == null) { + allowlistInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder>( + getAllowlistInputConfig(), getParentForChildren(), isClean()); + allowlistInputConfig_ = null; + } + return allowlistInputConfigBuilder_; + } + + private java.lang.Object lastAllowlistImportOperation_ = ""; + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + public java.lang.String getLastAllowlistImportOperation() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastAllowlistImportOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + public com.google.protobuf.ByteString getLastAllowlistImportOperationBytes() { + java.lang.Object ref = lastAllowlistImportOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAllowlistImportOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lastAllowlistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastAllowlistImportOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastAllowlistImportOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLastAllowlistImportOperation() { + + lastAllowlistImportOperation_ = getDefaultInstance().getLastAllowlistImportOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. LRO corresponding to the latest allowlist import.
+     * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+     * retrieve the latest state of the Long Running Operation.
+     * 
+ * + * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for lastAllowlistImportOperation to set. + * @return This builder for chaining. + */ + public Builder setLastAllowlistImportOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastAllowlistImportOperation_ = 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.CompletionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompletionConfig) + private static final com.google.cloud.retail.v2beta.CompletionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CompletionConfig(); + } + + public static com.google.cloud.retail.v2beta.CompletionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionConfig(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.CompletionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigName.java new file mode 100644 index 00000000..ca975a3d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigName.java @@ -0,0 +1,223 @@ +/* + * 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 CompletionConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + + @Deprecated + protected CompletionConfigName() { + project = null; + location = null; + catalog = null; + } + + private CompletionConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CompletionConfigName of(String project, String location, String catalog) { + return newBuilder().setProject(project).setLocation(location).setCatalog(catalog).build(); + } + + public static String format(String project, String location, String catalog) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .build() + .toString(); + } + + public static CompletionConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG.validatedMatch( + formattedString, "CompletionConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("catalog")); + } + + 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 (CompletionConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG.instantiate( + "project", project, "location", location, "catalog", catalog); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CompletionConfigName that = ((CompletionConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog); + } + 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); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig. */ + public static class Builder { + private String project; + private String location; + private String catalog; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + 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; + } + + private Builder(CompletionConfigName completionConfigName) { + this.project = completionConfigName.project; + this.location = completionConfigName.location; + this.catalog = completionConfigName.catalog; + } + + public CompletionConfigName build() { + return new CompletionConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigOrBuilder.java new file mode 100644 index 00000000..81ee10b2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionConfigOrBuilder.java @@ -0,0 +1,372 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface CompletionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompletionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Immutable. Fully qualified name
+   * `projects/*/locations/*/catalogs/*/completionConfig`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The matchingOrder. + */ + java.lang.String getMatchingOrder(); + /** + * + * + *
+   * Specifies the matching order for autocomplete suggestions, e.g., a query
+   * consisting of 'sh' with 'out-of-order' specified would suggest "women's
+   * shoes", whereas a query of 'red s' with 'exact-prefix' specified would
+   * suggest "red shoes". Currently supported values:
+   * * 'out-of-order'
+   * * 'exact-prefix'
+   * Default value: 'exact-prefix'.
+   * 
+ * + * string matching_order = 2; + * + * @return The bytes for matchingOrder. + */ + com.google.protobuf.ByteString getMatchingOrderBytes(); + + /** + * + * + *
+   * The maximum number of autocomplete suggestions returned per term. The
+   * maximum allowed max suggestions is 20. Default value is 20. If left unset
+   * or set to 0, then will fallback to default value.
+   * 
+ * + * int32 max_suggestions = 3; + * + * @return The maxSuggestions. + */ + int getMaxSuggestions(); + + /** + * + * + *
+   * The minimum number of characters needed to be typed in order to get
+   * suggestions. Default value is 2. If left unset or set to 0, then will
+   * fallback to default value.
+   * 
+ * + * int32 min_prefix_length = 4; + * + * @return The minPrefixLength. + */ + int getMinPrefixLength(); + + /** + * + * + *
+   * If set to true, the auto learning function is enabled. Auto learning uses
+   * user data to generate suggestions using ML techniques. Default value is
+   * false. Only after enabling auto learning can users use `cloud-retail`
+   * data in
+   * [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
+   * 
+ * + * bool auto_learning = 11; + * + * @return The autoLearning. + */ + boolean getAutoLearning(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the suggestionsInputConfig field is set. + */ + boolean hasSuggestionsInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The suggestionsInputConfig. + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfig getSuggestionsInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig suggestions_input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getSuggestionsInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastSuggestionsImportOperation. + */ + java.lang.String getLastSuggestionsImportOperation(); + /** + * + * + *
+   * Output only. Name of the LRO corresponding to the latest suggestion terms
+   * list import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * + * string last_suggestions_import_operation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastSuggestionsImportOperation. + */ + com.google.protobuf.ByteString getLastSuggestionsImportOperationBytes(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the denylistInputConfig field is set. + */ + boolean hasDenylistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The denylistInputConfig. + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfig getDenylistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the / autocomplete denylist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig denylist_input_config = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getDenylistInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastDenylistImportOperation. + */ + java.lang.String getLastDenylistImportOperation(); + /** + * + * + *
+   * Output only. LRO corresponding to the latest denylist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_denylist_import_operation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastDenylistImportOperation. + */ + com.google.protobuf.ByteString getLastDenylistImportOperationBytes(); + + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the allowlistInputConfig field is set. + */ + boolean hasAllowlistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowlistInputConfig. + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfig getAllowlistInputConfig(); + /** + * + * + *
+   * Output only. The input config for the import of the source data that
+   * contains the autocomplete allowlist phrases uploaded by the customer.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig allowlist_input_config = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getAllowlistInputConfigOrBuilder(); + + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastAllowlistImportOperation. + */ + java.lang.String getLastAllowlistImportOperation(); + /** + * + * + *
+   * Output only. LRO corresponding to the latest allowlist import.
+   * Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
+   * retrieve the latest state of the Long Running Operation.
+   * 
+ * + * string last_allowlist_import_operation = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for lastAllowlistImportOperation. + */ + com.google.protobuf.ByteString getLastAllowlistImportOperationBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfig.java new file mode 100644 index 00000000..af51a61e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfig.java @@ -0,0 +1,899 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The input config source for completion data.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionDataInputConfig} + */ +public final class CompletionDataInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompletionDataInputConfig) + CompletionDataInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDataInputConfig.newBuilder() to construct. + private CompletionDataInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDataInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDataInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDataInputConfig( + 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.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.retail.v2beta.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.class, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIG_QUERY_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + 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.CompletionDataInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompletionDataInputConfig other = + (com.google.cloud.retail.v2beta.CompletionDataInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig 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.CompletionDataInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig 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.CompletionDataInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig 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.CompletionDataInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig 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.CompletionDataInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig 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.CompletionDataInputConfig 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.CompletionDataInputConfig 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.CompletionDataInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for completion data.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionDataInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompletionDataInputConfig) + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.class, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CompletionDataInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig build() { + com.google.cloud.retail.v2beta.CompletionDataInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig buildPartial() { + com.google.cloud.retail.v2beta.CompletionDataInputConfig result = + new com.google.cloud.retail.v2beta.CompletionDataInputConfig(this); + if (sourceCase_ == 1) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.CompletionDataInputConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.CompletionDataInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CompletionDataInputConfig other) { + if (other == com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.CompletionDataInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CompletionDataInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2beta.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2beta.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 1) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2beta.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @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.CompletionDataInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompletionDataInputConfig) + private static final com.google.cloud.retail.v2beta.CompletionDataInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CompletionDataInputConfig(); + } + + public static com.google.cloud.retail.v2beta.CompletionDataInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDataInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDataInputConfig(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.CompletionDataInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfigOrBuilder.java new file mode 100644 index 00000000..e66b8026 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDataInputConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface CompletionDataInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompletionDataInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2beta.CompletionDataInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetail.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetail.java new file mode 100644 index 00000000..56c2e662 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetail.java @@ -0,0 +1,932 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Detailed completion information including completion attribution token and
+ * clicked completion info.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionDetail} + */ +public final class CompletionDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CompletionDetail) + CompletionDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionDetail.newBuilder() to construct. + private CompletionDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionDetail() { + completionAttributionToken_ = ""; + selectedSuggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompletionDetail( + 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(); + + completionAttributionToken_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + selectedSuggestion_ = s; + break; + } + case 24: + { + selectedPosition_ = input.readInt32(); + 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.UserEventProto + .internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionDetail.class, + com.google.cloud.retail.v2beta.CompletionDetail.Builder.class); + } + + public static final int COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object completionAttributionToken_; + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + @java.lang.Override + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + 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(); + completionAttributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_SUGGESTION_FIELD_NUMBER = 2; + private volatile java.lang.Object selectedSuggestion_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + @java.lang.Override + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + 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(); + selectedSuggestion_ = s; + return s; + } + } + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SELECTED_POSITION_FIELD_NUMBER = 3; + private int selectedPosition_; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + + 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(completionAttributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, completionAttributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedSuggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + output.writeInt32(3, selectedPosition_); + } + 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(completionAttributionToken_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(1, completionAttributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedSuggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, selectedPosition_); + } + 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.CompletionDetail)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CompletionDetail other = + (com.google.cloud.retail.v2beta.CompletionDetail) obj; + + if (!getCompletionAttributionToken().equals(other.getCompletionAttributionToken())) + return false; + if (!getSelectedSuggestion().equals(other.getSelectedSuggestion())) return false; + if (getSelectedPosition() != other.getSelectedPosition()) 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) + COMPLETION_ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getCompletionAttributionToken().hashCode(); + hash = (37 * hash) + SELECTED_SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedSuggestion().hashCode(); + hash = (37 * hash) + SELECTED_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedPosition(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CompletionDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail 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.CompletionDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail 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.CompletionDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail 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.CompletionDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail 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.CompletionDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail 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.CompletionDetail 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.CompletionDetail 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.CompletionDetail 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; + } + /** + * + * + *
+   * Detailed completion information including completion attribution token and
+   * clicked completion info.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CompletionDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CompletionDetail) + com.google.cloud.retail.v2beta.CompletionDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_CompletionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CompletionDetail.class, + com.google.cloud.retail.v2beta.CompletionDetail.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CompletionDetail.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(); + completionAttributionToken_ = ""; + + selectedSuggestion_ = ""; + + selectedPosition_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDetail getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CompletionDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDetail build() { + com.google.cloud.retail.v2beta.CompletionDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDetail buildPartial() { + com.google.cloud.retail.v2beta.CompletionDetail result = + new com.google.cloud.retail.v2beta.CompletionDetail(this); + result.completionAttributionToken_ = completionAttributionToken_; + result.selectedSuggestion_ = selectedSuggestion_; + result.selectedPosition_ = selectedPosition_; + 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.CompletionDetail) { + return mergeFrom((com.google.cloud.retail.v2beta.CompletionDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CompletionDetail other) { + if (other == com.google.cloud.retail.v2beta.CompletionDetail.getDefaultInstance()) + return this; + if (!other.getCompletionAttributionToken().isEmpty()) { + completionAttributionToken_ = other.completionAttributionToken_; + onChanged(); + } + if (!other.getSelectedSuggestion().isEmpty()) { + selectedSuggestion_ = other.selectedSuggestion_; + onChanged(); + } + if (other.getSelectedPosition() != 0) { + setSelectedPosition(other.getSelectedPosition()); + } + 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.CompletionDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.CompletionDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object completionAttributionToken_ = ""; + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + public java.lang.String getCompletionAttributionToken() { + java.lang.Object ref = completionAttributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + completionAttributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + public com.google.protobuf.ByteString getCompletionAttributionTokenBytes() { + java.lang.Object ref = completionAttributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + completionAttributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + completionAttributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompletionAttributionToken() { + + completionAttributionToken_ = getDefaultInstance().getCompletionAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Completion attribution token in
+     * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+     * 
+ * + * string completion_attribution_token = 1; + * + * @param value The bytes for completionAttributionToken to set. + * @return This builder for chaining. + */ + public Builder setCompletionAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + completionAttributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object selectedSuggestion_ = ""; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + public java.lang.String getSelectedSuggestion() { + java.lang.Object ref = selectedSuggestion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selectedSuggestion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + public com.google.protobuf.ByteString getSelectedSuggestionBytes() { + java.lang.Object ref = selectedSuggestion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selectedSuggestion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + selectedSuggestion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @return This builder for chaining. + */ + public Builder clearSelectedSuggestion() { + + selectedSuggestion_ = getDefaultInstance().getSelectedSuggestion(); + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+     * 
+ * + * string selected_suggestion = 2; + * + * @param value The bytes for selectedSuggestion to set. + * @return This builder for chaining. + */ + public Builder setSelectedSuggestionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + selectedSuggestion_ = value; + onChanged(); + return this; + } + + private int selectedPosition_; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @param value The selectedPosition to set. + * @return This builder for chaining. + */ + public Builder setSelectedPosition(int value) { + + selectedPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 3; + * + * @return This builder for chaining. + */ + public Builder clearSelectedPosition() { + + selectedPosition_ = 0; + 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.CompletionDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CompletionDetail) + private static final com.google.cloud.retail.v2beta.CompletionDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CompletionDetail(); + } + + public static com.google.cloud.retail.v2beta.CompletionDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompletionDetail(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.CompletionDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetailOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetailOrBuilder.java new file mode 100644 index 00000000..ad0154cb --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionDetailOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +public interface CompletionDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CompletionDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The completionAttributionToken. + */ + java.lang.String getCompletionAttributionToken(); + /** + * + * + *
+   * Completion attribution token in
+   * [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token].
+   * 
+ * + * string completion_attribution_token = 1; + * + * @return The bytes for completionAttributionToken. + */ + com.google.protobuf.ByteString getCompletionAttributionTokenBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The selectedSuggestion. + */ + java.lang.String getSelectedSuggestion(); + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion].
+   * 
+ * + * string selected_suggestion = 2; + * + * @return The bytes for selectedSuggestion. + */ + com.google.protobuf.ByteString getSelectedSuggestionBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 3; + * + * @return The selectedPosition. + */ + int getSelectedPosition(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceProto.java new file mode 100644 index 00000000..7b78b28e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceProto.java @@ -0,0 +1,192 @@ +/* + * 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/completion_service.proto + +package com.google.cloud.retail.v2beta; + +public final class CompletionServiceProto { + private CompletionServiceProto() {} + + 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_CompleteQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/retail/v2beta/completion_" + + "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/resource.proto\032\'go" + + "ogle/cloud/retail/v2beta/common.proto\032.g" + + "oogle/cloud/retail/v2beta/import_config." + + "proto\032#google/longrunning/operations.pro" + + "to\"\315\001\n\024CompleteQueryRequest\0226\n\007catalog\030\001" + + " \001(\tB%\340A\002\372A\037\n\035retail.googleapis.com/Cata" + + "log\022\022\n\005query\030\002 \001(\tB\003\340A\002\022\022\n\nvisitor_id\030\007 " + + "\001(\t\022\026\n\016language_codes\030\003 \003(\t\022\023\n\013device_ty" + + "pe\030\004 \001(\t\022\017\n\007dataset\030\006 \001(\t\022\027\n\017max_suggest" + + "ions\030\005 \001(\005\"\225\004\n\025CompleteQueryResponse\022^\n\022" + + "completion_results\030\001 \003(\0132B.google.cloud." + + "retail.v2beta.CompleteQueryResponse.Comp" + + "letionResult\022\031\n\021attribution_token\030\002 \001(\t\022" + + "c\n\025recent_search_results\030\003 \003(\0132D.google." + + "cloud.retail.v2beta.CompleteQueryRespons" + + "e.RecentSearchResult\032\356\001\n\020CompletionResul" + + "t\022\022\n\nsuggestion\030\001 \001(\t\022f\n\nattributes\030\002 \003(" + + "\0132R.google.cloud.retail.v2beta.CompleteQ" + + "ueryResponse.CompletionResult.Attributes" + + "Entry\032^\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\022:\n" + + "\005value\030\002 \001(\0132+.google.cloud.retail.v2bet" + + "a.CustomAttribute:\0028\001\032+\n\022RecentSearchRes" + + "ult\022\025\n\rrecent_search\030\001 \001(\t2\316\004\n\021Completio" + + "nService\022\277\001\n\rCompleteQuery\0220.google.clou" + + "d.retail.v2beta.CompleteQueryRequest\0321.g" + + "oogle.cloud.retail.v2beta.CompleteQueryR" + + "esponse\"I\202\323\344\223\002C\022A/v2beta/{catalog=projec" + + "ts/*/locations/*/catalogs/*}:completeQue" + + "ry\022\253\002\n\024ImportCompletionData\0227.google.clo" + + "ud.retail.v2beta.ImportCompletionDataReq" + + "uest\032\035.google.longrunning.Operation\"\272\001\202\323" + + "\344\223\002M\"H/v2beta/{parent=projects/*/locatio" + + "ns/*/catalogs/*}/completionData:import:\001" + + "*\312Ad\n7google.cloud.retail.v2beta.ImportC" + + "ompletionDataResponse\022)google.cloud.reta" + + "il.v2beta.ImportMetadata\032I\312A\025retail.goog" + + "leapis.com\322A.https://www.googleapis.com/" + + "auth/cloud-platformB\337\001\n\036com.google.cloud" + + ".retail.v2betaB\026CompletionServiceProtoP\001" + + "Z@google.golang.org/genproto/googleapis/" + + "cloud/retail/v2beta;retail\242\002\006RETAIL\252\002\032Go" + + "ogle.Cloud.Retail.V2Beta\312\002\032Google\\Cloud\\" + + "Retail\\V2beta\352\002\035Google::Cloud::Retail::V" + + "2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompleteQueryRequest_descriptor, + new java.lang.String[] { + "Catalog", + "Query", + "VisitorId", + "LanguageCodes", + "DeviceType", + "Dataset", + "MaxSuggestions", + }); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor, + new java.lang.String[] { + "CompletionResults", "AttributionToken", "RecentSearchResults", + }); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor = + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor, + new java.lang.String[] { + "Suggestion", "Attributes", + }); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_CompletionResult_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor = + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompleteQueryResponse_RecentSearchResult_descriptor, + new java.lang.String[] { + "RecentSearch", + }); + 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.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.CommonProto.getDescriptor(); + com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java new file mode 100644 index 00000000..e5c7150c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java @@ -0,0 +1,3431 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata that is used to define a condition that triggers an action.
+ * A valid condition must specify at least one of 'query_terms' or
+ * 'products_filter'. If multiple fields are specified, the condition is met if
+ * all the fields are satisfied e.g. if a set of query terms and product_filter
+ * are set, then only items matching the product_filter for requests with a
+ * query matching the query terms wil get boosted.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition} + */ +public final class Condition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Condition) + ConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Condition.newBuilder() to construct. + private Condition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Condition() { + queryTerms_ = java.util.Collections.emptyList(); + activeTimeRange_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Condition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Condition( + 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)) { + queryTerms_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Condition.QueryTerm.parser(), + extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + activeTimeRange_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Condition.TimeRange.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)) { + queryTerms_ = java.util.Collections.unmodifiableList(queryTerms_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = java.util.Collections.unmodifiableList(activeTimeRange_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.class, + com.google.cloud.retail.v2beta.Condition.Builder.class); + } + + public interface QueryTermOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Condition.QueryTerm) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+     * Whether this is supposed to be a full or partial match.
+     * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + boolean getFullMatch(); + } + /** + * + * + *
+   * Query terms that we want to match on.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition.QueryTerm} + */ + public static final class QueryTerm extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Condition.QueryTerm) + QueryTermOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryTerm.newBuilder() to construct. + private QueryTerm(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryTerm() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryTerm(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryTerm( + 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(); + + value_ = s; + break; + } + case 16: + { + fullMatch_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.QueryTerm.class, + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * The value of the term to match on.
+     * 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.
+     * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULL_MATCH_FIELD_NUMBER = 2; + private boolean fullMatch_; + /** + * + * + *
+     * Whether this is supposed to be a full or partial match.
+     * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + @java.lang.Override + public boolean getFullMatch() { + return fullMatch_; + } + + 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(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + if (fullMatch_ != false) { + output.writeBool(2, fullMatch_); + } + 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(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + if (fullMatch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, fullMatch_); + } + 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.Condition.QueryTerm)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Condition.QueryTerm other = + (com.google.cloud.retail.v2beta.Condition.QueryTerm) obj; + + if (!getValue().equals(other.getValue())) return false; + if (getFullMatch() != other.getFullMatch()) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + FULL_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFullMatch()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm 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.Condition.QueryTerm parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm 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.Condition.QueryTerm parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm 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.Condition.QueryTerm parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm 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.Condition.QueryTerm parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm 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.Condition.QueryTerm 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.Condition.QueryTerm 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.Condition.QueryTerm 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; + } + /** + * + * + *
+     * Query terms that we want to match on.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition.QueryTerm} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Condition.QueryTerm) + com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.QueryTerm.class, + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Condition.QueryTerm.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(); + value_ = ""; + + fullMatch_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_QueryTerm_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.QueryTerm getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Condition.QueryTerm.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.QueryTerm build() { + com.google.cloud.retail.v2beta.Condition.QueryTerm result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.QueryTerm buildPartial() { + com.google.cloud.retail.v2beta.Condition.QueryTerm result = + new com.google.cloud.retail.v2beta.Condition.QueryTerm(this); + result.value_ = value_; + result.fullMatch_ = fullMatch_; + 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.Condition.QueryTerm) { + return mergeFrom((com.google.cloud.retail.v2beta.Condition.QueryTerm) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Condition.QueryTerm other) { + if (other == com.google.cloud.retail.v2beta.Condition.QueryTerm.getDefaultInstance()) + return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (other.getFullMatch() != false) { + setFullMatch(other.getFullMatch()); + } + 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.Condition.QueryTerm parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Condition.QueryTerm) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the term to match on.
+       * 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.
+       * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private boolean fullMatch_; + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @return The fullMatch. + */ + @java.lang.Override + public boolean getFullMatch() { + return fullMatch_; + } + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @param value The fullMatch to set. + * @return This builder for chaining. + */ + public Builder setFullMatch(boolean value) { + + fullMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether this is supposed to be a full or partial match.
+       * 
+ * + * bool full_match = 2; + * + * @return This builder for chaining. + */ + public Builder clearFullMatch() { + + fullMatch_ = 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.Condition.QueryTerm) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Condition.QueryTerm) + private static final com.google.cloud.retail.v2beta.Condition.QueryTerm DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Condition.QueryTerm(); + } + + public static com.google.cloud.retail.v2beta.Condition.QueryTerm getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryTerm parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryTerm(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.Condition.QueryTerm getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Condition.TimeRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + } + /** + * + * + *
+   * Used for time-dependent conditions.
+   * Example: Want to have rule applied for week long sale.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition.TimeRange} + */ + public static final class TimeRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Condition.TimeRange) + TimeRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeRange.newBuilder() to construct. + private TimeRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeRange( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_TimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.TimeRange.class, + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+     * Start of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+     * End of time range. Range is inclusive.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + 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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + 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.Condition.TimeRange)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Condition.TimeRange other = + (com.google.cloud.retail.v2beta.Condition.TimeRange) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) 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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange 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.Condition.TimeRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange 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.Condition.TimeRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange 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.Condition.TimeRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange 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.Condition.TimeRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange 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.Condition.TimeRange 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.Condition.TimeRange 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.Condition.TimeRange 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; + } + /** + * + * + *
+     * Used for time-dependent conditions.
+     * Example: Want to have rule applied for week long sale.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition.TimeRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Condition.TimeRange) + com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_TimeRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.TimeRange.class, + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Condition.TimeRange.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 (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_TimeRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.TimeRange getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Condition.TimeRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.TimeRange build() { + com.google.cloud.retail.v2beta.Condition.TimeRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.TimeRange buildPartial() { + com.google.cloud.retail.v2beta.Condition.TimeRange result = + new com.google.cloud.retail.v2beta.Condition.TimeRange(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.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.Condition.TimeRange) { + return mergeFrom((com.google.cloud.retail.v2beta.Condition.TimeRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Condition.TimeRange other) { + if (other == com.google.cloud.retail.v2beta.Condition.TimeRange.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + 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.Condition.TimeRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Condition.TimeRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_) + .mergeFrom(value) + .buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + /** + * + * + *
+       * Start of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+       * End of time range. Range is inclusive.
+       * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @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.Condition.TimeRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Condition.TimeRange) + private static final com.google.cloud.retail.v2beta.Condition.TimeRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Condition.TimeRange(); + } + + public static com.google.cloud.retail.v2beta.Condition.TimeRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeRange(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.Condition.TimeRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 1; + private java.util.List queryTerms_; + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public java.util.List getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public java.util.List + getQueryTermsOrBuilderList() { + return queryTerms_; + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.QueryTerm getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder getQueryTermsOrBuilder( + int index) { + return queryTerms_.get(index); + } + + public static final int ACTIVE_TIME_RANGE_FIELD_NUMBER = 3; + private java.util.List activeTimeRange_; + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public java.util.List + getActiveTimeRangeList() { + return activeTimeRange_; + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public java.util.List + getActiveTimeRangeOrBuilderList() { + return activeTimeRange_; + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public int getActiveTimeRangeCount() { + return activeTimeRange_.size(); + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.TimeRange getActiveTimeRange(int index) { + return activeTimeRange_.get(index); + } + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index) { + return activeTimeRange_.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 { + for (int i = 0; i < queryTerms_.size(); i++) { + output.writeMessage(1, queryTerms_.get(i)); + } + for (int i = 0; i < activeTimeRange_.size(); i++) { + output.writeMessage(3, activeTimeRange_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, queryTerms_.get(i)); + } + for (int i = 0; i < activeTimeRange_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, activeTimeRange_.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.Condition)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Condition other = (com.google.cloud.retail.v2beta.Condition) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getActiveTimeRangeList().equals(other.getActiveTimeRangeList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getActiveTimeRangeCount() > 0) { + hash = (37 * hash) + ACTIVE_TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getActiveTimeRangeList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Condition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition 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.Condition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition 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.Condition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Condition 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.Condition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition 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.Condition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Condition 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.Condition 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.Condition 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.Condition 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 is used to define a condition that triggers an action.
+   * A valid condition must specify at least one of 'query_terms' or
+   * 'products_filter'. If multiple fields are specified, the condition is met if
+   * all the fields are satisfied e.g. if a set of query terms and product_filter
+   * are set, then only items matching the product_filter for requests with a
+   * query matching the query terms wil get boosted.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Condition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Condition) + com.google.cloud.retail.v2beta.ConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Condition.class, + com.google.cloud.retail.v2beta.Condition.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Condition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQueryTermsFieldBuilder(); + getActiveTimeRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (queryTermsBuilder_ == null) { + queryTerms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + queryTermsBuilder_.clear(); + } + if (activeTimeRangeBuilder_ == null) { + activeTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + activeTimeRangeBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Condition_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition build() { + com.google.cloud.retail.v2beta.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition buildPartial() { + com.google.cloud.retail.v2beta.Condition result = + new com.google.cloud.retail.v2beta.Condition(this); + int from_bitField0_ = bitField0_; + if (queryTermsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = java.util.Collections.unmodifiableList(queryTerms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + } else { + result.queryTerms_ = queryTermsBuilder_.build(); + } + if (activeTimeRangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = java.util.Collections.unmodifiableList(activeTimeRange_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.activeTimeRange_ = activeTimeRange_; + } else { + result.activeTimeRange_ = activeTimeRangeBuilder_.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.Condition) { + return mergeFrom((com.google.cloud.retail.v2beta.Condition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Condition other) { + if (other == com.google.cloud.retail.v2beta.Condition.getDefaultInstance()) return this; + if (queryTermsBuilder_ == null) { + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + } else { + if (!other.queryTerms_.isEmpty()) { + if (queryTermsBuilder_.isEmpty()) { + queryTermsBuilder_.dispose(); + queryTermsBuilder_ = null; + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + queryTermsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQueryTermsFieldBuilder() + : null; + } else { + queryTermsBuilder_.addAllMessages(other.queryTerms_); + } + } + } + if (activeTimeRangeBuilder_ == null) { + if (!other.activeTimeRange_.isEmpty()) { + if (activeTimeRange_.isEmpty()) { + activeTimeRange_ = other.activeTimeRange_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.addAll(other.activeTimeRange_); + } + onChanged(); + } + } else { + if (!other.activeTimeRange_.isEmpty()) { + if (activeTimeRangeBuilder_.isEmpty()) { + activeTimeRangeBuilder_.dispose(); + activeTimeRangeBuilder_ = null; + activeTimeRange_ = other.activeTimeRange_; + bitField0_ = (bitField0_ & ~0x00000002); + activeTimeRangeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getActiveTimeRangeFieldBuilder() + : null; + } else { + activeTimeRangeBuilder_.addAllMessages(other.activeTimeRange_); + } + } + } + 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.Condition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Condition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List queryTerms_ = + java.util.Collections.emptyList(); + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = + new java.util.ArrayList( + queryTerms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.QueryTerm, + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder> + queryTermsBuilder_; + + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public java.util.List getQueryTermsList() { + if (queryTermsBuilder_ == null) { + return java.util.Collections.unmodifiableList(queryTerms_); + } else { + return queryTermsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public int getQueryTermsCount() { + if (queryTermsBuilder_ == null) { + return queryTerms_.size(); + } else { + return queryTermsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2beta.Condition.QueryTerm getQueryTerms(int index) { + if (queryTermsBuilder_ == null) { + return queryTerms_.get(index); + } else { + return queryTermsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder setQueryTerms( + int index, com.google.cloud.retail.v2beta.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + } else { + queryTermsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder setQueryTerms( + int index, com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.set(index, builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms(com.google.cloud.retail.v2beta.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + } else { + queryTermsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + int index, com.google.cloud.retail.v2beta.Condition.QueryTerm value) { + if (queryTermsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(index, value); + onChanged(); + } else { + queryTermsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.add(builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder addQueryTerms( + int index, com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder builderForValue) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.add(index, builderForValue.build()); + onChanged(); + } else { + queryTermsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder addAllQueryTerms( + java.lang.Iterable values) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + } else { + queryTermsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder clearQueryTerms() { + if (queryTermsBuilder_ == null) { + queryTerms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + queryTermsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public Builder removeQueryTerms(int index) { + if (queryTermsBuilder_ == null) { + ensureQueryTermsIsMutable(); + queryTerms_.remove(index); + onChanged(); + } else { + queryTermsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder getQueryTermsBuilder( + int index) { + return getQueryTermsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder getQueryTermsOrBuilder( + int index) { + if (queryTermsBuilder_ == null) { + return queryTerms_.get(index); + } else { + return queryTermsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public java.util.List + getQueryTermsOrBuilderList() { + if (queryTermsBuilder_ != null) { + return queryTermsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(queryTerms_); + } + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder addQueryTermsBuilder() { + return getQueryTermsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Condition.QueryTerm.getDefaultInstance()); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder addQueryTermsBuilder( + int index) { + return getQueryTermsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.Condition.QueryTerm.getDefaultInstance()); + } + /** + * + * + *
+     * A list (up to 10 entries) of terms to match the query on. If not
+     * specified, match all queries.
+     * If many query terms are specified, the condition
+     * is matched if any of the terms is a match (i.e. using the OR operator).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + public java.util.List + getQueryTermsBuilderList() { + return getQueryTermsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.QueryTerm, + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder> + getQueryTermsFieldBuilder() { + if (queryTermsBuilder_ == null) { + queryTermsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.QueryTerm, + com.google.cloud.retail.v2beta.Condition.QueryTerm.Builder, + com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder>( + queryTerms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + queryTerms_ = null; + } + return queryTermsBuilder_; + } + + private java.util.List activeTimeRange_ = + java.util.Collections.emptyList(); + + private void ensureActiveTimeRangeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + activeTimeRange_ = + new java.util.ArrayList( + activeTimeRange_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.TimeRange, + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder, + com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder> + activeTimeRangeBuilder_; + + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeList() { + if (activeTimeRangeBuilder_ == null) { + return java.util.Collections.unmodifiableList(activeTimeRange_); + } else { + return activeTimeRangeBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public int getActiveTimeRangeCount() { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.size(); + } else { + return activeTimeRangeBuilder_.getCount(); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2beta.Condition.TimeRange getActiveTimeRange(int index) { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.get(index); + } else { + return activeTimeRangeBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder setActiveTimeRange( + int index, com.google.cloud.retail.v2beta.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.set(index, value); + onChanged(); + } else { + activeTimeRangeBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder setActiveTimeRange( + int index, com.google.cloud.retail.v2beta.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.set(index, builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange(com.google.cloud.retail.v2beta.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(value); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + int index, com.google.cloud.retail.v2beta.Condition.TimeRange value) { + if (activeTimeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(index, value); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder addActiveTimeRange( + int index, com.google.cloud.retail.v2beta.Condition.TimeRange.Builder builderForValue) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.add(index, builderForValue.build()); + onChanged(); + } else { + activeTimeRangeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder addAllActiveTimeRange( + java.lang.Iterable values) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, activeTimeRange_); + onChanged(); + } else { + activeTimeRangeBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder clearActiveTimeRange() { + if (activeTimeRangeBuilder_ == null) { + activeTimeRange_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + activeTimeRangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public Builder removeActiveTimeRange(int index) { + if (activeTimeRangeBuilder_ == null) { + ensureActiveTimeRangeIsMutable(); + activeTimeRange_.remove(index); + onChanged(); + } else { + activeTimeRangeBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2beta.Condition.TimeRange.Builder getActiveTimeRangeBuilder( + int index) { + return getActiveTimeRangeFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index) { + if (activeTimeRangeBuilder_ == null) { + return activeTimeRange_.get(index); + } else { + return activeTimeRangeBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeOrBuilderList() { + if (activeTimeRangeBuilder_ != null) { + return activeTimeRangeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(activeTimeRange_); + } + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2beta.Condition.TimeRange.Builder addActiveTimeRangeBuilder() { + return getActiveTimeRangeFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Condition.TimeRange.getDefaultInstance()); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public com.google.cloud.retail.v2beta.Condition.TimeRange.Builder addActiveTimeRangeBuilder( + int index) { + return getActiveTimeRangeFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.Condition.TimeRange.getDefaultInstance()); + } + /** + * + * + *
+     * Range of time(s) specifying when Condition is active.
+     * Condition true if any time range matches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + public java.util.List + getActiveTimeRangeBuilderList() { + return getActiveTimeRangeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.TimeRange, + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder, + com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder> + getActiveTimeRangeFieldBuilder() { + if (activeTimeRangeBuilder_ == null) { + activeTimeRangeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition.TimeRange, + com.google.cloud.retail.v2beta.Condition.TimeRange.Builder, + com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder>( + activeTimeRange_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + activeTimeRange_ = null; + } + return activeTimeRangeBuilder_; + } + + @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.Condition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Condition) + private static final com.google.cloud.retail.v2beta.Condition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Condition(); + } + + public static com.google.cloud.retail.v2beta.Condition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Condition(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.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ConditionOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ConditionOrBuilder.java new file mode 100644 index 00000000..238b81b1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ConditionOrBuilder.java @@ -0,0 +1,150 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface ConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Condition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + com.google.cloud.retail.v2beta.Condition.QueryTerm getQueryTerms(int index); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + int getQueryTermsCount(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + java.util.List + getQueryTermsOrBuilderList(); + /** + * + * + *
+   * A list (up to 10 entries) of terms to match the query on. If not
+   * specified, match all queries.
+   * If many query terms are specified, the condition
+   * is matched if any of the terms is a match (i.e. using the OR operator).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.QueryTerm query_terms = 1; + */ + com.google.cloud.retail.v2beta.Condition.QueryTermOrBuilder getQueryTermsOrBuilder(int index); + + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + java.util.List getActiveTimeRangeList(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + com.google.cloud.retail.v2beta.Condition.TimeRange getActiveTimeRange(int index); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + int getActiveTimeRangeCount(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + java.util.List + getActiveTimeRangeOrBuilderList(); + /** + * + * + *
+   * Range of time(s) specifying when Condition is active.
+   * Condition true if any time range matches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Condition.TimeRange active_time_range = 3; + */ + com.google.cloud.retail.v2beta.Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder( + int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java new file mode 100644 index 00000000..86dce259 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java @@ -0,0 +1,2407 @@ +/* + * 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/control.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Configures dynamic serving time metadata that is used to pre and post
+ * process search/recommendation model results.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Control} + */ +public final class Control extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Control) + ControlOrBuilder { + private static final long serialVersionUID = 0L; + // Use Control.newBuilder() to construct. + private Control(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Control() { + name_ = ""; + displayName_ = ""; + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + solutionTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Control(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Control( + 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 26: + { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder subBuilder = null; + if (controlCase_ == 3) { + subBuilder = + ((com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_).toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_); + control_ = subBuilder.buildPartial(); + } + controlCase_ = 3; + break; + } + case 34: + { + com.google.cloud.retail.v2beta.Rule.Builder subBuilder = null; + if (controlCase_ == 4) { + subBuilder = ((com.google.cloud.retail.v2beta.Rule) control_).toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Rule) control_); + control_ = subBuilder.buildPartial(); + } + controlCase_ = 4; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + associatedServingConfigIds_.add(s); + break; + } + case 48: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + solutionTypes_.add(rawValue); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + solutionTypes_.add(rawValue); + } + input.popLimit(oldLimit); + 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)) { + associatedServingConfigIds_ = associatedServingConfigIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlProto + .internal_static_google_cloud_retail_v2beta_Control_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlProto + .internal_static_google_cloud_retail_v2beta_Control_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Control.class, + com.google.cloud.retail.v2beta.Control.Builder.class); + } + + private int controlCase_ = 0; + private java.lang.Object control_; + + public enum ControlCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FACET_SPEC(3), + RULE(4), + CONTROL_NOT_SET(0); + private final int value; + + private ControlCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ControlCase valueOf(int value) { + return forNumber(value); + } + + public static ControlCase forNumber(int value) { + switch (value) { + case 3: + return FACET_SPEC; + case 4: + return RULE; + case 0: + return CONTROL_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ControlCase getControlCase() { + return ControlCase.forNumber(controlCase_); + } + + public static final int FACET_SPEC_FIELD_NUMBER = 3; + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + @java.lang.Override + public boolean hasFacetSpec() { + return controlCase_ == 3; + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder() { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + + public static final int RULE_FIELD_NUMBER = 4; + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return controlCase_ == 4; + } + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule getRule() { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2beta.Rule) control_; + } + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RuleOrBuilder getRuleOrBuilder() { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2beta.Rule) control_; + } + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * 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 human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * 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 ASSOCIATED_SERVING_CONFIG_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList associatedServingConfigIds_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList() { + return associatedServingConfigIds_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + public int getAssociatedServingConfigIdsCount() { + return associatedServingConfigIds_.size(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + public java.lang.String getAssociatedServingConfigIds(int index) { + return associatedServingConfigIds_.get(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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(int index) { + return associatedServingConfigIds_.getByteString(index); + } + + public static final int SOLUTION_TYPES_FIELD_NUMBER = 6; + private java.util.List solutionTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType> + solutionTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>() { + public com.google.cloud.retail.v2beta.SolutionType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SolutionType result = + com.google.cloud.retail.v2beta.SolutionType.valueOf(from); + return result == null + ? com.google.cloud.retail.v2beta.SolutionType.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + @java.lang.Override + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesValueList() { + return solutionTypes_; + } + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + @java.lang.Override + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(index); + } + + private int solutionTypesMemoizedSerializedSize; + + 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 { + getSerializedSize(); + 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 (controlCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_); + } + if (controlCase_ == 4) { + output.writeMessage(4, (com.google.cloud.retail.v2beta.Rule) control_); + } + for (int i = 0; i < associatedServingConfigIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 5, associatedServingConfigIds_.getRaw(i)); + } + if (getSolutionTypesList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(solutionTypesMemoizedSerializedSize); + } + for (int i = 0; i < solutionTypes_.size(); i++) { + output.writeEnumNoTag(solutionTypes_.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 (controlCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_); + } + if (controlCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.retail.v2beta.Rule) control_); + } + { + int dataSize = 0; + for (int i = 0; i < associatedServingConfigIds_.size(); i++) { + dataSize += computeStringSizeNoTag(associatedServingConfigIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAssociatedServingConfigIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < solutionTypes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(solutionTypes_.get(i)); + } + size += dataSize; + if (!getSolutionTypesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + solutionTypesMemoizedSerializedSize = dataSize; + } + 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.Control)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Control other = (com.google.cloud.retail.v2beta.Control) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getAssociatedServingConfigIdsList().equals(other.getAssociatedServingConfigIdsList())) + return false; + if (!solutionTypes_.equals(other.solutionTypes_)) return false; + if (!getControlCase().equals(other.getControlCase())) return false; + switch (controlCase_) { + case 3: + if (!getFacetSpec().equals(other.getFacetSpec())) return false; + break; + case 4: + if (!getRule().equals(other.getRule())) return false; + break; + case 0: + default: + } + 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(); + if (getAssociatedServingConfigIdsCount() > 0) { + hash = (37 * hash) + ASSOCIATED_SERVING_CONFIG_IDS_FIELD_NUMBER; + hash = (53 * hash) + getAssociatedServingConfigIdsList().hashCode(); + } + if (getSolutionTypesCount() > 0) { + hash = (37 * hash) + SOLUTION_TYPES_FIELD_NUMBER; + hash = (53 * hash) + solutionTypes_.hashCode(); + } + switch (controlCase_) { + case 3: + hash = (37 * hash) + FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpec().hashCode(); + break; + case 4: + hash = (37 * hash) + RULE_FIELD_NUMBER; + hash = (53 * hash) + getRule().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Control parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Control 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.Control parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Control 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.Control parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Control 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.Control parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Control 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.Control parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Control 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.Control 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.Control 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.Control 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; + } + /** + * + * + *
+   * Configures dynamic serving time metadata that is used to pre and post
+   * process search/recommendation model results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Control} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Control) + com.google.cloud.retail.v2beta.ControlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlProto + .internal_static_google_cloud_retail_v2beta_Control_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlProto + .internal_static_google_cloud_retail_v2beta_Control_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Control.class, + com.google.cloud.retail.v2beta.Control.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Control.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_ = ""; + + displayName_ = ""; + + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + controlCase_ = 0; + control_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ControlProto + .internal_static_google_cloud_retail_v2beta_Control_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Control getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Control.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Control build() { + com.google.cloud.retail.v2beta.Control result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Control buildPartial() { + com.google.cloud.retail.v2beta.Control result = + new com.google.cloud.retail.v2beta.Control(this); + int from_bitField0_ = bitField0_; + if (controlCase_ == 3) { + if (facetSpecBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = facetSpecBuilder_.build(); + } + } + if (controlCase_ == 4) { + if (ruleBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = ruleBuilder_.build(); + } + } + result.name_ = name_; + result.displayName_ = displayName_; + if (((bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = associatedServingConfigIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.associatedServingConfigIds_ = associatedServingConfigIds_; + if (((bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.solutionTypes_ = solutionTypes_; + result.controlCase_ = controlCase_; + 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.Control) { + return mergeFrom((com.google.cloud.retail.v2beta.Control) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Control other) { + if (other == com.google.cloud.retail.v2beta.Control.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.associatedServingConfigIds_.isEmpty()) { + if (associatedServingConfigIds_.isEmpty()) { + associatedServingConfigIds_ = other.associatedServingConfigIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.addAll(other.associatedServingConfigIds_); + } + onChanged(); + } + if (!other.solutionTypes_.isEmpty()) { + if (solutionTypes_.isEmpty()) { + solutionTypes_ = other.solutionTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSolutionTypesIsMutable(); + solutionTypes_.addAll(other.solutionTypes_); + } + onChanged(); + } + switch (other.getControlCase()) { + case FACET_SPEC: + { + mergeFacetSpec(other.getFacetSpec()); + break; + } + case RULE: + { + mergeRule(other.getRule()); + break; + } + case CONTROL_NOT_SET: + { + break; + } + } + 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.Control parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Control) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int controlCase_ = 0; + private java.lang.Object control_; + + public ControlCase getControlCase() { + return ControlCase.forNumber(controlCase_); + } + + public Builder clearControl() { + controlCase_ = 0; + control_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder> + facetSpecBuilder_; + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + @java.lang.Override + public boolean hasFacetSpec() { + return controlCase_ == 3; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } else { + if (controlCase_ == 3) { + return facetSpecBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder setFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { + if (facetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + facetSpecBuilder_.setMessage(value); + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder setFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + facetSpecBuilder_.setMessage(builderForValue.build()); + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder mergeFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3 + && control_ + != com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance()) { + control_ = + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.newBuilder( + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + if (controlCase_ == 3) { + facetSpecBuilder_.mergeFrom(value); + } else { + facetSpecBuilder_.setMessage(value); + } + } + controlCase_ = 3; + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + public Builder clearFacetSpec() { + if (facetSpecBuilder_ == null) { + if (controlCase_ == 3) { + controlCase_ = 0; + control_ = null; + onChanged(); + } + } else { + if (controlCase_ == 3) { + controlCase_ = 0; + control_ = null; + } + facetSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder getFacetSpecBuilder() { + return getFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder() { + if ((controlCase_ == 3) && (facetSpecBuilder_ != null)) { + return facetSpecBuilder_.getMessageOrBuilder(); + } else { + if (controlCase_ == 3) { + return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; + } + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder> + getFacetSpecFieldBuilder() { + if (facetSpecBuilder_ == null) { + if (!(controlCase_ == 3)) { + control_ = com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + facetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder>( + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_, + getParentForChildren(), + isClean()); + control_ = null; + } + controlCase_ = 3; + onChanged(); + ; + return facetSpecBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule, + com.google.cloud.retail.v2beta.Rule.Builder, + com.google.cloud.retail.v2beta.RuleOrBuilder> + ruleBuilder_; + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + @java.lang.Override + public boolean hasRule() { + return controlCase_ == 4; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return The rule. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule getRule() { + if (ruleBuilder_ == null) { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2beta.Rule) control_; + } + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } else { + if (controlCase_ == 4) { + return ruleBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + public Builder setRule(com.google.cloud.retail.v2beta.Rule value) { + if (ruleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + ruleBuilder_.setMessage(value); + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + public Builder setRule(com.google.cloud.retail.v2beta.Rule.Builder builderForValue) { + if (ruleBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + ruleBuilder_.setMessage(builderForValue.build()); + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + public Builder mergeRule(com.google.cloud.retail.v2beta.Rule value) { + if (ruleBuilder_ == null) { + if (controlCase_ == 4 + && control_ != com.google.cloud.retail.v2beta.Rule.getDefaultInstance()) { + control_ = + com.google.cloud.retail.v2beta.Rule.newBuilder( + (com.google.cloud.retail.v2beta.Rule) control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + if (controlCase_ == 4) { + ruleBuilder_.mergeFrom(value); + } else { + ruleBuilder_.setMessage(value); + } + } + controlCase_ = 4; + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + public Builder clearRule() { + if (ruleBuilder_ == null) { + if (controlCase_ == 4) { + controlCase_ = 0; + control_ = null; + onChanged(); + } + } else { + if (controlCase_ == 4) { + controlCase_ = 0; + control_ = null; + } + ruleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + public com.google.cloud.retail.v2beta.Rule.Builder getRuleBuilder() { + return getRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RuleOrBuilder getRuleOrBuilder() { + if ((controlCase_ == 4) && (ruleBuilder_ != null)) { + return ruleBuilder_.getMessageOrBuilder(); + } else { + if (controlCase_ == 4) { + return (com.google.cloud.retail.v2beta.Rule) control_; + } + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule control - a condition-action pair.
+     * Enacts a set action when the condition is triggered.
+     * For example: Boost "gShoe" when query full matches "Running Shoes".
+     * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule, + com.google.cloud.retail.v2beta.Rule.Builder, + com.google.cloud.retail.v2beta.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + if (!(controlCase_ == 4)) { + control_ = com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + ruleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule, + com.google.cloud.retail.v2beta.Rule.Builder, + com.google.cloud.retail.v2beta.RuleOrBuilder>( + (com.google.cloud.retail.v2beta.Rule) control_, getParentForChildren(), isClean()); + control_ = null; + } + controlCase_ = 4; + onChanged(); + ; + return ruleBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/controls/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 human readable control display name. Used in Retail UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * 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 com.google.protobuf.LazyStringList associatedServingConfigIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAssociatedServingConfigIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + associatedServingConfigIds_ = + new com.google.protobuf.LazyStringArrayList(associatedServingConfigIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList() { + return associatedServingConfigIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + public int getAssociatedServingConfigIdsCount() { + return associatedServingConfigIds_.size(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + public java.lang.String getAssociatedServingConfigIds(int index) { + return associatedServingConfigIds_.get(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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(int index) { + return associatedServingConfigIds_.getByteString(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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The associatedServingConfigIds to set. + * @return This builder for chaining. + */ + public Builder setAssociatedServingConfigIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAssociatedServingConfigIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAllAssociatedServingConfigIds(java.lang.Iterable values) { + ensureAssociatedServingConfigIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, associatedServingConfigIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAssociatedServingConfigIds() { + associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the associatedServingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAssociatedServingConfigIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAssociatedServingConfigIdsIsMutable(); + associatedServingConfigIds_.add(value); + onChanged(); + return this; + } + + private java.util.List solutionTypes_ = java.util.Collections.emptyList(); + + private void ensureSolutionTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + solutionTypes_ = new java.util.ArrayList(solutionTypes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(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.
+     * 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index to set the value at. + * @param value The solutionTypes to set. + * @return This builder for chaining. + */ + public Builder setSolutionTypes(int index, com.google.cloud.retail.v2beta.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypes(com.google.cloud.retail.v2beta.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypes( + java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (com.google.cloud.retail.v2beta.SolutionType value : values) { + solutionTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearSolutionTypes() { + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + public java.util.List getSolutionTypesValueList() { + return java.util.Collections.unmodifiableList(solutionTypes_); + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(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.
+     * 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + * @return This builder for chaining. + */ + public Builder setSolutionTypesValue(int index, int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypesValue(int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The solution types that the serving config 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.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The enum numeric values on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypesValue(java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (int value : values) { + solutionTypes_.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.Control) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Control) + private static final com.google.cloud.retail.v2beta.Control DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Control(); + } + + public static com.google.cloud.retail.v2beta.Control getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Control parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Control(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.Control getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlName.java new file mode 100644 index 00000000..10ebc5a3 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlName.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 ControlName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_CONTROL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String control; + + @Deprecated + protected ControlName() { + project = null; + location = null; + catalog = null; + control = null; + } + + private ControlName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + control = Preconditions.checkNotNull(builder.getControl()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getControl() { + return control; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ControlName of(String project, String location, String catalog, String control) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setControl(control) + .build(); + } + + public static String format(String project, String location, String catalog, String control) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setControl(control) + .build() + .toString(); + } + + public static ControlName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_CONTROL.validatedMatch( + formattedString, "ControlName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("control")); + } + + 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 (ControlName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_CONTROL.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 (control != null) { + fieldMapBuilder.put("control", control); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_CONTROL.instantiate( + "project", project, "location", location, "catalog", catalog, "control", control); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ControlName that = ((ControlName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.control, that.control); + } + 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(control); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String control; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getControl() { + return control; + } + + 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 setControl(String control) { + this.control = control; + return this; + } + + private Builder(ControlName controlName) { + this.project = controlName.project; + this.location = controlName.location; + this.catalog = controlName.catalog; + this.control = controlName.control; + } + + public ControlName build() { + return new ControlName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java new file mode 100644 index 00000000..5587c986 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java @@ -0,0 +1,328 @@ +/* + * 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/control.proto + +package com.google.cloud.retail.v2beta; + +public interface ControlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Control) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return Whether the facetSpec field is set. + */ + boolean hasFacetSpec(); + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * + * @return The facetSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec(); + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder(); + + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return Whether the rule field is set. + */ + boolean hasRule(); + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + * + * @return The rule. + */ + com.google.cloud.retail.v2beta.Rule getRule(); + /** + * + * + *
+   * A rule control - a condition-action pair.
+   * Enacts a set action when the condition is triggered.
+   * For example: Boost "gShoe" when query full matches "Running Shoes".
+   * 
+ * + * .google.cloud.retail.v2beta.Rule rule = 4; + */ + com.google.cloud.retail.v2beta.RuleOrBuilder getRuleOrBuilder(); + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/controls/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human readable control display name. Used in Retail UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the associatedServingConfigIds. + */ + java.util.List 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of associatedServingConfigIds. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The associatedServingConfigIds at the given index. + */ + 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.
+   * 
+ * + * + * repeated string associated_serving_config_ids = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the associatedServingConfigIds at the given index. + */ + com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + java.util.List getSolutionTypesList(); + /** + * + * + *
+   * Required. Immutable. The solution types that the serving config 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + 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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + 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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + 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.
+   * 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.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + int getSolutionTypesValue(int index); + + public com.google.cloud.retail.v2beta.Control.ControlCase getControlCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java new file mode 100644 index 00000000..7c290506 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java @@ -0,0 +1,102 @@ +/* + * 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/control.proto + +package com.google.cloud.retail.v2beta; + +public final class ControlProto { + private ControlProto() {} + + 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_Control_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Control_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/control.pro" + + "to\022\032google.cloud.retail.v2beta\032\037google/a" + + "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" + + "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" + }; + 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.cloud.retail.v2beta.SearchServiceProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_Control_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_Control_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Control_descriptor, + new java.lang.String[] { + "FacetSpec", + "Rule", + "Name", + "DisplayName", + "AssociatedServingConfigIds", + "SolutionTypes", + "Control", + }); + 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.cloud.retail.v2beta.SearchServiceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceProto.java new file mode 100644 index 00000000..588e2f7f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceProto.java @@ -0,0 +1,202 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public final class ControlServiceProto { + private ControlServiceProto() {} + + 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_CreateControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CreateControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_DeleteControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListControlsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListControlsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/retail/v2beta/control_ser" + + "vice.proto\022\032google.cloud.retail.v2beta\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032(googl" + + "e/cloud/retail/v2beta/control.proto\032\033goo" + + "gle/protobuf/empty.proto\032 google/protobu" + + "f/field_mask.proto\"\241\001\n\024CreateControlRequ" + + "est\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035retail.goog" + + "leapis.com/Catalog\0229\n\007control\030\002 \001(\0132#.go" + + "ogle.cloud.retail.v2beta.ControlB\003\340A\002\022\027\n" + + "\ncontrol_id\030\003 \001(\tB\003\340A\002\"\202\001\n\024UpdateControl" + + "Request\0229\n\007control\030\001 \001(\0132#.google.cloud." + + "retail.v2beta.ControlB\003\340A\002\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"K\n\024D" + + "eleteControlRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A" + + "\037\n\035retail.googleapis.com/Control\"H\n\021GetC" + + "ontrolRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035ret" + + "ail.googleapis.com/Control\"\222\001\n\023ListContr" + + "olsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035reta" + + "il.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\022\023\n\006fi" + + "lter\030\004 \001(\tB\003\340A\001\"f\n\024ListControlsResponse\022" + + "5\n\010controls\030\001 \003(\0132#.google.cloud.retail." + + "v2beta.Control\022\027\n\017next_page_token\030\002 \001(\t2" + + "\234\010\n\016ControlService\022\320\001\n\rCreateControl\0220.g" + + "oogle.cloud.retail.v2beta.CreateControlR" + + "equest\032#.google.cloud.retail.v2beta.Cont" + + "rol\"h\202\323\344\223\002F\";/v2beta/{parent=projects/*/" + + "locations/*/catalogs/*}/controls:\007contro" + + "l\332A\031parent,control,control_id\022\245\001\n\rDelete" + + "Control\0220.google.cloud.retail.v2beta.Del" + + "eteControlRequest\032\026.google.protobuf.Empt" + + "y\"J\202\323\344\223\002=*;/v2beta/{name=projects/*/loca" + + "tions/*/catalogs/*/controls/*}\332A\004name\022\322\001" + + "\n\rUpdateControl\0220.google.cloud.retail.v2" + + "beta.UpdateControlRequest\032#.google.cloud" + + ".retail.v2beta.Control\"j\202\323\344\223\002N2C/v2beta/" + + "{control.name=projects/*/locations/*/cat" + + "alogs/*/controls/*}:\007control\332A\023control,u" + + "pdate_mask\022\254\001\n\nGetControl\022-.google.cloud" + + ".retail.v2beta.GetControlRequest\032#.googl" + + "e.cloud.retail.v2beta.Control\"J\202\323\344\223\002=\022;/" + + "v2beta/{name=projects/*/locations/*/cata" + + "logs/*/controls/*}\332A\004name\022\277\001\n\014ListContro" + + "ls\022/.google.cloud.retail.v2beta.ListCont" + + "rolsRequest\0320.google.cloud.retail.v2beta" + + ".ListControlsResponse\"L\202\323\344\223\002=\022;/v2beta/{" + + "parent=projects/*/locations/*/catalogs/*" + + "}/controls\332A\006parent\032I\312A\025retail.googleapi" + + "s.com\322A.https://www.googleapis.com/auth/" + + "cloud-platformB\334\001\n\036com.google.cloud.reta" + + "il.v2betaB\023ControlServiceProtoP\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.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.ControlProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_CreateControlRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_CreateControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CreateControlRequest_descriptor, + new java.lang.String[] { + "Parent", "Control", "ControlId", + }); + internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_UpdateControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor, + new java.lang.String[] { + "Control", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_DeleteControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_GetControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_ListControlsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_ListControlsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor, + new java.lang.String[] { + "Controls", "NextPageToken", + }); + 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); + 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.ControlProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequest.java new file mode 100644 index 00000000..a31189c0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequest.java @@ -0,0 +1,1160 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for CreateControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateControlRequest} + */ +public final class CreateControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CreateControlRequest) + CreateControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateControlRequest.newBuilder() to construct. + private CreateControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateControlRequest() { + parent_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateControlRequest( + 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.Control.Builder subBuilder = null; + if (control_ != null) { + subBuilder = control_.toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2beta.Control.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(control_); + control_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_CreateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_CreateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateControlRequest.class, + com.google.cloud.retail.v2beta.CreateControlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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 CONTROL_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.Control control_; + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + @java.lang.Override + public boolean hasControl() { + return control_ != null; + } + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Control getControl() { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder() { + return getControl(); + } + + public static final int CONTROL_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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 (control_ != null) { + output.writeMessage(2, getControl()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, controlId_); + } + 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 (control_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getControl()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, controlId_); + } + 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.CreateControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CreateControlRequest other = + (com.google.cloud.retail.v2beta.CreateControlRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasControl() != other.hasControl()) return false; + if (hasControl()) { + if (!getControl().equals(other.getControl())) return false; + } + if (!getControlId().equals(other.getControlId())) 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 (hasControl()) { + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getControl().hashCode(); + } + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest 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.CreateControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest 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.CreateControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest 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.CreateControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest 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.CreateControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest 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.CreateControlRequest 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.CreateControlRequest 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.CreateControlRequest 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 CreateControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CreateControlRequest) + com.google.cloud.retail.v2beta.CreateControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_CreateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_CreateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateControlRequest.class, + com.google.cloud.retail.v2beta.CreateControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CreateControlRequest.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 (controlBuilder_ == null) { + control_ = null; + } else { + control_ = null; + controlBuilder_ = null; + } + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_CreateControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CreateControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateControlRequest build() { + com.google.cloud.retail.v2beta.CreateControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateControlRequest buildPartial() { + com.google.cloud.retail.v2beta.CreateControlRequest result = + new com.google.cloud.retail.v2beta.CreateControlRequest(this); + result.parent_ = parent_; + if (controlBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = controlBuilder_.build(); + } + result.controlId_ = controlId_; + 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.CreateControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CreateControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CreateControlRequest other) { + if (other == com.google.cloud.retail.v2beta.CreateControlRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasControl()) { + mergeControl(other.getControl()); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.CreateControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CreateControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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.Control control_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + controlBuilder_; + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + public boolean hasControl() { + return controlBuilder_ != null || control_ != null; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + public com.google.cloud.retail.v2beta.Control getControl() { + if (controlBuilder_ == null) { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } else { + return controlBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2beta.Control value) { + if (controlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + controlBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2beta.Control.Builder builderForValue) { + if (controlBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + controlBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeControl(com.google.cloud.retail.v2beta.Control value) { + if (controlBuilder_ == null) { + if (control_ != null) { + control_ = + com.google.cloud.retail.v2beta.Control.newBuilder(control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + controlBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearControl() { + if (controlBuilder_ == null) { + control_ = null; + onChanged(); + } else { + control_ = null; + controlBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Control.Builder getControlBuilder() { + + onChanged(); + return getControlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder() { + if (controlBuilder_ != null) { + return controlBuilder_.getMessageOrBuilder(); + } else { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } + } + /** + * + * + *
+     * Required. The Control to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + getControlFieldBuilder() { + if (controlBuilder_ == null) { + controlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder>( + getControl(), getParentForChildren(), isClean()); + control_ = null; + } + return controlBuilder_; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Control, which will become the final
+     * component of the Control's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.CreateControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CreateControlRequest) + private static final com.google.cloud.retail.v2beta.CreateControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CreateControlRequest(); + } + + public static com.google.cloud.retail.v2beta.CreateControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateControlRequest(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.CreateControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequestOrBuilder.java new file mode 100644 index 00000000..6376d750 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateControlRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CreateControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CreateControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent catalog. 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. Full resource name of parent catalog. 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 Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + boolean hasControl(); + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + com.google.cloud.retail.v2beta.Control getControl(); + /** + * + * + *
+   * Required. The Control to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The ID to use for the Control, which will become the final
+   * component of the Control's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string control_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequest.java new file mode 100644 index 00000000..c1cdc2e0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequest.java @@ -0,0 +1,1216 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [CreateProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateProductRequest} + */ +public final class CreateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CreateProductRequest) + CreateProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProductRequest.newBuilder() to construct. + private CreateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProductRequest() { + parent_ = ""; + productId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateProductRequest( + 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.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + productId_ = 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateProductRequest.class, + com.google.cloud.retail.v2beta.CreateProductRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * 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 catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * 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 PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.Product product_; + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int PRODUCT_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object productId_; + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2beta.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + @java.lang.Override + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + 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(); + productId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2beta.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productId_ = 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 (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); + } + 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 (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productId_); + } + 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.CreateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CreateProductRequest other = + (com.google.cloud.retail.v2beta.CreateProductRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (!getProductId().equals(other.getProductId())) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProductId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest 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.CreateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest 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.CreateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest 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.CreateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest 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.CreateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest 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.CreateProductRequest 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.CreateProductRequest 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.CreateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [CreateProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CreateProductRequest) + com.google.cloud.retail.v2beta.CreateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_CreateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_CreateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateProductRequest.class, + com.google.cloud.retail.v2beta.CreateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CreateProductRequest.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + productId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_CreateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CreateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateProductRequest build() { + com.google.cloud.retail.v2beta.CreateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateProductRequest buildPartial() { + com.google.cloud.retail.v2beta.CreateProductRequest result = + new com.google.cloud.retail.v2beta.CreateProductRequest(this); + result.parent_ = parent_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.productId_ = productId_; + 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.CreateProductRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CreateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CreateProductRequest other) { + if (other == com.google.cloud.retail.v2beta.CreateProductRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (!other.getProductId().isEmpty()) { + productId_ = other.productId_; + 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.CreateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CreateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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 catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+     * 
+ * + * + * 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.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2beta.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2beta.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private java.lang.Object productId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2beta.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + public java.lang.String getProductId() { + java.lang.Object ref = productId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2beta.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + public com.google.protobuf.ByteString getProductIdBytes() { + java.lang.Object ref = productId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2beta.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The productId to set. + * @return This builder for chaining. + */ + public Builder setProductId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2beta.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProductId() { + + productId_ = getDefaultInstance().getProductId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Product][google.cloud.retail.v2beta.Product], which will become the final
+     * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+     * If the caller does not have permission to create the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * This field must be unique among all
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+     * Otherwise, an ALREADY_EXISTS error is returned.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for productId to set. + * @return This builder for chaining. + */ + public Builder setProductIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productId_ = 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.CreateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CreateProductRequest) + private static final com.google.cloud.retail.v2beta.CreateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CreateProductRequest(); + } + + public static com.google.cloud.retail.v2beta.CreateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProductRequest(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.CreateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequestOrBuilder.java new file mode 100644 index 00000000..fb7cb19c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateProductRequestOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CreateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CreateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2beta.Product getProduct(); + /** + * + * + *
+   * Required. The [Product][google.cloud.retail.v2beta.Product] to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2beta.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The productId. + */ + java.lang.String getProductId(); + /** + * + * + *
+   * Required. The ID to use for the
+   * [Product][google.cloud.retail.v2beta.Product], which will become the final
+   * component of the [Product.name][google.cloud.retail.v2beta.Product.name].
+   * If the caller does not have permission to create the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * This field must be unique among all
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [parent][google.cloud.retail.v2beta.CreateProductRequest.parent].
+   * Otherwise, an ALREADY_EXISTS error is returned.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string product_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for productId. + */ + com.google.protobuf.ByteString getProductIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequest.java new file mode 100644 index 00000000..4052f6e1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequest.java @@ -0,0 +1,1162 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for CreateServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateServingConfigRequest} + */ +public final class CreateServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CreateServingConfigRequest) + CreateServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServingConfigRequest.newBuilder() to construct. + private CreateServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServingConfigRequest() { + parent_ = ""; + servingConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServingConfigRequest( + 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.ServingConfig.Builder subBuilder = null; + if (servingConfig_ != null) { + subBuilder = servingConfig_.toBuilder(); + } + servingConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ServingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(servingConfig_); + servingConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + servingConfigId_ = 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateServingConfigRequest.class, + com.google.cloud.retail.v2beta.CreateServingConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Full resource name of parent. 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. Full resource name of parent. 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 SERVING_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ServingConfig servingConfig_; + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + @java.lang.Override + public boolean hasServingConfig() { + return servingConfig_ != null; + } + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig getServingConfig() { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder() { + return getServingConfig(); + } + + public static final int SERVING_CONFIG_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object servingConfigId_; + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + @java.lang.Override + public java.lang.String getServingConfigId() { + java.lang.Object ref = servingConfigId_; + 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(); + servingConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigIdBytes() { + java.lang.Object ref = servingConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfigId_ = 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 (servingConfig_ != null) { + output.writeMessage(2, getServingConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfigId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, servingConfigId_); + } + 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 (servingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServingConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfigId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, servingConfigId_); + } + 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.CreateServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CreateServingConfigRequest other = + (com.google.cloud.retail.v2beta.CreateServingConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasServingConfig() != other.hasServingConfig()) return false; + if (hasServingConfig()) { + if (!getServingConfig().equals(other.getServingConfig())) return false; + } + if (!getServingConfigId().equals(other.getServingConfigId())) 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 (hasServingConfig()) { + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + } + hash = (37 * hash) + SERVING_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest 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.CreateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest 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.CreateServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest 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.CreateServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest 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.CreateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest 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.CreateServingConfigRequest 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.CreateServingConfigRequest 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.CreateServingConfigRequest 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 CreateServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CreateServingConfigRequest) + com.google.cloud.retail.v2beta.CreateServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateServingConfigRequest.class, + com.google.cloud.retail.v2beta.CreateServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CreateServingConfigRequest.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 (servingConfigBuilder_ == null) { + servingConfig_ = null; + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + servingConfigId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CreateServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateServingConfigRequest build() { + com.google.cloud.retail.v2beta.CreateServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateServingConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.CreateServingConfigRequest result = + new com.google.cloud.retail.v2beta.CreateServingConfigRequest(this); + result.parent_ = parent_; + if (servingConfigBuilder_ == null) { + result.servingConfig_ = servingConfig_; + } else { + result.servingConfig_ = servingConfigBuilder_.build(); + } + result.servingConfigId_ = servingConfigId_; + 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.CreateServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CreateServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CreateServingConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.CreateServingConfigRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasServingConfig()) { + mergeServingConfig(other.getServingConfig()); + } + if (!other.getServingConfigId().isEmpty()) { + servingConfigId_ = other.servingConfigId_; + 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.CreateServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CreateServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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. Full resource name of parent. 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.ServingConfig servingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + servingConfigBuilder_; + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + public boolean hasServingConfig() { + return servingConfigBuilder_ != null || servingConfig_ != null; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + public com.google.cloud.retail.v2beta.ServingConfig getServingConfig() { + if (servingConfigBuilder_ == null) { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } else { + return servingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig(com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + onChanged(); + } else { + servingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig( + com.google.cloud.retail.v2beta.ServingConfig.Builder builderForValue) { + if (servingConfigBuilder_ == null) { + servingConfig_ = builderForValue.build(); + onChanged(); + } else { + servingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServingConfig(com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (servingConfig_ != null) { + servingConfig_ = + com.google.cloud.retail.v2beta.ServingConfig.newBuilder(servingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + servingConfig_ = value; + } + onChanged(); + } else { + servingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServingConfig() { + if (servingConfigBuilder_ == null) { + servingConfig_ = null; + onChanged(); + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ServingConfig.Builder getServingConfigBuilder() { + + onChanged(); + return getServingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder() { + if (servingConfigBuilder_ != null) { + return servingConfigBuilder_.getMessageOrBuilder(); + } else { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } + } + /** + * + * + *
+     * Required. The ServingConfig to create.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + getServingConfigFieldBuilder() { + if (servingConfigBuilder_ == null) { + servingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder>( + getServingConfig(), getParentForChildren(), isClean()); + servingConfig_ = null; + } + return servingConfigBuilder_; + } + + private java.lang.Object servingConfigId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + public java.lang.String getServingConfigId() { + java.lang.Object ref = servingConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + public com.google.protobuf.ByteString getServingConfigIdBytes() { + java.lang.Object ref = servingConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The servingConfigId to set. + * @return This builder for chaining. + */ + public Builder setServingConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfigId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearServingConfigId() { + + servingConfigId_ = getDefaultInstance().getServingConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the ServingConfig, which will become the final
+     * component of the ServingConfig's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-_/.
+     * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for servingConfigId to set. + * @return This builder for chaining. + */ + public Builder setServingConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfigId_ = 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.CreateServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CreateServingConfigRequest) + private static final com.google.cloud.retail.v2beta.CreateServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CreateServingConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.CreateServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServingConfigRequest(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.CreateServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..6c6c0d3a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateServingConfigRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CreateServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CreateServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent. 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. Full resource name of parent. 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 ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + boolean hasServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + com.google.cloud.retail.v2beta.ServingConfig getServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to create.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The servingConfigId. + */ + java.lang.String getServingConfigId(); + /** + * + * + *
+   * Required. The ID to use for the ServingConfig, which will become the final
+   * component of the ServingConfig's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-_/.
+   * 
+ * + * string serving_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for servingConfigId. + */ + com.google.protobuf.ByteString getServingConfigIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java new file mode 100644 index 00000000..c13d555e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java @@ -0,0 +1,1492 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * A custom attribute that is not explicitly modeled in
+ * [Product][google.cloud.retail.v2beta.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CustomAttribute} + */ +public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CustomAttribute) + CustomAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomAttribute.newBuilder() to construct. + private CustomAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomAttribute() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + numbers_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAttribute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomAttribute( + 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)) { + text_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + text_.add(s); + break; + } + case 17: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + numbers_ = newDoubleList(); + mutable_bitField0_ |= 0x00000002; + } + numbers_.addDouble(input.readDouble()); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { + numbers_ = newDoubleList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + numbers_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 24: + { + bitField0_ |= 0x00000001; + searchable_ = input.readBool(); + break; + } + case 32: + { + bitField0_ |= 0x00000002; + indexable_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + numbers_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CustomAttribute.class, + com.google.cloud.retail.v2beta.CustomAttribute.Builder.class); + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList text_; + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_; + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + + public static final int NUMBERS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.DoubleList numbers_; + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + @java.lang.Override + public java.util.List getNumbersList() { + return numbers_; + } + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + public int getNumbersCount() { + return numbers_.size(); + } + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + public double getNumbers(int index) { + return numbers_.getDouble(index); + } + + private int numbersMemoizedSerializedSize = -1; + + public static final int SEARCHABLE_FIELD_NUMBER = 3; + private boolean searchable_; + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + + public static final int INDEXABLE_FIELD_NUMBER = 4; + private boolean indexable_; + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + + 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 { + getSerializedSize(); + for (int i = 0; i < text_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_.getRaw(i)); + } + if (getNumbersList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(numbersMemoizedSerializedSize); + } + for (int i = 0; i < numbers_.size(); i++) { + output.writeDoubleNoTag(numbers_.getDouble(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(4, indexable_); + } + 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 < text_.size(); i++) { + dataSize += computeStringSizeNoTag(text_.getRaw(i)); + } + size += dataSize; + size += 1 * getTextList().size(); + } + { + int dataSize = 0; + dataSize = 8 * getNumbersList().size(); + size += dataSize; + if (!getNumbersList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + numbersMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, searchable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, indexable_); + } + 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.CustomAttribute)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CustomAttribute other = + (com.google.cloud.retail.v2beta.CustomAttribute) obj; + + if (!getTextList().equals(other.getTextList())) return false; + if (!getNumbersList().equals(other.getNumbersList())) return false; + if (hasSearchable() != other.hasSearchable()) return false; + if (hasSearchable()) { + if (getSearchable() != other.getSearchable()) return false; + } + if (hasIndexable() != other.hasIndexable()) return false; + if (hasIndexable()) { + if (getIndexable() != other.getIndexable()) 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 (getTextCount() > 0) { + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getTextList().hashCode(); + } + if (getNumbersCount() > 0) { + hash = (37 * hash) + NUMBERS_FIELD_NUMBER; + hash = (53 * hash) + getNumbersList().hashCode(); + } + if (hasSearchable()) { + hash = (37 * hash) + SEARCHABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSearchable()); + } + if (hasIndexable()) { + hash = (37 * hash) + INDEXABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIndexable()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CustomAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute 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.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute 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.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute 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.CustomAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute 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.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute 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.CustomAttribute 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.CustomAttribute 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.CustomAttribute 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; + } + /** + * + * + *
+   * A custom attribute that is not explicitly modeled in
+   * [Product][google.cloud.retail.v2beta.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CustomAttribute) + com.google.cloud.retail.v2beta.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CustomAttribute.class, + com.google.cloud.retail.v2beta.CustomAttribute.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CustomAttribute.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(); + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + numbers_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000002); + searchable_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + indexable_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute build() { + com.google.cloud.retail.v2beta.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute buildPartial() { + com.google.cloud.retail.v2beta.CustomAttribute result = + new com.google.cloud.retail.v2beta.CustomAttribute(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) != 0)) { + text_ = text_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.text_ = text_; + if (((bitField0_ & 0x00000002) != 0)) { + numbers_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.numbers_ = numbers_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.searchable_ = searchable_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.indexable_ = indexable_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; + 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.CustomAttribute) { + return mergeFrom((com.google.cloud.retail.v2beta.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CustomAttribute other) { + if (other == com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance()) return this; + if (!other.text_.isEmpty()) { + if (text_.isEmpty()) { + text_ = other.text_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTextIsMutable(); + text_.addAll(other.text_); + } + onChanged(); + } + if (!other.numbers_.isEmpty()) { + if (numbers_.isEmpty()) { + numbers_ = other.numbers_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNumbersIsMutable(); + numbers_.addAll(other.numbers_); + } + onChanged(); + } + if (other.hasSearchable()) { + setSearchable(other.getSearchable()); + } + if (other.hasIndexable()) { + setIndexable(other.getIndexable()); + } + 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.CustomAttribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.CustomAttribute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList text_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTextIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + text_ = new com.google.protobuf.LazyStringArrayList(text_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_.getUnmodifiableView(); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index to set the value at. + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param value The text to add. + * @return This builder for chaining. + */ + public Builder addText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param values The text to add. + * @return This builder for chaining. + */ + public Builder addAllText(java.lang.Iterable values) { + ensureTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, text_); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The textual values of this custom attribute. For example, `["yellow",
+     * "green"]` when the key is "color".
+     * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string text = 1; + * + * @param value The bytes of the text to add. + * @return This builder for chaining. + */ + public Builder addTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTextIsMutable(); + text_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList numbers_ = emptyDoubleList(); + + private void ensureNumbersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + numbers_ = mutableCopy(numbers_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + public java.util.List getNumbersList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(numbers_) + : numbers_; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + public int getNumbersCount() { + return numbers_.size(); + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + public double getNumbers(int index) { + return numbers_.getDouble(index); + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param index The index to set the value at. + * @param value The numbers to set. + * @return This builder for chaining. + */ + public Builder setNumbers(int index, double value) { + ensureNumbersIsMutable(); + numbers_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param value The numbers to add. + * @return This builder for chaining. + */ + public Builder addNumbers(double value) { + ensureNumbersIsMutable(); + numbers_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @param values The numbers to add. + * @return This builder for chaining. + */ + public Builder addAllNumbers(java.lang.Iterable values) { + ensureNumbersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, numbers_); + onChanged(); + return this; + } + /** + * + * + *
+     * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+     * when the key is "lengths_cm".
+     * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+     * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+     * set. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated double numbers = 2; + * + * @return This builder for chaining. + */ + public Builder clearNumbers() { + numbers_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private boolean searchable_; + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + @java.lang.Override + public boolean hasSearchable() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + @java.lang.Override + public boolean getSearchable() { + return searchable_; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @param value The searchable to set. + * @return This builder for chaining. + */ + public Builder setSearchable(boolean value) { + bitField0_ |= 0x00000004; + searchable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * searchable by text queries in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+     * set. Otherwise, a INVALID_ARGUMENT error is returned.
+     * 
+ * + * optional bool searchable = 3; + * + * @return This builder for chaining. + */ + public Builder clearSearchable() { + bitField0_ = (bitField0_ & ~0x00000004); + searchable_ = false; + onChanged(); + return this; + } + + private boolean indexable_; + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + @java.lang.Override + public boolean hasIndexable() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + @java.lang.Override + public boolean getIndexable() { + return indexable_; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @param value The indexable to set. + * @return This builder for chaining. + */ + public Builder setIndexable(boolean value) { + bitField0_ |= 0x00000008; + indexable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This field will only be used when
+     * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+     * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+     * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+     * indexed, so that it can be filtered, faceted or boosted in
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This field is ignored in a
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+     * See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * and
+     * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+     * for more details.
+     * 
+ * + * optional bool indexable = 4; + * + * @return This builder for chaining. + */ + public Builder clearIndexable() { + bitField0_ = (bitField0_ & ~0x00000008); + indexable_ = 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.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CustomAttribute) + private static final com.google.cloud.retail.v2beta.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CustomAttribute(); + } + + public static com.google.cloud.retail.v2beta.CustomAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomAttribute(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.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java new file mode 100644 index 00000000..6f72449a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java @@ -0,0 +1,244 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CustomAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + java.util.List getTextList(); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + int getTextCount(); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + java.lang.String getText(int index); + /** + * + * + *
+   * The textual values of this custom attribute. For example, `["yellow",
+   * "green"]` when the key is "color".
+   * Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + com.google.protobuf.ByteString getTextBytes(int index); + + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return A list containing the numbers. + */ + java.util.List getNumbersList(); + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @return The count of numbers. + */ + int getNumbersCount(); + /** + * + * + *
+   * The numerical values of this custom attribute. For example, `[2.3, 15.4]`
+   * when the key is "lengths_cm".
+   * Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
+   * [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
+   * set. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated double numbers = 2; + * + * @param index The index of the element to return. + * @return The numbers at the given index. + */ + double getNumbers(int index); + + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return Whether the searchable field is set. + */ + boolean hasSearchable(); + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * searchable by text queries in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
+   * set. Otherwise, a INVALID_ARGUMENT error is returned.
+   * 
+ * + * optional bool searchable = 3; + * + * @return The searchable. + */ + boolean getSearchable(); + + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return Whether the indexable field is set. + */ + boolean hasIndexable(); + /** + * + * + *
+   * This field will only be used when
+   * [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
+   * of the [Catalog][google.cloud.retail.v2beta.Catalog] is
+   * 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
+   * indexed, so that it can be filtered, faceted or boosted in
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This field is ignored in a
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent].
+   * See
+   * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter],
+   * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+   * and
+   * [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
+   * for more details.
+   * 
+ * + * optional bool indexable = 4; + * + * @return The indexable. + */ + boolean getIndexable(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequest.java new file mode 100644 index 00000000..6af4563d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequest.java @@ -0,0 +1,659 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for DeleteControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteControlRequest} + */ +public final class DeleteControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.DeleteControlRequest) + DeleteControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteControlRequest.newBuilder() to construct. + private DeleteControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteControlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteControlRequest( + 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteControlRequest.class, + com.google.cloud.retail.v2beta.DeleteControlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.DeleteControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.DeleteControlRequest other = + (com.google.cloud.retail.v2beta.DeleteControlRequest) 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.DeleteControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest 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.DeleteControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest 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.DeleteControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest 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.DeleteControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest 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.DeleteControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest 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.DeleteControlRequest 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.DeleteControlRequest 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.DeleteControlRequest 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 DeleteControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.DeleteControlRequest) + com.google.cloud.retail.v2beta.DeleteControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteControlRequest.class, + com.google.cloud.retail.v2beta.DeleteControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.DeleteControlRequest.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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.DeleteControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteControlRequest build() { + com.google.cloud.retail.v2beta.DeleteControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteControlRequest buildPartial() { + com.google.cloud.retail.v2beta.DeleteControlRequest result = + new com.google.cloud.retail.v2beta.DeleteControlRequest(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.DeleteControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.DeleteControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.DeleteControlRequest other) { + if (other == com.google.cloud.retail.v2beta.DeleteControlRequest.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.DeleteControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.DeleteControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.DeleteControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.DeleteControlRequest) + private static final com.google.cloud.retail.v2beta.DeleteControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.DeleteControlRequest(); + } + + public static com.google.cloud.retail.v2beta.DeleteControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteControlRequest(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.DeleteControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequestOrBuilder.java new file mode 100644 index 00000000..6389615b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteControlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface DeleteControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.DeleteControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequest.java new file mode 100644 index 00000000..9e711190 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequest.java @@ -0,0 +1,771 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [DeleteProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteProductRequest} + */ +public final class DeleteProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.DeleteProductRequest) + DeleteProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProductRequest.newBuilder() to construct. + private DeleteProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProductRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProductRequest( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteProductRequest.class, + com.google.cloud.retail.v2beta.DeleteProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] with more than one
+   * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+   * 
+ * + * + * 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. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] with more than one
+   * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+   * 
+ * + * + * 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.DeleteProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.DeleteProductRequest other = + (com.google.cloud.retail.v2beta.DeleteProductRequest) 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.DeleteProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest 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.DeleteProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest 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.DeleteProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest 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.DeleteProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest 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.DeleteProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest 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.DeleteProductRequest 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.DeleteProductRequest 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.DeleteProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [DeleteProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.DeleteProductRequest) + com.google.cloud.retail.v2beta.DeleteProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteProductRequest.class, + com.google.cloud.retail.v2beta.DeleteProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.DeleteProductRequest.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.DeleteProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteProductRequest build() { + com.google.cloud.retail.v2beta.DeleteProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteProductRequest buildPartial() { + com.google.cloud.retail.v2beta.DeleteProductRequest result = + new com.google.cloud.retail.v2beta.DeleteProductRequest(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.DeleteProductRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.DeleteProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.DeleteProductRequest other) { + if (other == com.google.cloud.retail.v2beta.DeleteProductRequest.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.DeleteProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.DeleteProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] with more than one
+     * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] with more than one
+     * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] with more than one
+     * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] with more than one
+     * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to delete the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+     * exist, a NOT_FOUND error is returned.
+     * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+     * a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] member nor a
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] with more than one
+     * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * All inventory information for the named
+     * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+     * 
+ * + * + * 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.DeleteProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.DeleteProductRequest) + private static final com.google.cloud.retail.v2beta.DeleteProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.DeleteProductRequest(); + } + + public static com.google.cloud.retail.v2beta.DeleteProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProductRequest(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.DeleteProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequestOrBuilder.java new file mode 100644 index 00000000..03aa722d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteProductRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface DeleteProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.DeleteProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] with more than one
+   * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to delete the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to delete does not
+   * exist, a NOT_FOUND error is returned.
+   * The [Product][google.cloud.retail.v2beta.Product] to delete can neither be
+   * a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] member nor a
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] with more than one
+   * [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * All inventory information for the named
+   * [Product][google.cloud.retail.v2beta.Product] will be deleted.
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java new file mode 100644 index 00000000..1f7d041f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java @@ -0,0 +1,660 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for DeleteServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteServingConfigRequest} + */ +public final class DeleteServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.DeleteServingConfigRequest) + DeleteServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServingConfigRequest.newBuilder() to construct. + private DeleteServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServingConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServingConfigRequest( + 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest.class, + com.google.cloud.retail.v2beta.DeleteServingConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @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.DeleteServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.DeleteServingConfigRequest other = + (com.google.cloud.retail.v2beta.DeleteServingConfigRequest) 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.DeleteServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest 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.DeleteServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest 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.DeleteServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest 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.DeleteServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest 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.DeleteServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest 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.DeleteServingConfigRequest 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.DeleteServingConfigRequest 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.DeleteServingConfigRequest 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 DeleteServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.DeleteServingConfigRequest) + com.google.cloud.retail.v2beta.DeleteServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteServingConfigRequest.class, + com.google.cloud.retail.v2beta.DeleteServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.DeleteServingConfigRequest.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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.DeleteServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteServingConfigRequest build() { + com.google.cloud.retail.v2beta.DeleteServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteServingConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.DeleteServingConfigRequest result = + new com.google.cloud.retail.v2beta.DeleteServingConfigRequest(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.DeleteServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.DeleteServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.DeleteServingConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.DeleteServingConfigRequest.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.DeleteServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.DeleteServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ServingConfig to delete. Format:
+     * 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) = { ... } + * + * + * @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.DeleteServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.DeleteServingConfigRequest) + private static final com.google.cloud.retail.v2beta.DeleteServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.DeleteServingConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.DeleteServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServingConfigRequest(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.DeleteServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..6b9c0d61 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface DeleteServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.DeleteServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ServingConfig to delete. Format:
+   * 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) = { ... } + * + * + * @return The name. + */ + 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}
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java new file mode 100644 index 00000000..ff9543f0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java @@ -0,0 +1,127 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +public final class ExportConfigProto { + private ExportConfigProto() {} + + 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_ExportErrorsConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_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/export_conf" + + "ig.proto\022\032google.cloud.retail.v2beta\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\032\037google/protobuf/timest" + + "amp.proto\032\027google/rpc/status.proto\"9\n\022Ex" + + "portErrorsConfig\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r" + + "\n\013destination\"r\n\016ExportMetadata\022/\n\013creat" + + "e_time\030\001 \001(\0132\032.google.protobuf.Timestamp" + + "\022/\n\013update_time\030\002 \001(\0132\032.google.protobuf." + + "Timestamp\"\212\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\"\214\001\n\030Expor" + + "tUserEventsResponse\022)\n\rerror_samples\030\001 \003" + + "(\0132\022.google.rpc.Status\022E\n\rerrors_config\030" + + "\002 \001(\0132..google.cloud.retail.v2beta.Expor" + + "tErrorsConfigB\332\001\n\036com.google.cloud.retai" + + "l.v2betaB\021ExportConfigProtoP\001Z@google.go" + + "lang.org/genproto/googleapis/cloud/retai" + + "l/v2beta;retail\242\002\006RETAIL\252\002\032Google.Cloud." + + "Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\V2be" + + "ta\352\002\035Google::Cloud::Retail::V2betab\006prot" + + "o3" + }; + 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(), + }); + internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_ExportMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_ExportProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfig.java new file mode 100644 index 00000000..d2d10887 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfig.java @@ -0,0 +1,795 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Configuration of destination for Export related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportErrorsConfig} + */ +public final class ExportErrorsConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportErrorsConfig) + ExportErrorsConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportErrorsConfig.newBuilder() to construct. + private ExportErrorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportErrorsConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportErrorsConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportErrorsConfig( + 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(); + destinationCase_ = 1; + destination_ = 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.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportErrorsConfig.class, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + 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(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = 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 (destinationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + 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.ExportErrorsConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportErrorsConfig other = + (com.google.cloud.retail.v2beta.ExportErrorsConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 0: + default: + } + 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(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig 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.ExportErrorsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig 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.ExportErrorsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig 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.ExportErrorsConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig 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.ExportErrorsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig 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.ExportErrorsConfig 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.ExportErrorsConfig 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.ExportErrorsConfig 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; + } + /** + * + * + *
+   * Configuration of destination for Export related errors.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportErrorsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportErrorsConfig) + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportErrorsConfig.class, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportErrorsConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig build() { + com.google.cloud.retail.v2beta.ExportErrorsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig buildPartial() { + com.google.cloud.retail.v2beta.ExportErrorsConfig result = + new com.google.cloud.retail.v2beta.ExportErrorsConfig(this); + if (destinationCase_ == 1) { + result.destination_ = destination_; + } + result.destinationCase_ = destinationCase_; + 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.ExportErrorsConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportErrorsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportErrorsConfig other) { + if (other == com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + 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.ExportErrorsConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ExportErrorsConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationCase_ = 1; + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage path for import errors. This must be an empty,
+     * existing Cloud Storage bucket. Export errors will be written to a file in
+     * this bucket, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The bytes for gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationCase_ = 1; + destination_ = 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.ExportErrorsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportErrorsConfig) + private static final com.google.cloud.retail.v2beta.ExportErrorsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportErrorsConfig(); + } + + public static com.google.cloud.retail.v2beta.ExportErrorsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportErrorsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportErrorsConfig(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.ExportErrorsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfigOrBuilder.java new file mode 100644 index 00000000..38310bc8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportErrorsConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportErrorsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportErrorsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + java.lang.String getGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage path for import errors. This must be an empty,
+   * existing Cloud Storage bucket. Export errors will be written to a file in
+   * this bucket, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + public com.google.cloud.retail.v2beta.ExportErrorsConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java new file mode 100644 index 00000000..16939f5d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java @@ -0,0 +1,1014 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the Export operation. This will be
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportMetadata} + */ +public final class ExportMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportMetadata) + ExportMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportMetadata.newBuilder() to construct. + private ExportMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportMetadata( + 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.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 18: + { + 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; + } + 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.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportMetadata.class, + com.google.cloud.retail.v2beta.ExportMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(2, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateTime()); + } + 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.ExportMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportMetadata other = + (com.google.cloud.retail.v2beta.ExportMetadata) obj; + + 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 (!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 (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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata 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.ExportMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata 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.ExportMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata 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.ExportMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata 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.ExportMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata 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.ExportMetadata 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.ExportMetadata 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.ExportMetadata 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 related to the progress of the Export operation. This will be
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportMetadata) + com.google.cloud.retail.v2beta.ExportMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportMetadata.class, + com.google.cloud.retail.v2beta.ExportMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportMetadata build() { + com.google.cloud.retail.v2beta.ExportMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportMetadata buildPartial() { + com.google.cloud.retail.v2beta.ExportMetadata result = + new com.google.cloud.retail.v2beta.ExportMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.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.ExportMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportMetadata other) { + if (other == com.google.cloud.retail.v2beta.ExportMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.ExportMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ExportMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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_; + } + + @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.ExportMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportMetadata) + private static final com.google.cloud.retail.v2beta.ExportMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportMetadata(); + } + + public static com.google.cloud.retail.v2beta.ExportMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportMetadata(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.ExportMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadataOrBuilder.java new file mode 100644 index 00000000..b3aa0286 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponse.java new file mode 100644 index 00000000..d5093160 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponse.java @@ -0,0 +1,1222 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the ExportProductsRequest. If the long running
+ * operation is done, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportProductsResponse} + */ +public final class ExportProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportProductsResponse) + ExportProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportProductsResponse.newBuilder() to construct. + private ExportProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportProductsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportProductsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ExportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportProductsResponse.class, + com.google.cloud.retail.v2beta.ExportProductsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.ExportProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportProductsResponse other = + (com.google.cloud.retail.v2beta.ExportProductsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse 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.ExportProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse 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.ExportProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse 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.ExportProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse 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.ExportProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse 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.ExportProductsResponse 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.ExportProductsResponse 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.ExportProductsResponse 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 ExportProductsRequest. If the long running
+   * operation is done, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportProductsResponse) + com.google.cloud.retail.v2beta.ExportProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportProductsResponse.class, + com.google.cloud.retail.v2beta.ExportProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportProductsResponse build() { + com.google.cloud.retail.v2beta.ExportProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportProductsResponse buildPartial() { + com.google.cloud.retail.v2beta.ExportProductsResponse result = + new com.google.cloud.retail.v2beta.ExportProductsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.ExportProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportProductsResponse other) { + if (other == com.google.cloud.retail.v2beta.ExportProductsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.ExportProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ExportProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ExportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.ExportProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportProductsResponse) + private static final com.google.cloud.retail.v2beta.ExportProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportProductsResponse(); + } + + public static com.google.cloud.retail.v2beta.ExportProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportProductsResponse(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.ExportProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponseOrBuilder.java new file mode 100644 index 00000000..d4309eec --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportProductsResponseOrBuilder.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/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponse.java new file mode 100644 index 00000000..520af30a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponse.java @@ -0,0 +1,1234 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the ExportUserEventsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportUserEventsResponse} + */ +public final class ExportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportUserEventsResponse) + ExportUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportUserEventsResponse.newBuilder() to construct. + private ExportUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportUserEventsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportUserEventsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ExportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportUserEventsResponse.class, + com.google.cloud.retail.v2beta.ExportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.ExportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportUserEventsResponse other = + (com.google.cloud.retail.v2beta.ExportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse 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.ExportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse 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.ExportUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse 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.ExportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse 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.ExportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse 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.ExportUserEventsResponse 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.ExportUserEventsResponse 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.ExportUserEventsResponse 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 ExportUserEventsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportUserEventsResponse) + com.google.cloud.retail.v2beta.ExportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportUserEventsResponse.class, + com.google.cloud.retail.v2beta.ExportUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportUserEventsResponse build() { + com.google.cloud.retail.v2beta.ExportUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportUserEventsResponse buildPartial() { + com.google.cloud.retail.v2beta.ExportUserEventsResponse result = + new com.google.cloud.retail.v2beta.ExportUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.ExportUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportUserEventsResponse other) { + if (other == com.google.cloud.retail.v2beta.ExportUserEventsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.ExportUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ExportUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ExportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.ExportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportUserEventsResponse) + private static final com.google.cloud.retail.v2beta.ExportUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportUserEventsResponse(); + } + + public static com.google.cloud.retail.v2beta.ExportUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportUserEventsResponse(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.ExportUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..d1320973 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportUserEventsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * 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/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfo.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfo.java new file mode 100644 index 00000000..4f922744 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfo.java @@ -0,0 +1,1120 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Fulfillment information, such as the store IDs for in-store pickup or region
+ * IDs for different shipping methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.FulfillmentInfo} + */ +public final class FulfillmentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.FulfillmentInfo) + FulfillmentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FulfillmentInfo.newBuilder() to construct. + private FulfillmentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FulfillmentInfo() { + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FulfillmentInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FulfillmentInfo( + 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(); + + type_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.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)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.FulfillmentInfo.class, + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @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 PLACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.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(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, placeIds_.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(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().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.FulfillmentInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.FulfillmentInfo other = + (com.google.cloud.retail.v2beta.FulfillmentInfo) obj; + + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo 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.FulfillmentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo 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.FulfillmentInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo 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.FulfillmentInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo 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.FulfillmentInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo 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.FulfillmentInfo 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.FulfillmentInfo 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.FulfillmentInfo 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; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or region
+   * IDs for different shipping methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.FulfillmentInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.FulfillmentInfo) + com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_FulfillmentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.FulfillmentInfo.class, + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.FulfillmentInfo.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(); + type_ = ""; + + placeIds_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_FulfillmentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.FulfillmentInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.FulfillmentInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.FulfillmentInfo build() { + com.google.cloud.retail.v2beta.FulfillmentInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.FulfillmentInfo buildPartial() { + com.google.cloud.retail.v2beta.FulfillmentInfo result = + new com.google.cloud.retail.v2beta.FulfillmentInfo(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + 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.FulfillmentInfo) { + return mergeFrom((com.google.cloud.retail.v2beta.FulfillmentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.FulfillmentInfo other) { + if (other == com.google.cloud.retail.v2beta.FulfillmentInfo.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + 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.FulfillmentInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.FulfillmentInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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; + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The fulfillment type, including commonly used types (such as pickup in
+     * store and same day delivery), and custom types. Customers have to map
+     * custom types to their display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string type = 1; + * + * @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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+     * such as the store IDs for
+     * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     * or the region IDs for
+     * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * A maximum of 3000 values are allowed. Each value must be a string with a
+     * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+     * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string place_ids = 2; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.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.FulfillmentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.FulfillmentInfo) + private static final com.google.cloud.retail.v2beta.FulfillmentInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.FulfillmentInfo(); + } + + public static com.google.cloud.retail.v2beta.FulfillmentInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FulfillmentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FulfillmentInfo(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.FulfillmentInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfoOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfoOrBuilder.java new file mode 100644 index 00000000..5fac9d87 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/FulfillmentInfoOrBuilder.java @@ -0,0 +1,161 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface FulfillmentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.FulfillmentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The fulfillment type, including commonly used types (such as pickup in
+   * store and same day delivery), and custom types. Customers have to map
+   * custom types to their display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type],
+   * such as the store IDs for
+   * [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   * or the region IDs for
+   * [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * A maximum of 3000 values are allowed. Each value must be a string with a
+   * length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such
+   * as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string place_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java new file mode 100644 index 00000000..a4941047 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java @@ -0,0 +1,1127 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Google Cloud Storage location for input content.
+ * format.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + dataSchema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsSource( + 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)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inputUris_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + dataSchema_ = 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)) { + inputUris_ = inputUris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GcsSource.class, + com.google.cloud.retail.v2beta.GcsSource.Builder.class); + } + + public static final int INPUT_URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList inputUris_; + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_; + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + + public static final int DATA_SCHEMA_FIELD_NUMBER = 2; + private volatile java.lang.Object dataSchema_; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2beta.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + @java.lang.Override + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + 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(); + dataSchema_ = s; + return s; + } + } + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2beta.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = 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 < inputUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUris_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dataSchema_); + } + 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 < inputUris_.size(); i++) { + dataSize += computeStringSizeNoTag(inputUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputUrisList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dataSchema_); + } + 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.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GcsSource other = (com.google.cloud.retail.v2beta.GcsSource) obj; + + if (!getInputUrisList().equals(other.getInputUrisList())) return false; + if (!getDataSchema().equals(other.getDataSchema())) 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 (getInputUrisCount() > 0) { + hash = (37 * hash) + INPUT_URIS_FIELD_NUMBER; + hash = (53 * hash) + getInputUrisList().hashCode(); + } + hash = (37 * hash) + DATA_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getDataSchema().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GcsSource 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.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GcsSource 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.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GcsSource 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.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GcsSource 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.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GcsSource 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.GcsSource 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.GcsSource 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.GcsSource 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; + } + /** + * + * + *
+   * Google Cloud Storage location for input content.
+   * format.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GcsSource) + com.google.cloud.retail.v2beta.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GcsSource.class, + com.google.cloud.retail.v2beta.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GcsSource.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(); + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + dataSchema_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource build() { + com.google.cloud.retail.v2beta.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource buildPartial() { + com.google.cloud.retail.v2beta.GcsSource result = + new com.google.cloud.retail.v2beta.GcsSource(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + inputUris_ = inputUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputUris_ = inputUris_; + result.dataSchema_ = dataSchema_; + 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.GcsSource) { + return mergeFrom((com.google.cloud.retail.v2beta.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GcsSource other) { + if (other == com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance()) return this; + if (!other.inputUris_.isEmpty()) { + if (inputUris_.isEmpty()) { + inputUris_ = other.inputUris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputUrisIsMutable(); + inputUris_.addAll(other.inputUris_); + } + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + 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.GcsSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.GcsSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList inputUris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInputUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(inputUris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + return inputUris_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + public java.lang.String getInputUris(int index) { + return inputUris_.get(index); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + public com.google.protobuf.ByteString getInputUrisBytes(int index) { + return inputUris_.getByteString(index); + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The inputUris to set. + * @return This builder for chaining. + */ + public Builder setInputUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The inputUris to add. + * @return This builder for chaining. + */ + public Builder addAllInputUris(java.lang.Iterable values) { + ensureInputUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputUris_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUris() { + inputUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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,
+     * `gs://bucket/directory/object.json`) or a pattern matching one or more
+     * files, such as `gs://bucket/directory/*.json`. A request can
+     * contain at most 100 files, and each file can be up to 2 GB. See
+     * [Importing product
+     * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+     * for the expected file format and setup instructions.
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the inputUris to add. + * @return This builder for chaining. + */ + public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInputUrisIsMutable(); + inputUris_.add(value); + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2beta.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + public java.lang.String getDataSchema() { + java.lang.Object ref = dataSchema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataSchema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2beta.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + public com.google.protobuf.ByteString getDataSchemaBytes() { + java.lang.Object ref = dataSchema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataSchema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2beta.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @param value The dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataSchema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2beta.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + + dataSchema_ = getDefaultInstance().getDataSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     * Supported values for product imports:
+     * * `product` (default): One JSON
+     * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+     *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+     * * `product_merchant_center`: See [Importing catalog data from Merchant
+     *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+     * Supported values for user events imports:
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+     * * `user_event_ga360`: Using
+     *   https://support.google.com/analytics/answer/3437719.
+     * Supported values for control imports:
+     * * 'control' (default): One JSON
+     * [Control][google.cloud.retail.v2beta.Control] per line.
+     * Supported values for catalog attribute imports:
+     * * 'catalog_attribute' (default): One CSV
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+     * 
+ * + * string data_schema = 2; + * + * @param value The bytes for dataSchema to set. + * @return This builder for chaining. + */ + public Builder setDataSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataSchema_ = 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.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GcsSource) + private static final com.google.cloud.retail.v2beta.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GcsSource(); + } + + public static com.google.cloud.retail.v2beta.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsSource(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.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java new file mode 100644 index 00000000..7b16c116 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + java.util.List getInputUrisList(); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + int getInputUrisCount(); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The inputUris at the given index. + */ + java.lang.String getInputUris(int index); + /** + * + * + *
+   * 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,
+   * `gs://bucket/directory/object.json`) or a pattern matching one or more
+   * files, such as `gs://bucket/directory/*.json`. A request can
+   * contain at most 100 files, and each file can be up to 2 GB. See
+   * [Importing product
+   * information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)
+   * for the expected file format and setup instructions.
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the inputUris at the given index. + */ + com.google.protobuf.ByteString getInputUrisBytes(int index); + + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2beta.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The dataSchema. + */ + java.lang.String getDataSchema(); + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   * Supported values for product imports:
+   * * `product` (default): One JSON
+   * [Product][google.cloud.retail.v2beta.Product] per line. Each product must
+   *   have a valid [Product.id][google.cloud.retail.v2beta.Product.id].
+   * * `product_merchant_center`: See [Importing catalog data from Merchant
+   *   Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc).
+   * Supported values for user events imports:
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] per line.
+   * * `user_event_ga360`: Using
+   *   https://support.google.com/analytics/answer/3437719.
+   * Supported values for control imports:
+   * * 'control' (default): One JSON
+   * [Control][google.cloud.retail.v2beta.Control] per line.
+   * Supported values for catalog attribute imports:
+   * * 'catalog_attribute' (default): One CSV
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequest.java new file mode 100644 index 00000000..5f00dc22 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequest.java @@ -0,0 +1,664 @@ +/* + * 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.GetAttributesConfig][google.cloud.retail.v2beta.CatalogService.GetAttributesConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetAttributesConfigRequest} + */ +public final class GetAttributesConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetAttributesConfigRequest) + GetAttributesConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAttributesConfigRequest.newBuilder() to construct. + private GetAttributesConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAttributesConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAttributesConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAttributesConfigRequest( + 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest.class, + com.google.cloud.retail.v2beta.GetAttributesConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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.GetAttributesConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetAttributesConfigRequest other = + (com.google.cloud.retail.v2beta.GetAttributesConfigRequest) 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.GetAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest 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.GetAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest 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.GetAttributesConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest 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.GetAttributesConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest 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.GetAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest 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.GetAttributesConfigRequest 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.GetAttributesConfigRequest 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.GetAttributesConfigRequest 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.GetAttributesConfig][google.cloud.retail.v2beta.CatalogService.GetAttributesConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetAttributesConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetAttributesConfigRequest) + com.google.cloud.retail.v2beta.GetAttributesConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetAttributesConfigRequest.class, + com.google.cloud.retail.v2beta.GetAttributesConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetAttributesConfigRequest.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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetAttributesConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetAttributesConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetAttributesConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetAttributesConfigRequest build() { + com.google.cloud.retail.v2beta.GetAttributesConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetAttributesConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.GetAttributesConfigRequest result = + new com.google.cloud.retail.v2beta.GetAttributesConfigRequest(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.GetAttributesConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetAttributesConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetAttributesConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.GetAttributesConfigRequest.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.GetAttributesConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.GetAttributesConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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. Full AttributesConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+     * 
+ * + * + * 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.GetAttributesConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetAttributesConfigRequest) + private static final com.google.cloud.retail.v2beta.GetAttributesConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetAttributesConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.GetAttributesConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAttributesConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAttributesConfigRequest(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.GetAttributesConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequestOrBuilder.java new file mode 100644 index 00000000..ad5d1794 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetAttributesConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GetAttributesConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetAttributesConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full AttributesConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java new file mode 100644 index 00000000..fe43495a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java @@ -0,0 +1,664 @@ +/* + * 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.GetCompletionConfig][google.cloud.retail.v2beta.CatalogService.GetCompletionConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetCompletionConfigRequest} + */ +public final class GetCompletionConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetCompletionConfigRequest) + GetCompletionConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCompletionConfigRequest.newBuilder() to construct. + private GetCompletionConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCompletionConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCompletionConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetCompletionConfigRequest( + 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest.class, + com.google.cloud.retail.v2beta.GetCompletionConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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.GetCompletionConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetCompletionConfigRequest other = + (com.google.cloud.retail.v2beta.GetCompletionConfigRequest) 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.GetCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest 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.GetCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest 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.GetCompletionConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest 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.GetCompletionConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest 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.GetCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest 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.GetCompletionConfigRequest 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.GetCompletionConfigRequest 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.GetCompletionConfigRequest 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.GetCompletionConfig][google.cloud.retail.v2beta.CatalogService.GetCompletionConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetCompletionConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetCompletionConfigRequest) + com.google.cloud.retail.v2beta.GetCompletionConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetCompletionConfigRequest.class, + com.google.cloud.retail.v2beta.GetCompletionConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetCompletionConfigRequest.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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetCompletionConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetCompletionConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetCompletionConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetCompletionConfigRequest build() { + com.google.cloud.retail.v2beta.GetCompletionConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetCompletionConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.GetCompletionConfigRequest result = + new com.google.cloud.retail.v2beta.GetCompletionConfigRequest(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.GetCompletionConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetCompletionConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetCompletionConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.GetCompletionConfigRequest.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.GetCompletionConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.GetCompletionConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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. Full CompletionConfig resource name. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * 
+ * + * + * 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.GetCompletionConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetCompletionConfigRequest) + private static final com.google.cloud.retail.v2beta.GetCompletionConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetCompletionConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.GetCompletionConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCompletionConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCompletionConfigRequest(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.GetCompletionConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java new file mode 100644 index 00000000..5beb82f4 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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 GetCompletionConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetCompletionConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full CompletionConfig resource name. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java new file mode 100644 index 00000000..2f29398b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java @@ -0,0 +1,658 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for GetControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetControlRequest} + */ +public final class GetControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetControlRequest) + GetControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetControlRequest.newBuilder() to construct. + private GetControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetControlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetControlRequest( + 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_GetControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetControlRequest.class, + com.google.cloud.retail.v2beta.GetControlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.GetControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetControlRequest other = + (com.google.cloud.retail.v2beta.GetControlRequest) 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.GetControlRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest 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.GetControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest 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.GetControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest 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.GetControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest 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.GetControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest 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.GetControlRequest 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.GetControlRequest 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.GetControlRequest 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 GetControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetControlRequest) + com.google.cloud.retail.v2beta.GetControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_GetControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetControlRequest.class, + com.google.cloud.retail.v2beta.GetControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetControlRequest.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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_GetControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetControlRequest build() { + com.google.cloud.retail.v2beta.GetControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetControlRequest buildPartial() { + com.google.cloud.retail.v2beta.GetControlRequest result = + new com.google.cloud.retail.v2beta.GetControlRequest(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.GetControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetControlRequest other) { + if (other == com.google.cloud.retail.v2beta.GetControlRequest.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.GetControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.GetControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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.GetControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetControlRequest) + private static final com.google.cloud.retail.v2beta.GetControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetControlRequest(); + } + + public static com.google.cloud.retail.v2beta.GetControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetControlRequest(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.GetControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java new file mode 100644 index 00000000..380e3141 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface GetControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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 Control to delete. Format:
+   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequest.java new file mode 100644 index 00000000..ac0cf44b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequest.java @@ -0,0 +1,646 @@ +/* + * 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 message to show which branch is currently the default branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetDefaultBranchRequest} + */ +public final class GetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetDefaultBranchRequest) + GetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchRequest.newBuilder() to construct. + private GetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchRequest() { + catalog_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchRequest( + 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(); + + catalog_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2beta.GetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + 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.GetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetDefaultBranchRequest other = + (com.google.cloud.retail.v2beta.GetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest 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.GetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest 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.GetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest 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.GetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest 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.GetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest 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.GetDefaultBranchRequest 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.GetDefaultBranchRequest 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.GetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to show which branch is currently the default branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetDefaultBranchRequest) + com.google.cloud.retail.v2beta.GetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetDefaultBranchRequest.class, + com.google.cloud.retail.v2beta.GetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetDefaultBranchRequest.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(); + catalog_ = ""; + + 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_GetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchRequest build() { + com.google.cloud.retail.v2beta.GetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2beta.GetDefaultBranchRequest result = + new com.google.cloud.retail.v2beta.GetDefaultBranchRequest(this); + result.catalog_ = catalog_; + 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.GetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2beta.GetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + 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.GetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.GetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent catalog resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + 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.GetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetDefaultBranchRequest) + private static final com.google.cloud.retail.v2beta.GetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchRequest(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.GetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..4822bce8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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 GetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * The parent catalog resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponse.java new file mode 100644 index 00000000..cc10ce32 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponse.java @@ -0,0 +1,1102 @@ +/* + * 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 message of
+ * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetDefaultBranchResponse} + */ +public final class GetDefaultBranchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetDefaultBranchResponse) + GetDefaultBranchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDefaultBranchResponse.newBuilder() to construct. + private GetDefaultBranchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDefaultBranchResponse() { + branch_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDefaultBranchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDefaultBranchResponse( + 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(); + + branch_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse.Builder.class); + } + + public static final int BRANCH_FIELD_NUMBER = 1; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + 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(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SET_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + 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(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = 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(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, branch_); + } + if (setTime_ != null) { + output.writeMessage(2, getSetTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + 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(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, branch_); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + 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.GetDefaultBranchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetDefaultBranchResponse other = + (com.google.cloud.retail.v2beta.GetDefaultBranchResponse) obj; + + if (!getBranch().equals(other.getBranch())) return false; + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (!getNote().equals(other.getNote())) 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) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse 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.GetDefaultBranchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse 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.GetDefaultBranchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse 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.GetDefaultBranchResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse 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.GetDefaultBranchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse 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.GetDefaultBranchResponse 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.GetDefaultBranchResponse 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.GetDefaultBranchResponse 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 message of
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetDefaultBranchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetDefaultBranchResponse) + com.google.cloud.retail.v2beta.GetDefaultBranchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_GetDefaultBranchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetDefaultBranchResponse.class, + com.google.cloud.retail.v2beta.GetDefaultBranchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetDefaultBranchResponse.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(); + branch_ = ""; + + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + note_ = ""; + + 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_GetDefaultBranchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetDefaultBranchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchResponse build() { + com.google.cloud.retail.v2beta.GetDefaultBranchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetDefaultBranchResponse buildPartial() { + com.google.cloud.retail.v2beta.GetDefaultBranchResponse result = + new com.google.cloud.retail.v2beta.GetDefaultBranchResponse(this); + result.branch_ = branch_; + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.note_ = note_; + 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.GetDefaultBranchResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.GetDefaultBranchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetDefaultBranchResponse other) { + if (other == com.google.cloud.retail.v2beta.GetDefaultBranchResponse.getDefaultInstance()) + return this; + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + 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.GetDefaultBranchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.GetDefaultBranchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the branch id currently set as default branch.
+     * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when this branch is set to default.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * This corresponds to
+     * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+     * field, when this branch was set as default.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = 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.GetDefaultBranchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetDefaultBranchResponse) + private static final com.google.cloud.retail.v2beta.GetDefaultBranchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetDefaultBranchResponse(); + } + + public static com.google.cloud.retail.v2beta.GetDefaultBranchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDefaultBranchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDefaultBranchResponse(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.GetDefaultBranchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponseOrBuilder.java new file mode 100644 index 00000000..a70d32ff --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetDefaultBranchResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * 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 GetDefaultBranchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetDefaultBranchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * Full resource name of the branch id currently set as default branch.
+   * 
+ * + * string branch = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when this branch is set to default.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * This corresponds to
+   * [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note]
+   * field, when this branch was set as default.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequest.java new file mode 100644 index 00000000..66a4cc78 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequest.java @@ -0,0 +1,700 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [GetProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetProductRequest} + */ +public final class GetProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetProductRequest) + GetProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProductRequest.newBuilder() to construct. + private GetProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProductRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProductRequest( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetProductRequest.class, + com.google.cloud.retail.v2beta.GetProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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.GetProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetProductRequest other = + (com.google.cloud.retail.v2beta.GetProductRequest) 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.GetProductRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest 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.GetProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest 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.GetProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest 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.GetProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest 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.GetProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest 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.GetProductRequest 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.GetProductRequest 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.GetProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetProductRequest) + com.google.cloud.retail.v2beta.GetProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_GetProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetProductRequest.class, + com.google.cloud.retail.v2beta.GetProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetProductRequest.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetProductRequest build() { + com.google.cloud.retail.v2beta.GetProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetProductRequest buildPartial() { + com.google.cloud.retail.v2beta.GetProductRequest result = + new com.google.cloud.retail.v2beta.GetProductRequest(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.GetProductRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetProductRequest other) { + if (other == com.google.cloud.retail.v2beta.GetProductRequest.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.GetProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.GetProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * 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.GetProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetProductRequest) + private static final com.google.cloud.retail.v2beta.GetProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetProductRequest(); + } + + public static com.google.cloud.retail.v2beta.GetProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProductRequest(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.GetProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequestOrBuilder.java new file mode 100644 index 00000000..c792ed02 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetProductRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface GetProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the requested [Product][google.cloud.retail.v2beta.Product] does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java new file mode 100644 index 00000000..a47c1901 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java @@ -0,0 +1,660 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for GetServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetServingConfigRequest} + */ +public final class GetServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.GetServingConfigRequest) + GetServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServingConfigRequest.newBuilder() to construct. + private GetServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServingConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServingConfigRequest( + 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetServingConfigRequest.class, + com.google.cloud.retail.v2beta.GetServingConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @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.GetServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.GetServingConfigRequest other = + (com.google.cloud.retail.v2beta.GetServingConfigRequest) 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.GetServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest 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.GetServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest 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.GetServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest 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.GetServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest 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.GetServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest 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.GetServingConfigRequest 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.GetServingConfigRequest 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.GetServingConfigRequest 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 GetServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.GetServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.GetServingConfigRequest) + com.google.cloud.retail.v2beta.GetServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.GetServingConfigRequest.class, + com.google.cloud.retail.v2beta.GetServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.GetServingConfigRequest.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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.GetServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetServingConfigRequest build() { + com.google.cloud.retail.v2beta.GetServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.GetServingConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.GetServingConfigRequest result = + new com.google.cloud.retail.v2beta.GetServingConfigRequest(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.GetServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.GetServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.GetServingConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.GetServingConfigRequest.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.GetServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.GetServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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 ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ServingConfig to get. Format:
+     * 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) = { ... } + * + * + * @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.GetServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.GetServingConfigRequest) + private static final com.google.cloud.retail.v2beta.GetServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.GetServingConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.GetServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServingConfigRequest(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.GetServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..4345869c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface GetServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.GetServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ServingConfig to get. Format:
+   * 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) = { ... } + * + * + * @return The name. + */ + 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}
+   * 
+ * + * + * 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Image.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Image.java new file mode 100644 index 00000000..92f85002 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Image.java @@ -0,0 +1,870 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * [Product][google.cloud.retail.v2beta.Product] image. Recommendations AI and
+ * Retail Search do not use product images to improve prediction and search
+ * results. However, product images can be returned in results, and are shown in
+ * prediction or search previews in the console.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Image} + */ +public final class Image extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Image() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Image(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Image( + 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(); + + uri_ = s; + break; + } + case 16: + { + height_ = input.readInt32(); + break; + } + case 24: + { + width_ = input.readInt32(); + 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Image.class, + com.google.cloud.retail.v2beta.Image.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private int height_; + /** + * + * + *
+   * Height of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 height = 2; + * + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 3; + private int width_; + /** + * + * + *
+   * Width of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 width = 3; + * + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + + 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(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (height_ != 0) { + output.writeInt32(2, height_); + } + if (width_ != 0) { + output.writeInt32(3, width_); + } + 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(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, height_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, width_); + } + 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.Image)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Image other = (com.google.cloud.retail.v2beta.Image) obj; + + if (!getUri().equals(other.getUri())) return false; + if (getHeight() != other.getHeight()) return false; + if (getWidth() != other.getWidth()) 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Image parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Image 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.Image parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Image 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.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Image 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.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Image 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.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Image 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.Image 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.Image 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.Image 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; + } + /** + * + * + *
+   * [Product][google.cloud.retail.v2beta.Product] image. Recommendations AI and
+   * Retail Search do not use product images to improve prediction and search
+   * results. However, product images can be returned in results, and are shown in
+   * prediction or search previews in the console.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Image} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Image) + com.google.cloud.retail.v2beta.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Image.class, + com.google.cloud.retail.v2beta.Image.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Image.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(); + uri_ = ""; + + height_ = 0; + + width_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Image_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Image getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Image.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Image build() { + com.google.cloud.retail.v2beta.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Image buildPartial() { + com.google.cloud.retail.v2beta.Image result = new com.google.cloud.retail.v2beta.Image(this); + result.uri_ = uri_; + result.height_ = height_; + result.width_ = width_; + 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.Image) { + return mergeFrom((com.google.cloud.retail.v2beta.Image) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Image other) { + if (other == com.google.cloud.retail.v2beta.Image.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + 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.Image parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Image) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of the image.
+     * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int height_; + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + + height_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Height of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 height = 2; + * + * @return This builder for chaining. + */ + public Builder clearHeight() { + + height_ = 0; + onChanged(); + return this; + } + + private int width_; + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Width of the image in number of pixels.
+     * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 width = 3; + * + * @return This builder for chaining. + */ + public Builder clearWidth() { + + width_ = 0; + 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.Image) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Image) + private static final com.google.cloud.retail.v2beta.Image DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Image(); + } + + public static com.google.cloud.retail.v2beta.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Image(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.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImageOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImageOrBuilder.java new file mode 100644 index 00000000..b3734ba5 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImageOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface ImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Image) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. URI of the image.
+   * This field must be a valid UTF-8 encoded URI with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Height of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 height = 2; + * + * @return The height. + */ + int getHeight(); + + /** + * + * + *
+   * Width of the image in number of pixels.
+   * This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 width = 3; + * + * @return The width. + */ + int getWidth(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java new file mode 100644 index 00000000..4aa68aa6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java @@ -0,0 +1,1174 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for ImportCompletionData methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportCompletionDataRequest} + */ +public final class ImportCompletionDataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportCompletionDataRequest) + ImportCompletionDataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataRequest.newBuilder() to construct. + private ImportCompletionDataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataRequest() { + parent_ = ""; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataRequest( + 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.CompletionDataInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2beta.ImportCompletionDataRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * 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 INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.CompletionDataInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 3; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, notificationPubsubTopic_); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, notificationPubsubTopic_); + } + 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.ImportCompletionDataRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportCompletionDataRequest other = + (com.google.cloud.retail.v2beta.ImportCompletionDataRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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 (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest 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.ImportCompletionDataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest 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.ImportCompletionDataRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest 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.ImportCompletionDataRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest 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.ImportCompletionDataRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest 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.ImportCompletionDataRequest 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.ImportCompletionDataRequest 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.ImportCompletionDataRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ImportCompletionData methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportCompletionDataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportCompletionDataRequest) + com.google.cloud.retail.v2beta.ImportCompletionDataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportCompletionDataRequest.class, + com.google.cloud.retail.v2beta.ImportCompletionDataRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportCompletionDataRequest.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 (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportCompletionDataRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataRequest build() { + com.google.cloud.retail.v2beta.ImportCompletionDataRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataRequest buildPartial() { + com.google.cloud.retail.v2beta.ImportCompletionDataRequest result = + new com.google.cloud.retail.v2beta.ImportCompletionDataRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.ImportCompletionDataRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportCompletionDataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportCompletionDataRequest other) { + if (other == com.google.cloud.retail.v2beta.ImportCompletionDataRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.ImportCompletionDataRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportCompletionDataRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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 catalog which the suggestions dataset belongs to.
+     * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * + * 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.CompletionDataInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig( + com.google.cloud.retail.v2beta.CompletionDataInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2beta.CompletionDataInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder + getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder + getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionDataInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDataInputConfig, + com.google.cloud.retail.v2beta.CompletionDataInputConfig.Builder, + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 3; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.ImportCompletionDataRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportCompletionDataRequest) + private static final com.google.cloud.retail.v2beta.ImportCompletionDataRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportCompletionDataRequest(); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataRequest(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.ImportCompletionDataRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java new file mode 100644 index 00000000..4b00a5f0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportCompletionDataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportCompletionDataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The catalog which the suggestions dataset belongs to.
+   * Format: `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionDataInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.CompletionDataInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 3; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponse.java new file mode 100644 index 00000000..ba2c7c2d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponse.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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the
+ * [ImportCompletionDataRequest][google.cloud.retail.v2beta.ImportCompletionDataRequest].
+ * If the long running operation is done, this message is returned by the
+ * google.longrunning.Operations.response field if the operation is successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportCompletionDataResponse} + */ +public final class ImportCompletionDataResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportCompletionDataResponse) + ImportCompletionDataResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportCompletionDataResponse.newBuilder() to construct. + private ImportCompletionDataResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportCompletionDataResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportCompletionDataResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportCompletionDataResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.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)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2beta.ImportCompletionDataResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + 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.ImportCompletionDataResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportCompletionDataResponse other = + (com.google.cloud.retail.v2beta.ImportCompletionDataResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse 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.ImportCompletionDataResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse 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.ImportCompletionDataResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse 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.ImportCompletionDataResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse 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.ImportCompletionDataResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse 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.ImportCompletionDataResponse 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.ImportCompletionDataResponse 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.ImportCompletionDataResponse 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
+   * [ImportCompletionDataRequest][google.cloud.retail.v2beta.ImportCompletionDataRequest].
+   * If the long running operation is done, this message is returned by the
+   * google.longrunning.Operations.response field if the operation is successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportCompletionDataResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportCompletionDataResponse) + com.google.cloud.retail.v2beta.ImportCompletionDataResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportCompletionDataResponse.class, + com.google.cloud.retail.v2beta.ImportCompletionDataResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportCompletionDataResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportCompletionDataResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataResponse build() { + com.google.cloud.retail.v2beta.ImportCompletionDataResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportCompletionDataResponse buildPartial() { + com.google.cloud.retail.v2beta.ImportCompletionDataResponse result = + new com.google.cloud.retail.v2beta.ImportCompletionDataResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.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.ImportCompletionDataResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportCompletionDataResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportCompletionDataResponse other) { + if (other == com.google.cloud.retail.v2beta.ImportCompletionDataResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + 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.ImportCompletionDataResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportCompletionDataResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + @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.ImportCompletionDataResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportCompletionDataResponse) + private static final com.google.cloud.retail.v2beta.ImportCompletionDataResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportCompletionDataResponse(); + } + + public static com.google.cloud.retail.v2beta.ImportCompletionDataResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportCompletionDataResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportCompletionDataResponse(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.ImportCompletionDataResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponseOrBuilder.java new file mode 100644 index 00000000..dae5d8e6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataResponseOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportCompletionDataResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportCompletionDataResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportConfigProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportConfigProto.java new file mode 100644 index 00000000..f1644a69 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportConfigProto.java @@ -0,0 +1,364 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public final class ImportConfigProto { + private ImportConfigProto() {} + + 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_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_BigQuerySource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ProductInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserEventInlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ProductInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserEventInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserEventImportSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_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/import_conf" + + "ig.proto\022\032google.cloud.retail.v2beta\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\032(google/cloud/retail/v2" + + "beta/product.proto\032+google/cloud/retail/" + + "v2beta/user_event.proto\032 google/protobuf" + + "/field_mask.proto\032\037google/protobuf/times" + + "tamp.proto\032\027google/rpc/status.proto\032\026goo" + + "gle/type/date.proto\"9\n\tGcsSource\022\027\n\ninpu" + + "t_uris\030\001 \003(\tB\003\340A\002\022\023\n\013data_schema\030\002 \001(\t\"\274" + + "\001\n\016BigQuerySource\022+\n\016partition_date\030\006 \001(" + + "\0132\021.google.type.DateH\000\022\022\n\nproject_id\030\005 \001" + + "(\t\022\027\n\ndataset_id\030\001 \001(\tB\003\340A\002\022\025\n\010table_id\030" + + "\002 \001(\tB\003\340A\002\022\027\n\017gcs_staging_dir\030\003 \001(\t\022\023\n\013d" + + "ata_schema\030\004 \001(\tB\013\n\tpartition\"Q\n\023Product" + + "InlineSource\022:\n\010products\030\001 \003(\0132#.google." + + "cloud.retail.v2beta.ProductB\003\340A\002\"X\n\025User" + + "EventInlineSource\022?\n\013user_events\030\001 \003(\0132%" + + ".google.cloud.retail.v2beta.UserEventB\003\340" + + "A\002\"9\n\022ImportErrorsConfig\022\024\n\ngcs_prefix\030\001" + + " \001(\tH\000B\r\n\013destination\"\204\004\n\025ImportProducts" + + "Request\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034retail." + + "googleapis.com/Branch\022\026\n\nrequest_id\030\006 \001(" + + "\tB\002\030\001\022I\n\014input_config\030\002 \001(\0132..google.clo" + + "ud.retail.v2beta.ProductInputConfigB\003\340A\002" + + "\022E\n\rerrors_config\030\003 \001(\0132..google.cloud.r" + + "etail.v2beta.ImportErrorsConfig\022/\n\013updat" + + "e_mask\030\004 \001(\0132\032.google.protobuf.FieldMask" + + "\022a\n\023reconciliation_mode\030\005 \001(\0162D.google.c" + + "loud.retail.v2beta.ImportProductsRequest" + + ".ReconciliationMode\022!\n\031notification_pubs" + + "ub_topic\030\007 \001(\t\"T\n\022ReconciliationMode\022#\n\037" + + "RECONCILIATION_MODE_UNSPECIFIED\020\000\022\017\n\013INC" + + "REMENTAL\020\001\022\010\n\004FULL\020\002\"\344\001\n\027ImportUserEvent" + + "sRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035retail" + + ".googleapis.com/Catalog\022K\n\014input_config\030" + + "\002 \001(\01320.google.cloud.retail.v2beta.UserE" + + "ventInputConfigB\003\340A\002\022E\n\rerrors_config\030\003 " + + "\001(\0132..google.cloud.retail.v2beta.ImportE" + + "rrorsConfig\"\311\001\n\033ImportCompletionDataRequ" + + "est\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\n\035retail.goog" + + "leapis.com/Catalog\022P\n\014input_config\030\002 \001(\013" + + "25.google.cloud.retail.v2beta.Completion" + + "DataInputConfigB\003\340A\002\022!\n\031notification_pub" + + "sub_topic\030\003 \001(\t\"\365\001\n\022ProductInputConfig\022P" + + "\n\025product_inline_source\030\001 \001(\0132/.google.c" + + "loud.retail.v2beta.ProductInlineSourceH\000" + + "\022;\n\ngcs_source\030\002 \001(\0132%.google.cloud.reta" + + "il.v2beta.GcsSourceH\000\022F\n\020big_query_sourc" + + "e\030\003 \001(\0132*.google.cloud.retail.v2beta.Big" + + "QuerySourceH\000B\010\n\006source\"\213\002\n\024UserEventInp" + + "utConfig\022Z\n\030user_event_inline_source\030\001 \001" + + "(\01321.google.cloud.retail.v2beta.UserEven" + + "tInlineSourceB\003\340A\002H\000\022@\n\ngcs_source\030\002 \001(\013" + + "2%.google.cloud.retail.v2beta.GcsSourceB" + + "\003\340A\002H\000\022K\n\020big_query_source\030\003 \001(\0132*.googl" + + "e.cloud.retail.v2beta.BigQuerySourceB\003\340A" + + "\002H\000B\010\n\006source\"r\n\031CompletionDataInputConf" + + "ig\022K\n\020big_query_source\030\001 \001(\0132*.google.cl" + + "oud.retail.v2beta.BigQuerySourceB\003\340A\002H\000B" + + "\010\n\006source\"\333\001\n\016ImportMetadata\022/\n\013create_t" + + "ime\030\001 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013update_time\030\002 \001(\0132\032.google.protobuf.Tim" + + "estamp\022\025\n\rsuccess_count\030\003 \001(\003\022\025\n\rfailure" + + "_count\030\004 \001(\003\022\026\n\nrequest_id\030\005 \001(\tB\002\030\001\022!\n\031" + + "notification_pubsub_topic\030\006 \001(\t\"\212\001\n\026Impo" + + "rtProductsResponse\022)\n\rerror_samples\030\001 \003(" + + "\0132\022.google.rpc.Status\022E\n\rerrors_config\030\002" + + " \001(\0132..google.cloud.retail.v2beta.Import" + + "ErrorsConfig\"\330\001\n\030ImportUserEventsRespons" + + "e\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc.St" + + "atus\022E\n\rerrors_config\030\002 \001(\0132..google.clo" + + "ud.retail.v2beta.ImportErrorsConfig\022J\n\016i" + + "mport_summary\030\003 \001(\01322.google.cloud.retai" + + "l.v2beta.UserEventImportSummary\"T\n\026UserE" + + "ventImportSummary\022\033\n\023joined_events_count" + + "\030\001 \001(\003\022\035\n\025unjoined_events_count\030\002 \001(\003\"I\n" + + "\034ImportCompletionDataResponse\022)\n\rerror_s" + + "amples\030\001 \003(\0132\022.google.rpc.StatusB\332\001\n\036com" + + ".google.cloud.retail.v2betaB\021ImportConfi" + + "gProtoP\001Z@google.golang.org/genproto/goo" + + "gleapis/cloud/retail/v2beta;retail\242\002\006RET" + + "AIL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Googl" + + "e\\Cloud\\Retail\\V2beta\352\002\035Google::Cloud::R" + + "etail::V2betab\006proto3" + }; + 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.ProductProto.getDescriptor(), + com.google.cloud.retail.v2beta.UserEventProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GcsSource_descriptor, + new java.lang.String[] { + "InputUris", "DataSchema", + }); + internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_BigQuerySource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_BigQuerySource_descriptor, + new java.lang.String[] { + "PartitionDate", + "ProjectId", + "DatasetId", + "TableId", + "GcsStagingDir", + "DataSchema", + "Partition", + }); + internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_ProductInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor, + new java.lang.String[] { + "Products", + }); + internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_UserEventInlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor, + new java.lang.String[] { + "UserEvents", + }); + internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_ImportProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor, + new java.lang.String[] { + "Parent", + "RequestId", + "InputConfig", + "ErrorsConfig", + "UpdateMask", + "ReconciliationMode", + "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "InputConfig", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportCompletionDataRequest_descriptor, + new java.lang.String[] { + "Parent", "InputConfig", "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2beta_ProductInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor, + new java.lang.String[] { + "ProductInlineSource", "GcsSource", "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2beta_UserEventInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor, + new java.lang.String[] { + "UserEventInlineSource", "GcsSource", "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompletionDataInputConfig_descriptor, + new java.lang.String[] { + "BigQuerySource", "Source", + }); + internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2beta_ImportMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "UpdateTime", + "SuccessCount", + "FailureCount", + "RequestId", + "NotificationPubsubTopic", + }); + internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2beta_ImportProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", + }); + internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", "ImportSummary", + }); + internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_retail_v2beta_UserEventImportSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor, + new java.lang.String[] { + "JoinedEventsCount", "UnjoinedEventsCount", + }); + internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ImportCompletionDataResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(); + com.google.cloud.retail.v2beta.UserEventProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java new file mode 100644 index 00000000..9c8d93fe --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java @@ -0,0 +1,795 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Configuration of destination for Import related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportErrorsConfig} + */ +public final class ImportErrorsConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportErrorsConfig) + ImportErrorsConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportErrorsConfig.newBuilder() to construct. + private ImportErrorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportErrorsConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportErrorsConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportErrorsConfig( + 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(); + destinationCase_ = 1; + destination_ = 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportErrorsConfig.class, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_PREFIX(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_PREFIX; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_PREFIX_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + 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(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = 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 (destinationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + 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.ImportErrorsConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportErrorsConfig other = + (com.google.cloud.retail.v2beta.ImportErrorsConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 0: + default: + } + 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(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig 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.ImportErrorsConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig 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.ImportErrorsConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig 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.ImportErrorsConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig 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.ImportErrorsConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig 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.ImportErrorsConfig 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.ImportErrorsConfig 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.ImportErrorsConfig 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; + } + /** + * + * + *
+   * Configuration of destination for Import related errors.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportErrorsConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportErrorsConfig) + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportErrorsConfig.class, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportErrorsConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportErrorsConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig build() { + com.google.cloud.retail.v2beta.ImportErrorsConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig buildPartial() { + com.google.cloud.retail.v2beta.ImportErrorsConfig result = + new com.google.cloud.retail.v2beta.ImportErrorsConfig(this); + if (destinationCase_ == 1) { + result.destination_ = destination_; + } + result.destinationCase_ = destinationCase_; + 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.ImportErrorsConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportErrorsConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportErrorsConfig other) { + if (other == com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + 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.ImportErrorsConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportErrorsConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + @java.lang.Override + public java.lang.String getGcsPrefix() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (destinationCase_ == 1) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGcsPrefixBytes() { + java.lang.Object ref = ""; + if (destinationCase_ == 1) { + ref = destination_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (destinationCase_ == 1) { + destination_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationCase_ = 1; + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors will be written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @param value The bytes for gcsPrefix to set. + * @return This builder for chaining. + */ + public Builder setGcsPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationCase_ = 1; + destination_ = 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.ImportErrorsConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportErrorsConfig) + private static final com.google.cloud.retail.v2beta.ImportErrorsConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportErrorsConfig(); + } + + public static com.google.cloud.retail.v2beta.ImportErrorsConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportErrorsConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportErrorsConfig(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.ImportErrorsConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java new file mode 100644 index 00000000..e202de4f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportErrorsConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportErrorsConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * Google Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors will be written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + 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
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + public com.google.cloud.retail.v2beta.ImportErrorsConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java new file mode 100644 index 00000000..72125695 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java @@ -0,0 +1,1602 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the Import operation. This will be
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportMetadata} + */ +public final class ImportMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportMetadata) + ImportMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportMetadata.newBuilder() to construct. + private ImportMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportMetadata() { + requestId_ = ""; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportMetadata( + 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.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 18: + { + 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 24: + { + successCount_ = input.readInt64(); + break; + } + case 32: + { + failureCount_ = input.readInt64(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportMetadata.class, + com.google.cloud.retail.v2beta.ImportMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_; + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + + public static final int FAILURE_COUNT_FIELD_NUMBER = 4; + private long failureCount_; + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * 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=341 + * @return The requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * 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=341 + * @return The bytes for requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 6; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(2, getUpdateTime()); + } + if (successCount_ != 0L) { + output.writeInt64(3, successCount_); + } + if (failureCount_ != 0L) { + output.writeInt64(4, failureCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, notificationPubsubTopic_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateTime()); + } + if (successCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, successCount_); + } + if (failureCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, failureCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, notificationPubsubTopic_); + } + 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.ImportMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportMetadata other = + (com.google.cloud.retail.v2beta.ImportMetadata) obj; + + 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 (getSuccessCount() != other.getSuccessCount()) return false; + if (getFailureCount() != other.getFailureCount()) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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 (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) + SUCCESS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSuccessCount()); + hash = (37 * hash) + FAILURE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailureCount()); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata 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.ImportMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata 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.ImportMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata 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.ImportMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata 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.ImportMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata 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.ImportMetadata 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.ImportMetadata 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.ImportMetadata 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 related to the progress of the Import operation. This will be
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportMetadata) + com.google.cloud.retail.v2beta.ImportMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportMetadata.class, + com.google.cloud.retail.v2beta.ImportMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportMetadata.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 (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + successCount_ = 0L; + + failureCount_ = 0L; + + requestId_ = ""; + + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportMetadata build() { + com.google.cloud.retail.v2beta.ImportMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportMetadata buildPartial() { + com.google.cloud.retail.v2beta.ImportMetadata result = + new com.google.cloud.retail.v2beta.ImportMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.successCount_ = successCount_; + result.failureCount_ = failureCount_; + result.requestId_ = requestId_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.ImportMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportMetadata other) { + if (other == com.google.cloud.retail.v2beta.ImportMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getSuccessCount() != 0L) { + setSuccessCount(other.getSuccessCount()); + } + if (other.getFailureCount() != 0L) { + setFailureCount(other.getFailureCount()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.ImportMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ImportMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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_; + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + 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_; + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Operation last update time. If the operation is done, this is also the
+     * finish time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + 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 long successCount_; + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + @java.lang.Override + public long getSuccessCount() { + return successCount_; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @param value The successCount to set. + * @return This builder for chaining. + */ + public Builder setSuccessCount(long value) { + + successCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + + successCount_ = 0L; + onChanged(); + return this; + } + + private long failureCount_; + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + @java.lang.Override + public long getFailureCount() { + return failureCount_; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @param value The failureCount to set. + * @return This builder for chaining. + */ + public Builder setFailureCount(long value) { + + failureCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + + failureCount_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * 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=341 + * @return The requestId. + */ + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * 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=341 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * 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=341 + * @param value The requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * 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=341 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field is never set.
+     * 
+ * + * 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=341 + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * 
+ * + * string notification_pubsub_topic = 6; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.ImportMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportMetadata) + private static final com.google.cloud.retail.v2beta.ImportMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportMetadata(); + } + + public static com.google.cloud.retail.v2beta.ImportMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportMetadata(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.ImportMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java new file mode 100644 index 00000000..e8f67844 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java @@ -0,0 +1,188 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Operation create time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Operation last update time. If the operation is done, this is also the
+   * finish time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Count of entries that were processed successfully.
+   * 
+ * + * int64 success_count = 3; + * + * @return The successCount. + */ + long getSuccessCount(); + + /** + * + * + *
+   * Count of entries that encountered errors while processing.
+   * 
+ * + * int64 failure_count = 4; + * + * @return The failureCount. + */ + long getFailureCount(); + + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * 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=341 + * @return The requestId. + */ + @java.lang.Deprecated + java.lang.String getRequestId(); + /** + * + * + *
+   * Deprecated. This field is never set.
+   * 
+ * + * 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=341 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * 
+ * + * string notification_pubsub_topic = 6; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java new file mode 100644 index 00000000..a031b7e0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java @@ -0,0 +1,2341 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for Import methods.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportProductsRequest} + */ +public final class ImportProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportProductsRequest) + ImportProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportProductsRequest.newBuilder() to construct. + private ImportProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportProductsRequest() { + parent_ = ""; + requestId_ = ""; + reconciliationMode_ = 0; + notificationPubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportProductsRequest( + 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.ProductInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ProductInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + 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; + } + case 40: + { + int rawValue = input.readEnum(); + + reconciliationMode_ = rawValue; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationPubsubTopic_ = 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportProductsRequest.class, + com.google.cloud.retail.v2beta.ImportProductsRequest.Builder.class); + } + + /** + * + * + *
+   * Indicates how imported products are reconciled with the existing products
+   * created or imported before.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode} + */ + public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + RECONCILIATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + INCREMENTAL(1), + /** + * + * + *
+     * 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; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Defaults to INCREMENTAL.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + public static final int RECONCILIATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Inserts new products or updates existing products.
+     * 
+ * + * INCREMENTAL = 1; + */ + public static final int INCREMENTAL_VALUE = 1; + /** + * + * + *
+     * 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; + */ + public static final int FULL_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 ReconciliationMode 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 ReconciliationMode forNumber(int value) { + switch (value) { + case 0: + return RECONCILIATION_MODE_UNSPECIFIED; + case 1: + return INCREMENTAL; + case 2: + return FULL; + 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 ReconciliationMode findValueByNumber(int number) { + return ReconciliationMode.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.ImportProductsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ReconciliationMode[] VALUES = values(); + + public static ReconciliationMode 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 ReconciliationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode) + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * 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.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * 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 REQUEST_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * 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 + * @return The requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * 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 + * @return The bytes for requestId. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ProductInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int RECONCILIATION_MODE_FIELD_NUMBER = 5; + private int reconciliationMode_; + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + + public static final int NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER = 7; + private volatile java.lang.Object notificationPubsubTopic_; + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + @java.lang.Override + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + 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(); + notificationPubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(3, getErrorsConfig()); + } + if (updateMask_ != null) { + output.writeMessage(4, getUpdateMask()); + } + if (reconciliationMode_ + != com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, reconciliationMode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, notificationPubsubTopic_); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getErrorsConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + if (reconciliationMode_ + != com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, reconciliationMode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(notificationPubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, notificationPubsubTopic_); + } + 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.ImportProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportProductsRequest other = + (com.google.cloud.retail.v2beta.ImportProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (reconciliationMode_ != other.reconciliationMode_) return false; + if (!getNotificationPubsubTopic().equals(other.getNotificationPubsubTopic())) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + RECONCILIATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + reconciliationMode_; + hash = (37 * hash) + NOTIFICATION_PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getNotificationPubsubTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest 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.ImportProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest 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.ImportProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest 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.ImportProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest 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.ImportProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest 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.ImportProductsRequest 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.ImportProductsRequest 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.ImportProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Import methods.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportProductsRequest) + com.google.cloud.retail.v2beta.ImportProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportProductsRequest.class, + com.google.cloud.retail.v2beta.ImportProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportProductsRequest.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_ = ""; + + requestId_ = ""; + + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + reconciliationMode_ = 0; + + notificationPubsubTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsRequest build() { + com.google.cloud.retail.v2beta.ImportProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsRequest buildPartial() { + com.google.cloud.retail.v2beta.ImportProductsRequest result = + new com.google.cloud.retail.v2beta.ImportProductsRequest(this); + result.parent_ = parent_; + result.requestId_ = requestId_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.reconciliationMode_ = reconciliationMode_; + result.notificationPubsubTopic_ = notificationPubsubTopic_; + 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.ImportProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportProductsRequest other) { + if (other == com.google.cloud.retail.v2beta.ImportProductsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.reconciliationMode_ != 0) { + setReconciliationModeValue(other.getReconciliationModeValue()); + } + if (!other.getNotificationPubsubTopic().isEmpty()) { + notificationPubsubTopic_ = other.notificationPubsubTopic_; + 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.ImportProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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.
+     * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+     * If no updateMask is specified, requires products.create permission.
+     * If updateMask is specified, requires products.update permission.
+     * 
+ * + * + * 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 java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * 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 + * @return The requestId. + */ + @java.lang.Deprecated + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * 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 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * 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 + * @param value The requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * 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 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated. This field has no effect.
+     * 
+ * + * 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 + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.ProductInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInputConfig, + com.google.cloud.retail.v2beta.ProductInputConfig.Builder, + com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2beta.ProductInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2beta.ProductInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2beta.ProductInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.cloud.retail.v2beta.ProductInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2beta.ProductInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.ProductInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInputConfig, + com.google.cloud.retail.v2beta.ProductInputConfig.Builder, + com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInputConfig, + com.google.cloud.retail.v2beta.ProductInputConfig.Builder, + com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided imported 'products' to update. If
+     * not set, will by default update all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + 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_; + } + + private int reconciliationMode_ = 0; + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The enum numeric value on the wire for reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationModeValue(int value) { + + reconciliationMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode + getReconciliationMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode result = + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.valueOf( + reconciliationMode_); + return result == null + ? com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @param value The reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationMode( + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode value) { + if (value == null) { + throw new NullPointerException(); + } + + reconciliationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing products and the products to be
+     * imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearReconciliationMode() { + + reconciliationMode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object notificationPubsubTopic_ = ""; + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + public java.lang.String getNotificationPubsubTopic() { + java.lang.Object ref = notificationPubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationPubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { + java.lang.Object ref = notificationPubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationPubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationPubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @return This builder for chaining. + */ + public Builder clearNotificationPubsubTopic() { + + notificationPubsubTopic_ = getDefaultInstance().getNotificationPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * [Operation][google.longrunning.Operation].
+     * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+     * Only supported when
+     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+     * is set to `FULL`.
+     * 
+ * + * string notification_pubsub_topic = 7; + * + * @param value The bytes for notificationPubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setNotificationPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationPubsubTopic_ = 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.ImportProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportProductsRequest) + private static final com.google.cloud.retail.v2beta.ImportProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportProductsRequest(); + } + + public static com.google.cloud.retail.v2beta.ImportProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductsRequest(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.ImportProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java new file mode 100644 index 00000000..80021275 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java @@ -0,0 +1,277 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required.
+   * `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch`
+   * If no updateMask is specified, requires products.create permission.
+   * If updateMask is specified, requires products.update permission.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * 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 + * @return The requestId. + */ + @java.lang.Deprecated + java.lang.String getRequestId(); + /** + * + * + *
+   * Deprecated. This field has no effect.
+   * 
+ * + * 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 + * @return The bytes for requestId. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2beta.ProductInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ProductInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided imported 'products' to update. If
+   * not set, will by default update all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + int getReconciliationModeValue(); + /** + * + * + *
+   * The mode of reconciliation between existing products and the products to be
+   * imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode reconciliation_mode = 5; + * + * + * @return The reconciliationMode. + */ + com.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode getReconciliationMode(); + + /** + * + * + *
+   * 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The notificationPubsubTopic. + */ + 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
+   * [Operation][google.longrunning.Operation].
+   * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
+   * Only supported when
+   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
+   * is set to `FULL`.
+   * 
+ * + * string notification_pubsub_topic = 7; + * + * @return The bytes for notificationPubsubTopic. + */ + com.google.protobuf.ByteString getNotificationPubsubTopicBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponse.java new file mode 100644 index 00000000..8100f3f5 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponse.java @@ -0,0 +1,1224 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the
+ * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest]. If
+ * the long running operation is done, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportProductsResponse} + */ +public final class ImportProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportProductsResponse) + ImportProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportProductsResponse.newBuilder() to construct. + private ImportProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportProductsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportProductsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportProductsResponse.class, + com.google.cloud.retail.v2beta.ImportProductsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + 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.ImportProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportProductsResponse other = + (com.google.cloud.retail.v2beta.ImportProductsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse 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.ImportProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse 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.ImportProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse 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.ImportProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse 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.ImportProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse 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.ImportProductsResponse 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.ImportProductsResponse 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.ImportProductsResponse 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
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest]. If
+   * the long running operation is done, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportProductsResponse) + com.google.cloud.retail.v2beta.ImportProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportProductsResponse.class, + com.google.cloud.retail.v2beta.ImportProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsResponse build() { + com.google.cloud.retail.v2beta.ImportProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportProductsResponse buildPartial() { + com.google.cloud.retail.v2beta.ImportProductsResponse result = + new com.google.cloud.retail.v2beta.ImportProductsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.ImportProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportProductsResponse other) { + if (other == com.google.cloud.retail.v2beta.ImportProductsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.ImportProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.ImportProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportProductsResponse) + private static final com.google.cloud.retail.v2beta.ImportProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportProductsResponse(); + } + + public static com.google.cloud.retail.v2beta.ImportProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportProductsResponse(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.ImportProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponseOrBuilder.java new file mode 100644 index 00000000..7c6823bf --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsResponseOrBuilder.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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequest.java new file mode 100644 index 00000000..ebbeea5a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequest.java @@ -0,0 +1,1247 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for the ImportUserEvents request.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportUserEventsRequest} + */ +public final class ImportUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportUserEventsRequest) + ImportUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsRequest.newBuilder() to construct. + private ImportUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsRequest( + 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.UserEventInputConfig.Builder subBuilder = null; + if (inputConfig_ != null) { + subBuilder = inputConfig_.toBuilder(); + } + inputConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserEventInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inputConfig_); + inputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportUserEventsRequest.class, + com.google.cloud.retail.v2beta.ImportUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * 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 INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.UserEventInputConfig inputConfig_; + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + 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 (inputConfig_ != null) { + output.writeMessage(2, getInputConfig()); + } + if (errorsConfig_ != null) { + output.writeMessage(3, getErrorsConfig()); + } + 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 (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getErrorsConfig()); + } + 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.ImportUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportUserEventsRequest other = + (com.google.cloud.retail.v2beta.ImportUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) 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 (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest 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.ImportUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest 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.ImportUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest 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.ImportUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest 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.ImportUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest 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.ImportUserEventsRequest 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.ImportUserEventsRequest 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.ImportUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the ImportUserEvents request.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportUserEventsRequest) + com.google.cloud.retail.v2beta.ImportUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportUserEventsRequest.class, + com.google.cloud.retail.v2beta.ImportUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportUserEventsRequest.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 (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsRequest build() { + com.google.cloud.retail.v2beta.ImportUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsRequest buildPartial() { + com.google.cloud.retail.v2beta.ImportUserEventsRequest result = + new com.google.cloud.retail.v2beta.ImportUserEventsRequest(this); + result.parent_ = parent_; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.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.ImportUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportUserEventsRequest other) { + if (other == com.google.cloud.retail.v2beta.ImportUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + 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.ImportUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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. `projects/1234/locations/global/catalogs/default_catalog`
+     * 
+ * + * + * 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.UserEventInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInputConfig, + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder, + com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.cloud.retail.v2beta.UserEventInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.cloud.retail.v2beta.UserEventInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.cloud.retail.v2beta.UserEventInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.retail.v2beta.UserEventInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.retail.v2beta.UserEventInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * Required. The desired input location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInputConfig, + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder, + com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInputConfig, + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder, + com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + @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.ImportUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportUserEventsRequest) + private static final com.google.cloud.retail.v2beta.ImportUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportUserEventsRequest(); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsRequest(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.ImportUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..6371a283 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. `projects/1234/locations/global/catalogs/default_catalog`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.cloud.retail.v2beta.UserEventInputConfig getInputConfig(); + /** + * + * + *
+   * Required. The desired input location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 3; + */ + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponse.java new file mode 100644 index 00000000..c9ac7e4e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponse.java @@ -0,0 +1,1515 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the ImportUserEventsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportUserEventsResponse} + */ +public final class ImportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ImportUserEventsResponse) + ImportUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsResponse.newBuilder() to construct. + private ImportUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportUserEventsResponse( + 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)) { + errorSamples_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + errorSamples_.add( + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder subBuilder = null; + if (errorsConfig_ != null) { + subBuilder = errorsConfig_.toBuilder(); + } + errorsConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ImportErrorsConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorsConfig_); + errorsConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder subBuilder = null; + if (importSummary_ != null) { + subBuilder = importSummary_.toBuilder(); + } + importSummary_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserEventImportSummary.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(importSummary_); + importSummary_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportUserEventsResponse.class, + com.google.cloud.retail.v2beta.ImportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return getErrorsConfig(); + } + + public static final int IMPORT_SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2beta.UserEventImportSummary importSummary_; + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + @java.lang.Override + public boolean hasImportSummary() { + return importSummary_ != null; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventImportSummary getImportSummary() { + return importSummary_ == null + ? com.google.cloud.retail.v2beta.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + return getImportSummary(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + if (importSummary_ != null) { + output.writeMessage(3, getImportSummary()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + if (importSummary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getImportSummary()); + } + 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.ImportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ImportUserEventsResponse other = + (com.google.cloud.retail.v2beta.ImportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasImportSummary() != other.hasImportSummary()) return false; + if (hasImportSummary()) { + if (!getImportSummary().equals(other.getImportSummary())) 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 (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasImportSummary()) { + hash = (37 * hash) + IMPORT_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getImportSummary().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse 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.ImportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse 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.ImportUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse 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.ImportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse 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.ImportUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse 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.ImportUserEventsResponse 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.ImportUserEventsResponse 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.ImportUserEventsResponse 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 ImportUserEventsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ImportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ImportUserEventsResponse) + com.google.cloud.retail.v2beta.ImportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ImportUserEventsResponse.class, + com.google.cloud.retail.v2beta.ImportUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ImportUserEventsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorSamplesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + errorSamplesBuilder_.clear(); + } + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + if (importSummaryBuilder_ == null) { + importSummary_ = null; + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ImportUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsResponse build() { + com.google.cloud.retail.v2beta.ImportUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ImportUserEventsResponse buildPartial() { + com.google.cloud.retail.v2beta.ImportUserEventsResponse result = + new com.google.cloud.retail.v2beta.ImportUserEventsResponse(this); + int from_bitField0_ = bitField0_; + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + if (errorsConfigBuilder_ == null) { + result.errorsConfig_ = errorsConfig_; + } else { + result.errorsConfig_ = errorsConfigBuilder_.build(); + } + if (importSummaryBuilder_ == null) { + result.importSummary_ = importSummary_; + } else { + result.importSummary_ = importSummaryBuilder_.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.ImportUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ImportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ImportUserEventsResponse other) { + if (other == com.google.cloud.retail.v2beta.ImportUserEventsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasImportSummary()) { + mergeImportSummary(other.getImportSummary()); + } + 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.ImportUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ImportUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2beta.ImportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return errorsConfigBuilder_ != null || errorsConfig_ != null; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + onChanged(); + } else { + errorsConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + onChanged(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ImportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (errorsConfig_ != null) { + errorsConfig_ = + com.google.cloud.retail.v2beta.ImportErrorsConfig.newBuilder(errorsConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + errorsConfig_ = value; + } + onChanged(); + } else { + errorsConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = null; + onChanged(); + } else { + errorsConfig_ = null; + errorsConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder getErrorsConfigBuilder() { + + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ImportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ImportErrorsConfig, + com.google.cloud.retail.v2beta.ImportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + private com.google.cloud.retail.v2beta.UserEventImportSummary importSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventImportSummary, + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder, + com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder> + importSummaryBuilder_; + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + public boolean hasImportSummary() { + return importSummaryBuilder_ != null || importSummary_ != null; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + public com.google.cloud.retail.v2beta.UserEventImportSummary getImportSummary() { + if (importSummaryBuilder_ == null) { + return importSummary_ == null + ? com.google.cloud.retail.v2beta.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } else { + return importSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public Builder setImportSummary(com.google.cloud.retail.v2beta.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + importSummary_ = value; + onChanged(); + } else { + importSummaryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public Builder setImportSummary( + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder builderForValue) { + if (importSummaryBuilder_ == null) { + importSummary_ = builderForValue.build(); + onChanged(); + } else { + importSummaryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public Builder mergeImportSummary(com.google.cloud.retail.v2beta.UserEventImportSummary value) { + if (importSummaryBuilder_ == null) { + if (importSummary_ != null) { + importSummary_ = + com.google.cloud.retail.v2beta.UserEventImportSummary.newBuilder(importSummary_) + .mergeFrom(value) + .buildPartial(); + } else { + importSummary_ = value; + } + onChanged(); + } else { + importSummaryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public Builder clearImportSummary() { + if (importSummaryBuilder_ == null) { + importSummary_ = null; + onChanged(); + } else { + importSummary_ = null; + importSummaryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public com.google.cloud.retail.v2beta.UserEventImportSummary.Builder getImportSummaryBuilder() { + + onChanged(); + return getImportSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + public com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder + getImportSummaryOrBuilder() { + if (importSummaryBuilder_ != null) { + return importSummaryBuilder_.getMessageOrBuilder(); + } else { + return importSummary_ == null + ? com.google.cloud.retail.v2beta.UserEventImportSummary.getDefaultInstance() + : importSummary_; + } + } + /** + * + * + *
+     * Aggregated statistics of user event import status.
+     * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventImportSummary, + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder, + com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder> + getImportSummaryFieldBuilder() { + if (importSummaryBuilder_ == null) { + importSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventImportSummary, + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder, + com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder>( + getImportSummary(), getParentForChildren(), isClean()); + importSummary_ = null; + } + return importSummaryBuilder_; + } + + @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.ImportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ImportUserEventsResponse) + private static final com.google.cloud.retail.v2beta.ImportUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ImportUserEventsResponse(); + } + + public static com.google.cloud.retail.v2beta.ImportUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportUserEventsResponse(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.ImportUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..e714d484 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportUserEventsResponseOrBuilder.java @@ -0,0 +1,149 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ImportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ImportUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ImportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.retail.v2beta.ImportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return Whether the importSummary field is set. + */ + boolean hasImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + * + * @return The importSummary. + */ + com.google.cloud.retail.v2beta.UserEventImportSummary getImportSummary(); + /** + * + * + *
+   * Aggregated statistics of user event import status.
+   * 
+ * + * .google.cloud.retail.v2beta.UserEventImportSummary import_summary = 3; + */ + com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder getImportSummaryOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Interval.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Interval.java new file mode 100644 index 00000000..cfa34df6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Interval.java @@ -0,0 +1,1161 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * A floating point interval.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Interval} + */ +public final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Interval) + IntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use Interval.newBuilder() to construct. + private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Interval() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Interval(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Interval( + 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 9: + { + min_ = input.readDouble(); + minCase_ = 1; + break; + } + case 17: + { + min_ = input.readDouble(); + minCase_ = 2; + break; + } + case 25: + { + max_ = input.readDouble(); + maxCase_ = 3; + break; + } + case 33: + { + max_ = input.readDouble(); + maxCase_ = 4; + 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Interval.class, + com.google.cloud.retail.v2beta.Interval.Builder.class); + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public enum MinCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MINIMUM(1), + EXCLUSIVE_MINIMUM(2), + MIN_NOT_SET(0); + private final int value; + + private MinCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MinCase valueOf(int value) { + return forNumber(value); + } + + public static MinCase forNumber(int value) { + switch (value) { + case 1: + return MINIMUM; + case 2: + return EXCLUSIVE_MINIMUM; + case 0: + return MIN_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public enum MaxCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAXIMUM(3), + EXCLUSIVE_MAXIMUM(4), + MAX_NOT_SET(0); + private final int value; + + private MaxCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MaxCase valueOf(int value) { + return forNumber(value); + } + + public static MaxCase forNumber(int value) { + switch (value) { + case 3: + return MAXIMUM; + case 4: + return EXCLUSIVE_MAXIMUM; + case 0: + return MAX_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public static final int MINIMUM_FIELD_NUMBER = 1; + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + @java.lang.Override + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int EXCLUSIVE_MINIMUM_FIELD_NUMBER = 2; + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + @java.lang.Override + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int MAXIMUM_FIELD_NUMBER = 3; + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + @java.lang.Override + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + + public static final int EXCLUSIVE_MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + @java.lang.Override + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + + 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 (minCase_ == 1) { + output.writeDouble(1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + output.writeDouble(2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + output.writeDouble(3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + output.writeDouble(4, (double) ((java.lang.Double) max_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 4, (double) ((java.lang.Double) max_)); + } + 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.Interval)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Interval other = (com.google.cloud.retail.v2beta.Interval) obj; + + if (!getMinCase().equals(other.getMinCase())) return false; + switch (minCase_) { + case 1: + if (java.lang.Double.doubleToLongBits(getMinimum()) + != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; + break; + case 2: + if (java.lang.Double.doubleToLongBits(getExclusiveMinimum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMinimum())) return false; + break; + case 0: + default: + } + if (!getMaxCase().equals(other.getMaxCase())) return false; + switch (maxCase_) { + case 3: + if (java.lang.Double.doubleToLongBits(getMaximum()) + != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; + break; + case 4: + if (java.lang.Double.doubleToLongBits(getExclusiveMaximum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMaximum())) return false; + break; + case 0: + default: + } + 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(); + switch (minCase_) { + case 1: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMinimum())); + break; + case 2: + hash = (37 * hash) + EXCLUSIVE_MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMinimum())); + break; + case 0: + default: + } + switch (maxCase_) { + case 3: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMaximum())); + break; + case 4: + hash = (37 * hash) + EXCLUSIVE_MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMaximum())); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Interval parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Interval 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.Interval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Interval 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.Interval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Interval 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.Interval parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Interval 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.Interval parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Interval 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.Interval 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.Interval 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.Interval 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; + } + /** + * + * + *
+   * A floating point interval.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Interval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Interval) + com.google.cloud.retail.v2beta.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Interval.class, + com.google.cloud.retail.v2beta.Interval.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Interval.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(); + minCase_ = 0; + min_ = null; + maxCase_ = 0; + max_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Interval_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval build() { + com.google.cloud.retail.v2beta.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval buildPartial() { + com.google.cloud.retail.v2beta.Interval result = + new com.google.cloud.retail.v2beta.Interval(this); + if (minCase_ == 1) { + result.min_ = min_; + } + if (minCase_ == 2) { + result.min_ = min_; + } + if (maxCase_ == 3) { + result.max_ = max_; + } + if (maxCase_ == 4) { + result.max_ = max_; + } + result.minCase_ = minCase_; + result.maxCase_ = maxCase_; + 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.Interval) { + return mergeFrom((com.google.cloud.retail.v2beta.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Interval other) { + if (other == com.google.cloud.retail.v2beta.Interval.getDefaultInstance()) return this; + switch (other.getMinCase()) { + case MINIMUM: + { + setMinimum(other.getMinimum()); + break; + } + case EXCLUSIVE_MINIMUM: + { + setExclusiveMinimum(other.getExclusiveMinimum()); + break; + } + case MIN_NOT_SET: + { + break; + } + } + switch (other.getMaxCase()) { + case MAXIMUM: + { + setMaximum(other.getMaximum()); + break; + } + case EXCLUSIVE_MAXIMUM: + { + setExclusiveMaximum(other.getExclusiveMaximum()); + break; + } + case MAX_NOT_SET: + { + break; + } + } + 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.Interval parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Interval) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int minCase_ = 0; + private java.lang.Object min_; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + public Builder clearMin() { + minCase_ = 0; + min_ = null; + onChanged(); + return this; + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public Builder clearMax() { + maxCase_ = 0; + max_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(double value) { + minCase_ = 1; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinimum() { + if (minCase_ == 1) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @param value The exclusiveMinimum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMinimum(double value) { + minCase_ = 2; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMinimum() { + if (minCase_ == 2) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @param value The maximum to set. + * @return This builder for chaining. + */ + public Builder setMaximum(double value) { + maxCase_ = 3; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaximum() { + if (maxCase_ == 3) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @param value The exclusiveMaximum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMaximum(double value) { + maxCase_ = 4; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMaximum() { + if (maxCase_ == 4) { + maxCase_ = 0; + max_ = null; + 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.Interval) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Interval) + private static final com.google.cloud.retail.v2beta.Interval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Interval(); + } + + public static com.google.cloud.retail.v2beta.Interval getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interval parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Interval(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.Interval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/IntervalOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/IntervalOrBuilder.java new file mode 100644 index 00000000..de9f4a75 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/IntervalOrBuilder.java @@ -0,0 +1,129 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Interval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + boolean hasMinimum(); + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + double getMinimum(); + + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + boolean hasExclusiveMinimum(); + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + double getExclusiveMinimum(); + + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + boolean hasMaximum(); + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + double getMaximum(); + + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + boolean hasExclusiveMaximum(); + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + double getExclusiveMaximum(); + + public com.google.cloud.retail.v2beta.Interval.MinCase getMinCase(); + + public com.google.cloud.retail.v2beta.Interval.MaxCase getMaxCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequest.java new file mode 100644 index 00000000..d9a3cbea --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequest.java @@ -0,0 +1,1021 @@ +/* + * 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.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListCatalogsRequest} + */ +public final class ListCatalogsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListCatalogsRequest) + ListCatalogsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogsRequest.newBuilder() to construct. + private ListCatalogsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogsRequest( + 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListCatalogsRequest.class, + com.google.cloud.retail.v2beta.ListCatalogsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * 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 account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return.
+   * If unspecified, defaults to 50. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @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_; + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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.ListCatalogsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListCatalogsRequest other = + (com.google.cloud.retail.v2beta.ListCatalogsRequest) 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.ListCatalogsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest 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.ListCatalogsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest 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.ListCatalogsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest 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.ListCatalogsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest 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.ListCatalogsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest 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.ListCatalogsRequest 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.ListCatalogsRequest 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.ListCatalogsRequest 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.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListCatalogsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListCatalogsRequest) + com.google.cloud.retail.v2beta.ListCatalogsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListCatalogsRequest.class, + com.google.cloud.retail.v2beta.ListCatalogsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListCatalogsRequest.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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListCatalogsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsRequest build() { + com.google.cloud.retail.v2beta.ListCatalogsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsRequest buildPartial() { + com.google.cloud.retail.v2beta.ListCatalogsRequest result = + new com.google.cloud.retail.v2beta.ListCatalogsRequest(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.ListCatalogsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ListCatalogsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListCatalogsRequest other) { + if (other == com.google.cloud.retail.v2beta.ListCatalogsRequest.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.ListCatalogsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListCatalogsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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 account resource name with an associated location.
+     * If the caller does not have permission to list
+     * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+     * regardless of whether or not this location exists, a PERMISSION_DENIED
+     * error is returned.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return.
+     * If unspecified, defaults to 50. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return.
+     * If unspecified, defaults to 50. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return.
+     * If unspecified, defaults to 50. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+     * received from a previous
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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.ListCatalogsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListCatalogsRequest) + private static final com.google.cloud.retail.v2beta.ListCatalogsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListCatalogsRequest(); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogsRequest(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.ListCatalogsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequestOrBuilder.java new file mode 100644 index 00000000..207dd873 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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 ListCatalogsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListCatalogsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The account resource name with an associated location.
+   * If the caller does not have permission to list
+   * [Catalog][google.cloud.retail.v2beta.Catalog]s under this location,
+   * regardless of whether or not this location exists, a PERMISSION_DENIED
+   * error is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return.
+   * If unspecified, defaults to 50. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token],
+   * received from a previous
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponse.java new file mode 100644 index 00000000..dd503283 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponse.java @@ -0,0 +1,1154 @@ +/* + * 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 for
+ * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListCatalogsResponse} + */ +public final class ListCatalogsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListCatalogsResponse) + ListCatalogsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCatalogsResponse.newBuilder() to construct. + private ListCatalogsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCatalogsResponse() { + catalogs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCatalogsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCatalogsResponse( + 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)) { + catalogs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + catalogs_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Catalog.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)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + } + 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_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListCatalogsResponse.class, + com.google.cloud.retail.v2beta.ListCatalogsResponse.Builder.class); + } + + public static final int CATALOGS_FIELD_NUMBER = 1; + private java.util.List catalogs_; + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List getCatalogsList() { + return catalogs_; + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + @java.lang.Override + public java.util.List + getCatalogsOrBuilderList() { + return catalogs_; + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + @java.lang.Override + public int getCatalogsCount() { + return catalogs_.size(); + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Catalog getCatalogs(int index) { + return catalogs_.get(index); + } + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogsOrBuilder(int index) { + return catalogs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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 < catalogs_.size(); i++) { + output.writeMessage(1, catalogs_.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 < catalogs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, catalogs_.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.ListCatalogsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListCatalogsResponse other = + (com.google.cloud.retail.v2beta.ListCatalogsResponse) obj; + + if (!getCatalogsList().equals(other.getCatalogsList())) 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 (getCatalogsCount() > 0) { + hash = (37 * hash) + CATALOGS_FIELD_NUMBER; + hash = (53 * hash) + getCatalogsList().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.ListCatalogsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse 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.ListCatalogsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse 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.ListCatalogsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse 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.ListCatalogsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse 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.ListCatalogsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse 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.ListCatalogsResponse 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.ListCatalogsResponse 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.ListCatalogsResponse 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 for
+   * [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListCatalogsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListCatalogsResponse) + com.google.cloud.retail.v2beta.ListCatalogsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ListCatalogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListCatalogsResponse.class, + com.google.cloud.retail.v2beta.ListCatalogsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListCatalogsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCatalogsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + catalogsBuilder_.clear(); + } + nextPageToken_ = ""; + + 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_ListCatalogsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListCatalogsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsResponse build() { + com.google.cloud.retail.v2beta.ListCatalogsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListCatalogsResponse buildPartial() { + com.google.cloud.retail.v2beta.ListCatalogsResponse result = + new com.google.cloud.retail.v2beta.ListCatalogsResponse(this); + int from_bitField0_ = bitField0_; + if (catalogsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + catalogs_ = java.util.Collections.unmodifiableList(catalogs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.catalogs_ = catalogs_; + } else { + result.catalogs_ = catalogsBuilder_.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.ListCatalogsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ListCatalogsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListCatalogsResponse other) { + if (other == com.google.cloud.retail.v2beta.ListCatalogsResponse.getDefaultInstance()) + return this; + if (catalogsBuilder_ == null) { + if (!other.catalogs_.isEmpty()) { + if (catalogs_.isEmpty()) { + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCatalogsIsMutable(); + catalogs_.addAll(other.catalogs_); + } + onChanged(); + } + } else { + if (!other.catalogs_.isEmpty()) { + if (catalogsBuilder_.isEmpty()) { + catalogsBuilder_.dispose(); + catalogsBuilder_ = null; + catalogs_ = other.catalogs_; + bitField0_ = (bitField0_ & ~0x00000001); + catalogsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCatalogsFieldBuilder() + : null; + } else { + catalogsBuilder_.addAllMessages(other.catalogs_); + } + } + } + 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.ListCatalogsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListCatalogsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List catalogs_ = + java.util.Collections.emptyList(); + + private void ensureCatalogsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + catalogs_ = new java.util.ArrayList(catalogs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder> + catalogsBuilder_; + + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public java.util.List getCatalogsList() { + if (catalogsBuilder_ == null) { + return java.util.Collections.unmodifiableList(catalogs_); + } else { + return catalogsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public int getCatalogsCount() { + if (catalogsBuilder_ == null) { + return catalogs_.size(); + } else { + return catalogsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2beta.Catalog getCatalogs(int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder setCatalogs(int index, com.google.cloud.retail.v2beta.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.set(index, value); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder setCatalogs( + int index, com.google.cloud.retail.v2beta.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.set(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder addCatalogs(com.google.cloud.retail.v2beta.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(value); + onChanged(); + } else { + catalogsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder addCatalogs(int index, com.google.cloud.retail.v2beta.Catalog value) { + if (catalogsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCatalogsIsMutable(); + catalogs_.add(index, value); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder addCatalogs(com.google.cloud.retail.v2beta.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder addCatalogs( + int index, com.google.cloud.retail.v2beta.Catalog.Builder builderForValue) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.add(index, builderForValue.build()); + onChanged(); + } else { + catalogsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder addAllCatalogs( + java.lang.Iterable values) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, catalogs_); + onChanged(); + } else { + catalogsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder clearCatalogs() { + if (catalogsBuilder_ == null) { + catalogs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + catalogsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public Builder removeCatalogs(int index) { + if (catalogsBuilder_ == null) { + ensureCatalogsIsMutable(); + catalogs_.remove(index); + onChanged(); + } else { + catalogsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2beta.Catalog.Builder getCatalogsBuilder(int index) { + return getCatalogsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogsOrBuilder(int index) { + if (catalogsBuilder_ == null) { + return catalogs_.get(index); + } else { + return catalogsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public java.util.List + getCatalogsOrBuilderList() { + if (catalogsBuilder_ != null) { + return catalogsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(catalogs_); + } + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2beta.Catalog.Builder addCatalogsBuilder() { + return getCatalogsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public com.google.cloud.retail.v2beta.Catalog.Builder addCatalogsBuilder(int index) { + return getCatalogsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Catalog.getDefaultInstance()); + } + /** + * + * + *
+     * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + public java.util.List getCatalogsBuilderList() { + return getCatalogsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder> + getCatalogsFieldBuilder() { + if (catalogsBuilder_ == null) { + catalogsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder>( + catalogs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + catalogs_ = null; + } + return catalogsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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.ListCatalogsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListCatalogsResponse) + private static final com.google.cloud.retail.v2beta.ListCatalogsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListCatalogsResponse(); + } + + public static com.google.cloud.retail.v2beta.ListCatalogsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCatalogsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCatalogsResponse(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.ListCatalogsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponseOrBuilder.java new file mode 100644 index 00000000..3a538870 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListCatalogsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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 ListCatalogsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListCatalogsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + java.util.List getCatalogsList(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + com.google.cloud.retail.v2beta.Catalog getCatalogs(int index); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + int getCatalogsCount(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + java.util.List + getCatalogsOrBuilderList(); + /** + * + * + *
+   * All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Catalog catalogs = 1; + */ + com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequest.java new file mode 100644 index 00000000..81996ee7 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequest.java @@ -0,0 +1,1146 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for ListControls method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListControlsRequest} + */ +public final class ListControlsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListControlsRequest) + ListControlsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListControlsRequest.newBuilder() to construct. + private ListControlsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListControlsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListControlsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListControlsRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListControlsRequest.class, + com.google.cloud.retail.v2beta.ListControlsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.ListControlsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListControlsRequest other = + (com.google.cloud.retail.v2beta.ListControlsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest 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.ListControlsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest 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.ListControlsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest 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.ListControlsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest 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.ListControlsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest 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.ListControlsRequest 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.ListControlsRequest 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.ListControlsRequest 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 ListControls method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListControlsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListControlsRequest) + com.google.cloud.retail.v2beta.ListControlsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListControlsRequest.class, + com.google.cloud.retail.v2beta.ListControlsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListControlsRequest.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_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListControlsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsRequest build() { + com.google.cloud.retail.v2beta.ListControlsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsRequest buildPartial() { + com.google.cloud.retail.v2beta.ListControlsRequest result = + new com.google.cloud.retail.v2beta.ListControlsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.ListControlsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ListControlsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListControlsRequest other) { + if (other == com.google.cloud.retail.v2beta.ListControlsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.ListControlsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListControlsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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 `ListControls` 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 `ListControls` 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 `ListControls` 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+     * * List controls that are used in a single ServingConfig:
+     *     'serving_config = "boosted_home_page_cvr"'
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + 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.ListControlsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListControlsRequest) + private static final com.google.cloud.retail.v2beta.ListControlsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListControlsRequest(); + } + + public static com.google.cloud.retail.v2beta.ListControlsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListControlsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListControlsRequest(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.ListControlsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequestOrBuilder.java new file mode 100644 index 00000000..50d0f04c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListControlsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListControlsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 `ListControls` 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 `ListControls` 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(); + + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset.
+   * * List controls that are used in a single ServingConfig:
+   *     'serving_config = "boosted_home_page_cvr"'
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponse.java new file mode 100644 index 00000000..3b6127cf --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponse.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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response for ListControls method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListControlsResponse} + */ +public final class ListControlsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListControlsResponse) + ListControlsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListControlsResponse.newBuilder() to construct. + private ListControlsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListControlsResponse() { + controls_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListControlsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListControlsResponse( + 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)) { + controls_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + controls_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Control.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)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListControlsResponse.class, + com.google.cloud.retail.v2beta.ListControlsResponse.Builder.class); + } + + public static final int CONTROLS_FIELD_NUMBER = 1; + private java.util.List controls_; + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + @java.lang.Override + public java.util.List getControlsList() { + return controls_; + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + @java.lang.Override + public java.util.List + getControlsOrBuilderList() { + return controls_; + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + @java.lang.Override + public int getControlsCount() { + return controls_.size(); + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Control getControls(int index) { + return controls_.get(index); + } + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlsOrBuilder(int index) { + return controls_.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 < controls_.size(); i++) { + output.writeMessage(1, controls_.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 < controls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, controls_.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.ListControlsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListControlsResponse other = + (com.google.cloud.retail.v2beta.ListControlsResponse) obj; + + if (!getControlsList().equals(other.getControlsList())) 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 (getControlsCount() > 0) { + hash = (37 * hash) + CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getControlsList().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.ListControlsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse 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.ListControlsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse 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.ListControlsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse 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.ListControlsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse 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.ListControlsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse 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.ListControlsResponse 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.ListControlsResponse 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.ListControlsResponse 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 for ListControls method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListControlsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListControlsResponse) + com.google.cloud.retail.v2beta.ListControlsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListControlsResponse.class, + com.google.cloud.retail.v2beta.ListControlsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListControlsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getControlsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + controlsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_ListControlsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListControlsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsResponse build() { + com.google.cloud.retail.v2beta.ListControlsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListControlsResponse buildPartial() { + com.google.cloud.retail.v2beta.ListControlsResponse result = + new com.google.cloud.retail.v2beta.ListControlsResponse(this); + int from_bitField0_ = bitField0_; + if (controlsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.controls_ = controls_; + } else { + result.controls_ = controlsBuilder_.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.ListControlsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ListControlsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListControlsResponse other) { + if (other == com.google.cloud.retail.v2beta.ListControlsResponse.getDefaultInstance()) + return this; + if (controlsBuilder_ == null) { + if (!other.controls_.isEmpty()) { + if (controls_.isEmpty()) { + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureControlsIsMutable(); + controls_.addAll(other.controls_); + } + onChanged(); + } + } else { + if (!other.controls_.isEmpty()) { + if (controlsBuilder_.isEmpty()) { + controlsBuilder_.dispose(); + controlsBuilder_ = null; + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000001); + controlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getControlsFieldBuilder() + : null; + } else { + controlsBuilder_.addAllMessages(other.controls_); + } + } + } + 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.ListControlsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListControlsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List controls_ = + java.util.Collections.emptyList(); + + private void ensureControlsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + controls_ = new java.util.ArrayList(controls_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + controlsBuilder_; + + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public java.util.List getControlsList() { + if (controlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(controls_); + } else { + return controlsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public int getControlsCount() { + if (controlsBuilder_ == null) { + return controls_.size(); + } else { + return controlsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public com.google.cloud.retail.v2beta.Control getControls(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder setControls(int index, com.google.cloud.retail.v2beta.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.set(index, value); + onChanged(); + } else { + controlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder setControls( + int index, com.google.cloud.retail.v2beta.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.set(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder addControls(com.google.cloud.retail.v2beta.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(value); + onChanged(); + } else { + controlsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder addControls(int index, com.google.cloud.retail.v2beta.Control value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(index, value); + onChanged(); + } else { + controlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder addControls(com.google.cloud.retail.v2beta.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder addControls( + int index, com.google.cloud.retail.v2beta.Control.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder addAllControls( + java.lang.Iterable values) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, controls_); + onChanged(); + } else { + controlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder clearControls() { + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + controlsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public Builder removeControls(int index) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.remove(index); + onChanged(); + } else { + controlsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public com.google.cloud.retail.v2beta.Control.Builder getControlsBuilder(int index) { + return getControlsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlsOrBuilder(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public java.util.List + getControlsOrBuilderList() { + if (controlsBuilder_ != null) { + return controlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(controls_); + } + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public com.google.cloud.retail.v2beta.Control.Builder addControlsBuilder() { + return getControlsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Control.getDefaultInstance()); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public com.google.cloud.retail.v2beta.Control.Builder addControlsBuilder(int index) { + return getControlsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Control.getDefaultInstance()); + } + /** + * + * + *
+     * All the Controls for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + public java.util.List getControlsBuilderList() { + return getControlsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + getControlsFieldBuilder() { + if (controlsBuilder_ == null) { + controlsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder>( + controls_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + controls_ = null; + } + return controlsBuilder_; + } + + 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.ListControlsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListControlsResponse) + private static final com.google.cloud.retail.v2beta.ListControlsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListControlsResponse(); + } + + public static com.google.cloud.retail.v2beta.ListControlsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListControlsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListControlsResponse(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.ListControlsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponseOrBuilder.java new file mode 100644 index 00000000..a7539be7 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListControlsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListControlsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListControlsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + java.util.List getControlsList(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + com.google.cloud.retail.v2beta.Control getControls(int index); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + int getControlsCount(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + java.util.List + getControlsOrBuilderList(); + /** + * + * + *
+   * All the Controls for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Control controls = 1; + */ + com.google.cloud.retail.v2beta.ControlOrBuilder getControlsOrBuilder(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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequest.java new file mode 100644 index 00000000..092d4daf --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequest.java @@ -0,0 +1,1820 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for
+ * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListProductsRequest} + */ +public final class ListProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListProductsRequest) + ListProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsRequest.newBuilder() to construct. + private ListProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (readMask_ != null) { + subBuilder = readMask_.toBuilder(); + } + readMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readMask_); + readMask_ = 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListProductsRequest.class, + com.google.cloud.retail.v2beta.ListProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * 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 branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+   * If unspecified, defaults to 100. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @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_; + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2beta.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2beta.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_MASK_FIELD_NUMBER = 5; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + @java.lang.Override + public boolean hasReadMask() { + return readMask_ != null; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return getReadMask(); + } + + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (readMask_ != null) { + output.writeMessage(5, getReadMask()); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (readMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); + } + 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.ListProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListProductsRequest other = + (com.google.cloud.retail.v2beta.ListProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest 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.ListProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest 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.ListProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest 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.ListProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest 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.ListProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest 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.ListProductsRequest 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.ListProductsRequest 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.ListProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListProductsRequest) + com.google.cloud.retail.v2beta.ListProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListProductsRequest.class, + com.google.cloud.retail.v2beta.ListProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListProductsRequest.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_ = ""; + + filter_ = ""; + + if (readMaskBuilder_ == null) { + readMask_ = null; + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsRequest build() { + com.google.cloud.retail.v2beta.ListProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsRequest buildPartial() { + com.google.cloud.retail.v2beta.ListProductsRequest result = + new com.google.cloud.retail.v2beta.ListProductsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + if (readMaskBuilder_ == null) { + result.readMask_ = readMask_; + } else { + result.readMask_ = readMaskBuilder_.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.ListProductsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ListProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListProductsRequest other) { + if (other == com.google.cloud.retail.v2beta.ListProductsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + 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.ListProductsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListProductsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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 branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+     * `default_branch` as the branch ID, to list products under the default
+     * branch.
+     * If the caller does not have permission to list
+     * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+     * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+     * is returned.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to 100. The maximum allowed value is 1000. Values
+     * above 1000 will be coerced to 1000.
+     * If this field is negative, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+     * received from a previous
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2beta.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2beta.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2beta.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2beta.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. Supported features:
+     * * List all the products under the parent branch if
+     * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+     * * List
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   [Product][google.cloud.retail.v2beta.Product]. For example:
+     *     `primary_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product].
+     *   For example:
+     *     `collection_product_id = "some_product_id"`
+     * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+     * type. For example:
+     *     `type = "PRIMARY"`
+     *     `type = "VARIANT"`
+     *     `type = "COLLECTION"`
+     * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+     * If the specified
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] or
+     * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+     * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+     * error is returned.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + public boolean hasReadMask() { + return readMaskBuilder_ != null || readMask_ != null; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + onChanged(); + } else { + readMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + onChanged(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (readMask_ != null) { + readMask_ = + com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); + } else { + readMask_ = value; + } + onChanged(); + } else { + readMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public Builder clearReadMask() { + if (readMaskBuilder_ == null) { + readMask_ = null; + onChanged(); + } else { + readMask_ = null; + readMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
+     * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+     * the responses. If not set or empty, the following fields are returned:
+     * * [Product.name][google.cloud.retail.v2beta.Product.name]
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * * [Product.title][google.cloud.retail.v2beta.Product.title]
+     * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+     * * [Product.images][google.cloud.retail.v2beta.Product.images]
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+     * If "*" is provided, all fields are returned.
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+     * no matter what mask is set.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + @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.ListProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListProductsRequest) + private static final com.google.cloud.retail.v2beta.ListProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListProductsRequest(); + } + + public static com.google.cloud.retail.v2beta.ListProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsRequest(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.ListProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequestOrBuilder.java new file mode 100644 index 00000000..b8381919 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsRequestOrBuilder.java @@ -0,0 +1,274 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
+   * `default_branch` as the branch ID, to list products under the default
+   * branch.
+   * If the caller does not have permission to list
+   * [Product][google.cloud.retail.v2beta.Product]s under this branch,
+   * regardless of whether or not this branch exists, a PERMISSION_DENIED error
+   * is returned.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+   * If unspecified, defaults to 100. The maximum allowed value is 1000. Values
+   * above 1000 will be coerced to 1000.
+   * If this field is negative, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token],
+   * received from a previous
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2beta.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter to apply on the list results. Supported features:
+   * * List all the products under the parent branch if
+   * [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset.
+   * * List
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s sharing the same
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   [Product][google.cloud.retail.v2beta.Product]. For example:
+   *     `primary_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s bundled in a
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product].
+   *   For example:
+   *     `collection_product_id = "some_product_id"`
+   * * List [Product][google.cloud.retail.v2beta.Product]s with a partibular
+   * type. For example:
+   *     `type = "PRIMARY"`
+   *     `type = "VARIANT"`
+   *     `type = "COLLECTION"`
+   * If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
+   * If the specified
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] or
+   * [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]
+   * [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND
+   * error is returned.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return Whether the readMask field is set. + */ + boolean hasReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + * + * @return The readMask. + */ + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
+   * The fields of [Product][google.cloud.retail.v2beta.Product] to return in
+   * the responses. If not set or empty, the following fields are returned:
+   * * [Product.name][google.cloud.retail.v2beta.Product.name]
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * * [Product.title][google.cloud.retail.v2beta.Product.title]
+   * * [Product.uri][google.cloud.retail.v2beta.Product.uri]
+   * * [Product.images][google.cloud.retail.v2beta.Product.images]
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.brands][google.cloud.retail.v2beta.Product.brands]
+   * If "*" is provided, all fields are returned.
+   * [Product.name][google.cloud.retail.v2beta.Product.name] is always returned
+   * no matter what mask is set.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5; + */ + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponse.java new file mode 100644 index 00000000..c2b420a7 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponse.java @@ -0,0 +1,1154 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response message for
+ * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListProductsResponse} + */ +public final class ListProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListProductsResponse) + ListProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProductsResponse.newBuilder() to construct. + private ListProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProductsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProductsResponse( + 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)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Product.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)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListProductsResponse.class, + com.google.cloud.retail.v2beta.ListProductsResponse.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * 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 < products_.size(); i++) { + output.writeMessage(1, products_.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 < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.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.ListProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListProductsResponse other = + (com.google.cloud.retail.v2beta.ListProductsResponse) obj; + + if (!getProductsList().equals(other.getProductsList())) 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 (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().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.ListProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse 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.ListProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse 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.ListProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse 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.ListProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse 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.ListProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse 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.ListProductsResponse 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.ListProductsResponse 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.ListProductsResponse 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 message for
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListProductsResponse) + com.google.cloud.retail.v2beta.ListProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListProductsResponse.class, + com.google.cloud.retail.v2beta.ListProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListProductsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsResponse build() { + com.google.cloud.retail.v2beta.ListProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListProductsResponse buildPartial() { + com.google.cloud.retail.v2beta.ListProductsResponse result = + new com.google.cloud.retail.v2beta.ListProductsResponse(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.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.ListProductsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ListProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListProductsResponse other) { + if (other == com.google.cloud.retail.v2beta.ListProductsResponse.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + 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.ListProductsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListProductsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public com.google.cloud.retail.v2beta.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder addProducts(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public com.google.cloud.retail.v2beta.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public com.google.cloud.retail.v2beta.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * The [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + public java.util.List getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * 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.ListProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListProductsResponse) + private static final com.google.cloud.retail.v2beta.ListProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListProductsResponse(); + } + + public static com.google.cloud.retail.v2beta.ListProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProductsResponse(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.ListProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponseOrBuilder.java new file mode 100644 index 00000000..926cd8a6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListProductsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + java.util.List getProductsList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + com.google.cloud.retail.v2beta.Product getProducts(int index); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + int getProductsCount(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * The [Product][google.cloud.retail.v2beta.Product]s.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Product products = 1; + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java new file mode 100644 index 00000000..f00da7bc --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java @@ -0,0 +1,944 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for ListServingConfigs method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListServingConfigsRequest} + */ +public final class ListServingConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListServingConfigsRequest) + ListServingConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServingConfigsRequest.newBuilder() to construct. + private ListServingConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServingConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServingConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServingConfigsRequest( + 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListServingConfigsRequest.class, + com.google.cloud.retail.v2beta.ListServingConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+   * returned.
+   * 
+ * + * 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 `ListServingConfigs` 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 `ListServingConfigs` 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.ListServingConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListServingConfigsRequest other = + (com.google.cloud.retail.v2beta.ListServingConfigsRequest) 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.ListServingConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest 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.ListServingConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest 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.ListServingConfigsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest 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.ListServingConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest 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.ListServingConfigsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest 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.ListServingConfigsRequest 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.ListServingConfigsRequest 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.ListServingConfigsRequest 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 ListServingConfigs method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListServingConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListServingConfigsRequest) + com.google.cloud.retail.v2beta.ListServingConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListServingConfigsRequest.class, + com.google.cloud.retail.v2beta.ListServingConfigsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListServingConfigsRequest.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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListServingConfigsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsRequest build() { + com.google.cloud.retail.v2beta.ListServingConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsRequest buildPartial() { + com.google.cloud.retail.v2beta.ListServingConfigsRequest result = + new com.google.cloud.retail.v2beta.ListServingConfigsRequest(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.ListServingConfigsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ListServingConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListServingConfigsRequest other) { + if (other == com.google.cloud.retail.v2beta.ListServingConfigsRequest.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.ListServingConfigsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListServingConfigsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 100. If a value greater than 100 is provided, at most 100 results are
+     * returned.
+     * 
+ * + * 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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 `ListServingConfigs` 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.ListServingConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListServingConfigsRequest) + private static final com.google.cloud.retail.v2beta.ListServingConfigsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListServingConfigsRequest(); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServingConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServingConfigsRequest(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.ListServingConfigsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java new file mode 100644 index 00000000..1ff86f63 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListServingConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListServingConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The catalog resource name. 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 catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListServingConfigs` 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 `ListServingConfigs` 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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponse.java new file mode 100644 index 00000000..ef0a4c12 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponse.java @@ -0,0 +1,1143 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response for ListServingConfigs method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListServingConfigsResponse} + */ +public final class ListServingConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListServingConfigsResponse) + ListServingConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServingConfigsResponse.newBuilder() to construct. + private ListServingConfigsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServingConfigsResponse() { + servingConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServingConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServingConfigsResponse( + 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)) { + servingConfigs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + servingConfigs_.add( + input.readMessage( + com.google.cloud.retail.v2beta.ServingConfig.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)) { + servingConfigs_ = java.util.Collections.unmodifiableList(servingConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListServingConfigsResponse.class, + com.google.cloud.retail.v2beta.ListServingConfigsResponse.Builder.class); + } + + public static final int SERVING_CONFIGS_FIELD_NUMBER = 1; + private java.util.List servingConfigs_; + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public java.util.List getServingConfigsList() { + return servingConfigs_; + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public java.util.List + getServingConfigsOrBuilderList() { + return servingConfigs_; + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public int getServingConfigsCount() { + return servingConfigs_.size(); + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig getServingConfigs(int index) { + return servingConfigs_.get(index); + } + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigsOrBuilder( + int index) { + return servingConfigs_.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 < servingConfigs_.size(); i++) { + output.writeMessage(1, servingConfigs_.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 < servingConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, servingConfigs_.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.ListServingConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListServingConfigsResponse other = + (com.google.cloud.retail.v2beta.ListServingConfigsResponse) obj; + + if (!getServingConfigsList().equals(other.getServingConfigsList())) 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 (getServingConfigsCount() > 0) { + hash = (37 * hash) + SERVING_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigsList().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.ListServingConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse 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.ListServingConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse 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.ListServingConfigsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse 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.ListServingConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse 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.ListServingConfigsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse 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.ListServingConfigsResponse 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.ListServingConfigsResponse 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.ListServingConfigsResponse 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 for ListServingConfigs method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListServingConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListServingConfigsResponse) + com.google.cloud.retail.v2beta.ListServingConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListServingConfigsResponse.class, + com.google.cloud.retail.v2beta.ListServingConfigsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListServingConfigsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServingConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (servingConfigsBuilder_ == null) { + servingConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servingConfigsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListServingConfigsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsResponse build() { + com.google.cloud.retail.v2beta.ListServingConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListServingConfigsResponse buildPartial() { + com.google.cloud.retail.v2beta.ListServingConfigsResponse result = + new com.google.cloud.retail.v2beta.ListServingConfigsResponse(this); + int from_bitField0_ = bitField0_; + if (servingConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + servingConfigs_ = java.util.Collections.unmodifiableList(servingConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.servingConfigs_ = servingConfigs_; + } else { + result.servingConfigs_ = servingConfigsBuilder_.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.ListServingConfigsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ListServingConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListServingConfigsResponse other) { + if (other == com.google.cloud.retail.v2beta.ListServingConfigsResponse.getDefaultInstance()) + return this; + if (servingConfigsBuilder_ == null) { + if (!other.servingConfigs_.isEmpty()) { + if (servingConfigs_.isEmpty()) { + servingConfigs_ = other.servingConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServingConfigsIsMutable(); + servingConfigs_.addAll(other.servingConfigs_); + } + onChanged(); + } + } else { + if (!other.servingConfigs_.isEmpty()) { + if (servingConfigsBuilder_.isEmpty()) { + servingConfigsBuilder_.dispose(); + servingConfigsBuilder_ = null; + servingConfigs_ = other.servingConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + servingConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServingConfigsFieldBuilder() + : null; + } else { + servingConfigsBuilder_.addAllMessages(other.servingConfigs_); + } + } + } + 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.ListServingConfigsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListServingConfigsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List servingConfigs_ = + java.util.Collections.emptyList(); + + private void ensureServingConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + servingConfigs_ = + new java.util.ArrayList(servingConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + servingConfigsBuilder_; + + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public java.util.List getServingConfigsList() { + if (servingConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(servingConfigs_); + } else { + return servingConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public int getServingConfigsCount() { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.size(); + } else { + return servingConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2beta.ServingConfig getServingConfigs(int index) { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.get(index); + } else { + return servingConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder setServingConfigs( + int index, com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.set(index, value); + onChanged(); + } else { + servingConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder setServingConfigs( + int index, com.google.cloud.retail.v2beta.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs(com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.add(value); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + int index, com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigsIsMutable(); + servingConfigs_.add(index, value); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + com.google.cloud.retail.v2beta.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.add(builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder addServingConfigs( + int index, com.google.cloud.retail.v2beta.ServingConfig.Builder builderForValue) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + servingConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder addAllServingConfigs( + java.lang.Iterable values) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, servingConfigs_); + onChanged(); + } else { + servingConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder clearServingConfigs() { + if (servingConfigsBuilder_ == null) { + servingConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + servingConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public Builder removeServingConfigs(int index) { + if (servingConfigsBuilder_ == null) { + ensureServingConfigsIsMutable(); + servingConfigs_.remove(index); + onChanged(); + } else { + servingConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2beta.ServingConfig.Builder getServingConfigsBuilder( + int index) { + return getServingConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigsOrBuilder( + int index) { + if (servingConfigsBuilder_ == null) { + return servingConfigs_.get(index); + } else { + return servingConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public java.util.List + getServingConfigsOrBuilderList() { + if (servingConfigsBuilder_ != null) { + return servingConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(servingConfigs_); + } + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2beta.ServingConfig.Builder addServingConfigsBuilder() { + return getServingConfigsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance()); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public com.google.cloud.retail.v2beta.ServingConfig.Builder addServingConfigsBuilder( + int index) { + return getServingConfigsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance()); + } + /** + * + * + *
+     * All the ServingConfigs for a given catalog.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + public java.util.List + getServingConfigsBuilderList() { + return getServingConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + getServingConfigsFieldBuilder() { + if (servingConfigsBuilder_ == null) { + servingConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder>( + servingConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + servingConfigs_ = null; + } + return servingConfigsBuilder_; + } + + 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.ListServingConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListServingConfigsResponse) + private static final com.google.cloud.retail.v2beta.ListServingConfigsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListServingConfigsResponse(); + } + + public static com.google.cloud.retail.v2beta.ListServingConfigsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServingConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServingConfigsResponse(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.ListServingConfigsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponseOrBuilder.java new file mode 100644 index 00000000..fe63c4ed --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListServingConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListServingConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + java.util.List getServingConfigsList(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + com.google.cloud.retail.v2beta.ServingConfig getServingConfigs(int index); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + int getServingConfigsCount(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + java.util.List + getServingConfigsOrBuilderList(); + /** + * + * + *
+   * All the ServingConfigs for a given catalog.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ServingConfig serving_configs = 1; + */ + com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigsOrBuilder(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/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventory.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventory.java new file mode 100644 index 00000000..1162f658 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventory.java @@ -0,0 +1,1968 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The inventory information at a place (e.g. a store) identified
+ * by a place ID.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.LocalInventory} + */ +public final class LocalInventory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.LocalInventory) + LocalInventoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocalInventory.newBuilder() to construct. + private LocalInventory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalInventory() { + placeId_ = ""; + fulfillmentTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalInventory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocalInventory( + 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(); + + placeId_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.PriceInfo.Builder subBuilder = null; + if (priceInfo_ != null) { + subBuilder = priceInfo_.toBuilder(); + } + priceInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.PriceInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceInfo_); + priceInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + fulfillmentTypes_.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_ & 0x00000002) != 0)) { + fulfillmentTypes_ = fulfillmentTypes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.LocalInventory.class, + com.google.cloud.retail.v2beta.LocalInventory.Builder.class); + } + + public static final int PLACE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object placeId_; + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + @java.lang.Override + public java.lang.String getPlaceId() { + java.lang.Object ref = placeId_; + 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(); + placeId_ = s; + return s; + } + } + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = placeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_INFO_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.PriceInfo priceInfo_; + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + @java.lang.Override + public boolean hasPriceInfo() { + return priceInfo_ != null; + } + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo getPriceInfo() { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder() { + return getPriceInfo(); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 3; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FULFILLMENT_TYPES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList fulfillmentTypes_; + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return A list containing the fulfillmentTypes. + */ + public com.google.protobuf.ProtocolStringList getFulfillmentTypesList() { + return fulfillmentTypes_; + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The count of fulfillmentTypes. + */ + public int getFulfillmentTypesCount() { + return fulfillmentTypes_.size(); + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + public java.lang.String getFulfillmentTypes(int index) { + return fulfillmentTypes_.get(index); + } + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + public com.google.protobuf.ByteString getFulfillmentTypesBytes(int index) { + return fulfillmentTypes_.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(placeId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placeId_); + } + if (priceInfo_ != null) { + output.writeMessage(2, getPriceInfo()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < fulfillmentTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fulfillmentTypes_.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(placeId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placeId_); + } + if (priceInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPriceInfo()); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, attributes__); + } + { + int dataSize = 0; + for (int i = 0; i < fulfillmentTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(fulfillmentTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getFulfillmentTypesList().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.LocalInventory)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.LocalInventory other = + (com.google.cloud.retail.v2beta.LocalInventory) obj; + + if (!getPlaceId().equals(other.getPlaceId())) return false; + if (hasPriceInfo() != other.hasPriceInfo()) return false; + if (hasPriceInfo()) { + if (!getPriceInfo().equals(other.getPriceInfo())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getFulfillmentTypesList().equals(other.getFulfillmentTypesList())) 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) + PLACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPlaceId().hashCode(); + if (hasPriceInfo()) { + hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPriceInfo().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (getFulfillmentTypesCount() > 0) { + hash = (37 * hash) + FULFILLMENT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentTypesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.LocalInventory parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.LocalInventory 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.LocalInventory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.LocalInventory 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.LocalInventory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.LocalInventory 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.LocalInventory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.LocalInventory 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.LocalInventory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.LocalInventory 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.LocalInventory 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.LocalInventory 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.LocalInventory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inventory information at a place (e.g. a store) identified
+   * by a place ID.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.LocalInventory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.LocalInventory) + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.LocalInventory.class, + com.google.cloud.retail.v2beta.LocalInventory.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.LocalInventory.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(); + placeId_ = ""; + + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + internalGetMutableAttributes().clear(); + fulfillmentTypes_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_LocalInventory_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventory getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventory build() { + com.google.cloud.retail.v2beta.LocalInventory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventory buildPartial() { + com.google.cloud.retail.v2beta.LocalInventory result = + new com.google.cloud.retail.v2beta.LocalInventory(this); + int from_bitField0_ = bitField0_; + result.placeId_ = placeId_; + if (priceInfoBuilder_ == null) { + result.priceInfo_ = priceInfo_; + } else { + result.priceInfo_ = priceInfoBuilder_.build(); + } + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + if (((bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = fulfillmentTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fulfillmentTypes_ = fulfillmentTypes_; + 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.LocalInventory) { + return mergeFrom((com.google.cloud.retail.v2beta.LocalInventory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.LocalInventory other) { + if (other == com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance()) return this; + if (!other.getPlaceId().isEmpty()) { + placeId_ = other.placeId_; + onChanged(); + } + if (other.hasPriceInfo()) { + mergePriceInfo(other.getPriceInfo()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.fulfillmentTypes_.isEmpty()) { + if (fulfillmentTypes_.isEmpty()) { + fulfillmentTypes_ = other.fulfillmentTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.addAll(other.fulfillmentTypes_); + } + 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.LocalInventory parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.LocalInventory) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placeId_ = ""; + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + public java.lang.String getPlaceId() { + java.lang.Object ref = placeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = placeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @param value The placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPlaceId() { + + placeId_ = getDefaultInstance().getPlaceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The place ID for the current set of inventory information.
+     * 
+ * + * string place_id = 1; + * + * @param value The bytes for placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.PriceInfo priceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder> + priceInfoBuilder_; + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + public boolean hasPriceInfo() { + return priceInfoBuilder_ != null || priceInfo_ != null; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + public com.google.cloud.retail.v2beta.PriceInfo getPriceInfo() { + if (priceInfoBuilder_ == null) { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } else { + return priceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2beta.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceInfo_ = value; + onChanged(); + } else { + priceInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2beta.PriceInfo.Builder builderForValue) { + if (priceInfoBuilder_ == null) { + priceInfo_ = builderForValue.build(); + onChanged(); + } else { + priceInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public Builder mergePriceInfo(com.google.cloud.retail.v2beta.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (priceInfo_ != null) { + priceInfo_ = + com.google.cloud.retail.v2beta.PriceInfo.newBuilder(priceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + priceInfo_ = value; + } + onChanged(); + } else { + priceInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public Builder clearPriceInfo() { + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + onChanged(); + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public com.google.cloud.retail.v2beta.PriceInfo.Builder getPriceInfoBuilder() { + + onChanged(); + return getPriceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + public com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder() { + if (priceInfoBuilder_ != null) { + return priceInfoBuilder_.getMessageOrBuilder(); + } else { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder> + getPriceInfoFieldBuilder() { + if (priceInfoBuilder_ == null) { + priceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder>( + getPriceInfo(), getParentForChildren(), isClean()); + priceInfo_ = null; + } + return priceInfoBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional local inventory attributes, for example, store name, promotion
+     * tags, etc.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * At most 30 attributes are allowed.
+     * * The key must be a UTF-8 encoded string with a length limit of 32
+     *   characters.
+     * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+     *   key0LikeThis or KEY_1_LIKE_THIS.
+     * * The attribute values must be of the same type (text or number).
+     * * Only 1 value is allowed for each attribute.
+     * * For text values, the length limit is 256 UTF-8 characters.
+     * * The attribute does not support search. The `searchable` field should be
+     *   unset or set to false.
+     * * The max summed total bytes of custom attribute keys and values per
+     *   product is 5MiB.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList fulfillmentTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFulfillmentTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + fulfillmentTypes_ = new com.google.protobuf.LazyStringArrayList(fulfillmentTypes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return A list containing the fulfillmentTypes. + */ + public com.google.protobuf.ProtocolStringList getFulfillmentTypesList() { + return fulfillmentTypes_.getUnmodifiableView(); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The count of fulfillmentTypes. + */ + public int getFulfillmentTypesCount() { + return fulfillmentTypes_.size(); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + public java.lang.String getFulfillmentTypes(int index) { + return fulfillmentTypes_.get(index); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + public com.google.protobuf.ByteString getFulfillmentTypesBytes(int index) { + return fulfillmentTypes_.getByteString(index); + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The fulfillmentTypes to set. + * @return This builder for chaining. + */ + public Builder setFulfillmentTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addFulfillmentTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param values The fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addAllFulfillmentTypes(java.lang.Iterable values) { + ensureFulfillmentTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fulfillmentTypes_); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFulfillmentTypes() { + fulfillmentTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. Supported fulfillment types. Valid fulfillment type values
+     * include commonly used types (such as pickup in store and same day
+     * delivery), and custom types. Customers have to map custom types to their
+     * display names before rendering UI.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @param value The bytes of the fulfillmentTypes to add. + * @return This builder for chaining. + */ + public Builder addFulfillmentTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFulfillmentTypesIsMutable(); + fulfillmentTypes_.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.LocalInventory) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.LocalInventory) + private static final com.google.cloud.retail.v2beta.LocalInventory DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.LocalInventory(); + } + + public static com.google.cloud.retail.v2beta.LocalInventory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalInventory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocalInventory(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.LocalInventory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventoryOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventoryOrBuilder.java new file mode 100644 index 00000000..b82122b2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocalInventoryOrBuilder.java @@ -0,0 +1,345 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface LocalInventoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.LocalInventory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The placeId. + */ + java.lang.String getPlaceId(); + /** + * + * + *
+   * The place ID for the current set of inventory information.
+   * 
+ * + * string place_id = 1; + * + * @return The bytes for placeId. + */ + com.google.protobuf.ByteString getPlaceIdBytes(); + + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return Whether the priceInfo field is set. + */ + boolean hasPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + * + * @return The priceInfo. + */ + com.google.cloud.retail.v2beta.PriceInfo getPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 2; + */ + com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder(); + + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + int getAttributesCount(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute defaultValue); + /** + * + * + *
+   * Additional local inventory attributes, for example, store name, promotion
+   * tags, etc.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * At most 30 attributes are allowed.
+   * * The key must be a UTF-8 encoded string with a length limit of 32
+   *   characters.
+   * * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example,
+   *   key0LikeThis or KEY_1_LIKE_THIS.
+   * * The attribute values must be of the same type (text or number).
+   * * Only 1 value is allowed for each attribute.
+   * * For text values, the length limit is 256 UTF-8 characters.
+   * * The attribute does not support search. The `searchable` field should be
+   *   unset or set to false.
+   * * The max summed total bytes of custom attribute keys and values per
+   *   product is 5MiB.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 3; + */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return A list containing the fulfillmentTypes. + */ + java.util.List getFulfillmentTypesList(); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The count of fulfillmentTypes. + */ + int getFulfillmentTypesCount(); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The fulfillmentTypes at the given index. + */ + java.lang.String getFulfillmentTypes(int index); + /** + * + * + *
+   * Input only. Supported fulfillment types. Valid fulfillment type values
+   * include commonly used types (such as pickup in store and same day
+   * delivery), and custom types. Customers have to map custom types to their
+   * display names before rendering UI.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param index The index of the value to return. + * @return The bytes of the fulfillmentTypes at the given index. + */ + com.google.protobuf.ByteString getFulfillmentTypesBytes(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocationName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocationName.java new file mode 100644 index 00000000..d2100f66 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java new file mode 100644 index 00000000..a792c9b2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java @@ -0,0 +1,1554 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Represents a link between a Merchant Center account and a branch.
+ * Once a link is established, products from the linked merchant center account
+ * will be streamed to the linked branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.MerchantCenterLink} + */ +public final class MerchantCenterLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.MerchantCenterLink) + MerchantCenterLinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use MerchantCenterLink.newBuilder() to construct. + private MerchantCenterLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantCenterLink() { + branchId_ = ""; + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + regionCode_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantCenterLink(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MerchantCenterLink( + 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 8: + { + merchantCenterAccountId_ = input.readInt64(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branchId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + destinations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + destinations_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + regionCode_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = 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)) { + destinations_ = destinations_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.MerchantCenterLink.class, + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder.class); + } + + public static final int MERCHANT_CENTER_ACCOUNT_ID_FIELD_NUMBER = 1; + private long merchantCenterAccountId_; + /** + * + * + *
+   * Required. The linked [Merchant center account
+   * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+   * The account must be a standalone account or a sub-account of a MCA.
+   * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + @java.lang.Override + public long getMerchantCenterAccountId() { + return merchantCenterAccountId_; + } + + public static final int BRANCH_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object branchId_; + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + @java.lang.Override + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + 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(); + branchId_ = s; + return s; + } + } + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATIONS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList destinations_; + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + public com.google.protobuf.ProtocolStringList getDestinationsList() { + return destinations_; + } + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+   * 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + public java.lang.String getDestinations(int index) { + return destinations_.get(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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + public com.google.protobuf.ByteString getDestinationsBytes(int index) { + return destinations_.getByteString(index); + } + + public static final int REGION_CODE_FIELD_NUMBER = 4; + private volatile java.lang.Object regionCode_; + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + @java.lang.Override + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + 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(); + regionCode_ = s; + return s; + } + } + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = 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 (merchantCenterAccountId_ != 0L) { + output.writeInt64(1, merchantCenterAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branchId_); + } + for (int i = 0; i < destinations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destinations_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, regionCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (merchantCenterAccountId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, merchantCenterAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branchId_); + } + { + int dataSize = 0; + for (int i = 0; i < destinations_.size(); i++) { + dataSize += computeStringSizeNoTag(destinations_.getRaw(i)); + } + size += dataSize; + size += 1 * getDestinationsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, regionCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); + } + 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.MerchantCenterLink)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.MerchantCenterLink other = + (com.google.cloud.retail.v2beta.MerchantCenterLink) obj; + + if (getMerchantCenterAccountId() != other.getMerchantCenterAccountId()) return false; + if (!getBranchId().equals(other.getBranchId())) return false; + if (!getDestinationsList().equals(other.getDestinationsList())) return false; + if (!getRegionCode().equals(other.getRegionCode())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + MERCHANT_CENTER_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMerchantCenterAccountId()); + hash = (37 * hash) + BRANCH_ID_FIELD_NUMBER; + hash = (53 * hash) + getBranchId().hashCode(); + if (getDestinationsCount() > 0) { + hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDestinationsList().hashCode(); + } + hash = (37 * hash) + REGION_CODE_FIELD_NUMBER; + hash = (53 * hash) + getRegionCode().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink 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.MerchantCenterLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink 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.MerchantCenterLink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink 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.MerchantCenterLink parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink 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.MerchantCenterLink parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink 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.MerchantCenterLink 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.MerchantCenterLink 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.MerchantCenterLink 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 a link between a Merchant Center account and a branch.
+   * Once a link is established, products from the linked merchant center account
+   * will be streamed to the linked branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.MerchantCenterLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.MerchantCenterLink) + com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.MerchantCenterLink.class, + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.MerchantCenterLink.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(); + merchantCenterAccountId_ = 0L; + + branchId_ = ""; + + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + regionCode_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLink_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLink getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.MerchantCenterLink.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLink build() { + com.google.cloud.retail.v2beta.MerchantCenterLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLink buildPartial() { + com.google.cloud.retail.v2beta.MerchantCenterLink result = + new com.google.cloud.retail.v2beta.MerchantCenterLink(this); + int from_bitField0_ = bitField0_; + result.merchantCenterAccountId_ = merchantCenterAccountId_; + result.branchId_ = branchId_; + if (((bitField0_ & 0x00000001) != 0)) { + destinations_ = destinations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.destinations_ = destinations_; + result.regionCode_ = regionCode_; + result.languageCode_ = languageCode_; + 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.MerchantCenterLink) { + return mergeFrom((com.google.cloud.retail.v2beta.MerchantCenterLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.MerchantCenterLink other) { + if (other == com.google.cloud.retail.v2beta.MerchantCenterLink.getDefaultInstance()) + return this; + if (other.getMerchantCenterAccountId() != 0L) { + setMerchantCenterAccountId(other.getMerchantCenterAccountId()); + } + if (!other.getBranchId().isEmpty()) { + branchId_ = other.branchId_; + onChanged(); + } + if (!other.destinations_.isEmpty()) { + if (destinations_.isEmpty()) { + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDestinationsIsMutable(); + destinations_.addAll(other.destinations_); + } + onChanged(); + } + if (!other.getRegionCode().isEmpty()) { + regionCode_ = other.regionCode_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + 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.MerchantCenterLink parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.MerchantCenterLink) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long merchantCenterAccountId_; + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + @java.lang.Override + public long getMerchantCenterAccountId() { + return merchantCenterAccountId_; + } + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The merchantCenterAccountId to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterAccountId(long value) { + + merchantCenterAccountId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The linked [Merchant center account
+     * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+     * The account must be a standalone account or a sub-account of a MCA.
+     * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMerchantCenterAccountId() { + + merchantCenterAccountId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object branchId_ = ""; + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @param value The branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branchId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearBranchId() { + + branchId_ = getDefaultInstance().getBranchId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch id (e.g. 0/1/2) within this catalog that products from
+     * merchant_center_account_id are streamed to. When updating this field, an
+     * empty value will use the currently configured default branch. However,
+     * changing the default branch later on won't change the linked branch here.
+     * A single branch id can only have one linked merchant center account id.
+     * 
+ * + * string branch_id = 2; + * + * @param value The bytes for branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branchId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList destinations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDestinationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + destinations_ = new com.google.protobuf.LazyStringArrayList(destinations_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + public com.google.protobuf.ProtocolStringList getDestinationsList() { + return destinations_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + public java.lang.String getDestinations(int index) { + return destinations_.get(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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + public com.google.protobuf.ByteString getDestinationsBytes(int index) { + return destinations_.getByteString(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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param index The index to set the value at. + * @param value The destinations to set. + * @return This builder for chaining. + */ + public Builder setDestinations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param value The destinations to add. + * @return This builder for chaining. + */ + public Builder addDestinations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param values The destinations to add. + * @return This builder for chaining. + */ + public Builder addAllDestinations(java.lang.Iterable values) { + ensureDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinations_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinations() { + destinations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 allowed string values:
+     * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+     * _ads", "Free_listings", "Free_local_listings"
+     * NOTE: The string values are case sensitive.
+     * 
+ * + * repeated string destinations = 3; + * + * @param value The bytes of the destinations to add. + * @return This builder for chaining. + */ + public Builder addDestinationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + return this; + } + + private java.lang.Object regionCode_ = ""; + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + public java.lang.String getRegionCode() { + java.lang.Object ref = regionCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + regionCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + public com.google.protobuf.ByteString getRegionCodeBytes() { + java.lang.Object ref = regionCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + regionCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @param value The regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + regionCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @return This builder for chaining. + */ + public Builder clearRegionCode() { + + regionCode_ = getDefaultInstance().getRegionCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+     * code. List of values can be found
+     * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+     * under the `region` tag. If left blank no region filtering will be
+     * performed.
+     * Example value: `US`.
+     * 
+ * + * string region_code = 4; + * + * @param value The bytes for regionCode to set. + * @return This builder for chaining. + */ + public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + regionCode_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * ISO 639-1.
+     * This specifies the language of offers in Merchant Center that will be
+     * accepted. If  empty no language filtering will be performed.
+     * Example value: `en`.
+     * 
+ * + * string language_code = 5; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = 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.MerchantCenterLink) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.MerchantCenterLink) + private static final com.google.cloud.retail.v2beta.MerchantCenterLink DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.MerchantCenterLink(); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantCenterLink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MerchantCenterLink(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.MerchantCenterLink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java new file mode 100644 index 00000000..5c2cbbd1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface MerchantCenterLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.MerchantCenterLink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The linked [Merchant center account
+   * id](https://developers.google.com/shopping-content/guides/accountstatuses).
+   * The account must be a standalone account or a sub-account of a MCA.
+   * 
+ * + * int64 merchant_center_account_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The merchantCenterAccountId. + */ + long getMerchantCenterAccountId(); + + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The branchId. + */ + java.lang.String getBranchId(); + /** + * + * + *
+   * The branch id (e.g. 0/1/2) within this catalog that products from
+   * merchant_center_account_id are streamed to. When updating this field, an
+   * empty value will use the currently configured default branch. However,
+   * changing the default branch later on won't change the linked branch here.
+   * A single branch id can only have one linked merchant center account id.
+   * 
+ * + * string branch_id = 2; + * + * @return The bytes for branchId. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return A list containing the destinations. + */ + java.util.List 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @return The count of destinations. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the element to return. + * @return The destinations at the given index. + */ + 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 allowed string values:
+   * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
+   * _ads", "Free_listings", "Free_local_listings"
+   * NOTE: The string values are case sensitive.
+   * 
+ * + * repeated string destinations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the destinations at the given index. + */ + com.google.protobuf.ByteString getDestinationsBytes(int index); + + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The regionCode. + */ + java.lang.String getRegionCode(); + /** + * + * + *
+   * Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
+   * code. List of values can be found
+   * [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
+   * under the `region` tag. If left blank no region filtering will be
+   * performed.
+   * Example value: `US`.
+   * 
+ * + * string region_code = 4; + * + * @return The bytes for regionCode. + */ + com.google.protobuf.ByteString getRegionCodeBytes(); + + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * ISO 639-1.
+   * This specifies the language of offers in Merchant Center that will be
+   * accepted. If  empty no language filtering will be performed.
+   * Example value: `en`.
+   * 
+ * + * string language_code = 5; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfig.java new file mode 100644 index 00000000..aa1e095c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfig.java @@ -0,0 +1,960 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Configures Merchant Center linking.
+ * Links contained in the config will be used to sync data from a Merchant
+ * Center account to a Cloud Retail branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.MerchantCenterLinkingConfig} + */ +public final class MerchantCenterLinkingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.MerchantCenterLinkingConfig) + MerchantCenterLinkingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use MerchantCenterLinkingConfig.newBuilder() to construct. + private MerchantCenterLinkingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantCenterLinkingConfig() { + links_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantCenterLinkingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MerchantCenterLinkingConfig( + 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)) { + links_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + links_.add( + input.readMessage( + com.google.cloud.retail.v2beta.MerchantCenterLink.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)) { + links_ = java.util.Collections.unmodifiableList(links_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.class, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder.class); + } + + public static final int LINKS_FIELD_NUMBER = 1; + private java.util.List links_; + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + @java.lang.Override + public java.util.List + getLinksOrBuilderList() { + return links_; + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLink getLinks(int index) { + return links_.get(index); + } + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder getLinksOrBuilder(int index) { + return links_.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 { + for (int i = 0; i < links_.size(); i++) { + output.writeMessage(1, links_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, links_.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.MerchantCenterLinkingConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig other = + (com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig) obj; + + if (!getLinksList().equals(other.getLinksList())) 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 (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig 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.MerchantCenterLinkingConfig 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; + } + /** + * + * + *
+   * Configures Merchant Center linking.
+   * Links contained in the config will be used to sync data from a Merchant
+   * Center account to a Cloud Retail branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.MerchantCenterLinkingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.MerchantCenterLinkingConfig) + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.class, + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linksBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_MerchantCenterLinkingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig build() { + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig buildPartial() { + com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig result = + new com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig(this); + int from_bitField0_ = bitField0_; + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.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.MerchantCenterLinkingConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig other) { + if (other == com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig.getDefaultInstance()) + return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLinksFieldBuilder() + : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + 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.MerchantCenterLinkingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List links_ = + java.util.Collections.emptyList(); + + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLink, + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder> + linksBuilder_; + + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2beta.MerchantCenterLink getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder setLinks(int index, com.google.cloud.retail.v2beta.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder setLinks( + int index, com.google.cloud.retail.v2beta.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder addLinks(com.google.cloud.retail.v2beta.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder addLinks(int index, com.google.cloud.retail.v2beta.MerchantCenterLink value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder addLinks( + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder addLinks( + int index, com.google.cloud.retail.v2beta.MerchantCenterLink.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder addAllLinks( + java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2beta.MerchantCenterLink.Builder getLinksBuilder(int index) { + return getLinksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder getLinksOrBuilder(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public java.util.List + getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2beta.MerchantCenterLink.Builder addLinksBuilder() { + return getLinksFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.MerchantCenterLink.getDefaultInstance()); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public com.google.cloud.retail.v2beta.MerchantCenterLink.Builder addLinksBuilder(int index) { + return getLinksFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.MerchantCenterLink.getDefaultInstance()); + } + /** + * + * + *
+     * Links between Merchant Center accounts and branches.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + public java.util.List + getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLink, + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.MerchantCenterLink, + com.google.cloud.retail.v2beta.MerchantCenterLink.Builder, + com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder>( + links_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + links_ = null; + } + return linksBuilder_; + } + + @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.MerchantCenterLinkingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.MerchantCenterLinkingConfig) + private static final com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig(); + } + + public static com.google.cloud.retail.v2beta.MerchantCenterLinkingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantCenterLinkingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MerchantCenterLinkingConfig(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.MerchantCenterLinkingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfigOrBuilder.java new file mode 100644 index 00000000..3ea3ec62 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkingConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface MerchantCenterLinkingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.MerchantCenterLinkingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + java.util.List getLinksList(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + com.google.cloud.retail.v2beta.MerchantCenterLink getLinks(int index); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + int getLinksCount(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + java.util.List + getLinksOrBuilderList(); + /** + * + * + *
+   * Links between Merchant Center accounts and branches.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.MerchantCenterLink links = 1; + */ + com.google.cloud.retail.v2beta.MerchantCenterLinkOrBuilder getLinksOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java new file mode 100644 index 00000000..57c8073e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java @@ -0,0 +1,2760 @@ +/* + * 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/prediction_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for Predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictRequest} + */ +public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PredictRequest) + PredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequest.newBuilder() to construct. + private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequest() { + placement_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictRequest( + 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(); + + placement_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserEvent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 48: + { + validateOnly_ = input.readBool(); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + params_ = + com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + params_.getMutableMap().put(params__.getKey(), params__.getValue()); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + 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.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetParams(); + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictRequest.class, + com.google.cloud.retail.v2beta.PredictRequest.Builder.class); + } + + public static final int PLACEMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object placement_; + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + @java.lang.Override + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + 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(); + placement_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.UserEvent userEvent_; + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + @java.lang.Override + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 6; + private boolean validateOnly_; + /** + * + * + *
+   * Use validate only mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary products.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int PARAMS_FIELD_NUMBER = 7; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(placement_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_); + } + if (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (validateOnly_ != false) { + output.writeBool(6, validateOnly_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 7); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + 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(placement_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_); + } + if (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, params__); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + 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.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PredictRequest other = + (com.google.cloud.retail.v2beta.PredictRequest) obj; + + if (!getPlacement().equals(other.getPlacement())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) 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) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + if (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictRequest 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.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictRequest 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.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictRequest 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.PredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictRequest 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.PredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictRequest 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.PredictRequest 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.PredictRequest 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.PredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for Predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PredictRequest) + com.google.cloud.retail.v2beta.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetParams(); + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableParams(); + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictRequest.class, + com.google.cloud.retail.v2beta.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PredictRequest.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(); + placement_ = ""; + + if (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + validateOnly_ = false; + + internalGetMutableParams().clear(); + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictRequest build() { + com.google.cloud.retail.v2beta.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictRequest buildPartial() { + com.google.cloud.retail.v2beta.PredictRequest result = + new com.google.cloud.retail.v2beta.PredictRequest(this); + int from_bitField0_ = bitField0_; + result.placement_ = placement_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.validateOnly_ = validateOnly_; + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + 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.PredictRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.PredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PredictRequest other) { + if (other == com.google.cloud.retail.v2beta.PredictRequest.getDefaultInstance()) return this; + if (!other.getPlacement().isEmpty()) { + placement_ = other.placement_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + 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.PredictRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.PredictRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placement_ = ""; + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placement to set. + * @return This builder for chaining. + */ + public Builder setPlacement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placement_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlacement() { + + placement_ = getDefaultInstance().getPlacement(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+     * The ID of the Recommendations AI placement. Before you can request
+     * predictions from your model, you must create at least one placement for it.
+     * For more information, see [Managing
+     * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+     * The full list of available placements can be seen at
+     * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for placement to set. + * @return This builder for chaining. + */ + public Builder setPlacementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placement_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.retail.v2beta.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2beta.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.retail.v2beta.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the predict request. Note that this user event detail
+     * won't be ingested to userEvent logs. Thus, a separate userEvent write
+     * request is required for event logging.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The previous PredictResponse.next_page_token.
+     * 
+ * + * string page_token = 4; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting prediction results with a length limit of 5,000
+     * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+     *  * Tag expressions. Restricts predictions to products that match all of the
+     *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+     *    expression is enclosed in parentheses, and must be separated from the
+     *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+     *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+     *    with a size limit of 1,000 characters.
+     *    Note: "Recently viewed" models don't support tag filtering at the
+     *    moment.
+     *  * filterOutOfStockItems. Restricts predictions to products that do not
+     *  have a
+     *    stockState value of OUT_OF_STOCK.
+     * Examples:
+     *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+     *  * filterOutOfStockItems  tag=(-"promotional")
+     *  * filterOutOfStockItems
+     * If your filter blocks all prediction results, the API will return generic
+     * (unfiltered) popular products. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+     * receive empty results instead.
+     * Note that the API will never return items with storageStatus of "EXPIRED"
+     * or "DELETED" regardless of filter choices.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Use validate only mode for this prediction query. If set to true, a
+     * dummy model will be used that returns arbitrary products.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 6; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + private com.google.protobuf.MapField + internalGetMutableParams() { + onChanged(); + ; + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().getMap().containsKey(key); + } + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + @java.lang.Override + public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearParams() { + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableParams().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder putParams(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableParams().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the predictions.
+     * Allowed values:
+     * * `returnProduct`: Boolean. If set to true, the associated product
+     *    object will be returned in the `results.metadata` field in the
+     *    prediction response.
+     * * `returnScore`: Boolean. If set to true, the prediction 'score'
+     *    corresponding to each returned product will be set in the
+     *    `results.metadata` field in the prediction response. The given
+     *    'score' indicates the probability of an product being clicked/purchased
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular products instead of empty if
+     *    your filter blocks all prediction results.
+     * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+     *    'medium-price-reranking', 'high-price-reranking'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    price.
+     * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+     *    it needs to be one of {'no-diversity', 'low-diversity',
+     *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+     *    request-level control and adjusts prediction results based on product
+     *    category.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels applied to a resource must meet the following requirements:
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters, and cannot be empty. Values can be empty, and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + 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.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PredictRequest) + private static final com.google.cloud.retail.v2beta.PredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PredictRequest(); + } + + public static com.google.cloud.retail.v2beta.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictRequest(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.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java new file mode 100644 index 00000000..c7837d6c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java @@ -0,0 +1,538 @@ +/* + * 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/prediction_service.proto + +package com.google.cloud.retail.v2beta; + +public interface PredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + java.lang.String getPlacement(); + /** + * + * + *
+   * Required. Full resource name of the format:
+   * {name=projects/*/locations/global/catalogs/default_catalog/placements/*}
+   * The ID of the Recommendations AI placement. Before you can request
+   * predictions from your model, you must create at least one placement for it.
+   * For more information, see [Managing
+   * placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
+   * The full list of available placements can be seen at
+   * https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + com.google.protobuf.ByteString getPlacementBytes(); + + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.retail.v2beta.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the predict request. Note that this user event detail
+   * won't be ingested to userEvent logs. Thus, a separate userEvent write
+   * request is required for event logging.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The previous PredictResponse.next_page_token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filter for restricting prediction results with a length limit of 5,000
+   * characters. Accepts values for tags and the `filterOutOfStockItems` flag.
+   *  * Tag expressions. Restricts predictions to products that match all of the
+   *    specified tags. Boolean operators `OR` and `NOT` are supported if the
+   *    expression is enclosed in parentheses, and must be separated from the
+   *    tag values by a space. `-"tagA"` is also supported and is equivalent to
+   *    `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
+   *    with a size limit of 1,000 characters.
+   *    Note: "Recently viewed" models don't support tag filtering at the
+   *    moment.
+   *  * filterOutOfStockItems. Restricts predictions to products that do not
+   *  have a
+   *    stockState value of OUT_OF_STOCK.
+   * Examples:
+   *  * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
+   *  * filterOutOfStockItems  tag=(-"promotional")
+   *  * filterOutOfStockItems
+   * If your filter blocks all prediction results, the API will return generic
+   * (unfiltered) popular products. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in `PredictRequest.params` to
+   * receive empty results instead.
+   * Note that the API will never return items with storageStatus of "EXPIRED"
+   * or "DELETED" regardless of filter choices.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Use validate only mode for this prediction query. If set to true, a
+   * dummy model will be used that returns arbitrary products.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 6; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + + /* nullable */ + com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Additional domain specific parameters for the predictions.
+   * Allowed values:
+   * * `returnProduct`: Boolean. If set to true, the associated product
+   *    object will be returned in the `results.metadata` field in the
+   *    prediction response.
+   * * `returnScore`: Boolean. If set to true, the prediction 'score'
+   *    corresponding to each returned product will be set in the
+   *    `results.metadata` field in the prediction response. The given
+   *    'score' indicates the probability of an product being clicked/purchased
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular products instead of empty if
+   *    your filter blocks all prediction results.
+   * * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-price-reranking', 'low-price-reranking',
+   *    'medium-price-reranking', 'high-price-reranking'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    price.
+   * * `diversityLevel`: String. Default empty. If set to be non-empty, then
+   *    it needs to be one of {'no-diversity', 'low-diversity',
+   *    'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
+   *    request-level control and adjusts prediction results based on product
+   *    category.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 7; + */ + com.google.protobuf.Value getParamsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The labels applied to a resource must meet the following requirements:
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters, and cannot be empty. Values can be empty, and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponse.java new file mode 100644 index 00000000..7e1e561a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponse.java @@ -0,0 +1,2724 @@ +/* + * 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/prediction_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response message for predict method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictResponse} + */ +public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PredictResponse) + PredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictResponse.newBuilder() to construct. + private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictResponse() { + results_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictResponse( + 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)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + missingIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + missingIds_.add(s); + break; + } + case 32: + { + validateOnly_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + missingIds_ = missingIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictResponse.class, + com.google.cloud.retail.v2beta.PredictResponse.Builder.class); + } + + public interface PredictionResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PredictResponse.PredictionResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + int getMetadataCount(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + + /* nullable */ + com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + com.google.protobuf.Value getMetadataOrThrow(java.lang.String key); + } + /** + * + * + *
+   * PredictionResult represents the recommendation prediction results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictResponse.PredictionResult} + */ + public static final class PredictionResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PredictResponse.PredictionResult) + PredictionResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictionResult.newBuilder() to construct. + private PredictionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictionResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PredictionResult( + 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(); + + id_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + 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.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.class, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * ID of the recommended product
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 2; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Additional product metadata / annotations.
+     * Possible values:
+     * * `product`: JSON representation of the product. Will be set if
+     *   `returnProduct` is set to true in `PredictRequest.params`.
+     * * `score`: Prediction score in double value. Will be set if
+     *   `returnScore` is set to true in `PredictRequest.params`.
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__); + } + 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.PredictResponse.PredictionResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult other = + (com.google.cloud.retail.v2beta.PredictResponse.PredictionResult) obj; + + if (!getId().equals(other.getId())) return false; + if (!internalGetMetadata().equals(other.internalGetMetadata())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult + 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.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult 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.PredictResponse.PredictionResult 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; + } + /** + * + * + *
+     * PredictionResult represents the recommendation prediction results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictResponse.PredictionResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PredictResponse.PredictionResult) + com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.class, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.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(); + id_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult build() { + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult buildPartial() { + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult result = + new com.google.cloud.retail.v2beta.PredictResponse.PredictionResult(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + 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.PredictResponse.PredictionResult) { + return mergeFrom((com.google.cloud.retail.v2beta.PredictResponse.PredictionResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult other) { + if (other + == com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + 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.PredictResponse.PredictionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.PredictResponse.PredictionResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * ID of the recommended product
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + @java.lang.Override + public com.google.protobuf.Value getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder putMetadata(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Additional product metadata / annotations.
+       * Possible values:
+       * * `product`: JSON representation of the product. Will be set if
+       *   `returnProduct` is set to true in `PredictRequest.params`.
+       * * `score`: Prediction score in double value. Will be set if
+       *   `returnScore` is set to true in `PredictRequest.params`.
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 2; + */ + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + 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.PredictResponse.PredictionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PredictResponse.PredictionResult) + private static final com.google.cloud.retail.v2beta.PredictResponse.PredictionResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PredictResponse.PredictionResult(); + } + + public static com.google.cloud.retail.v2beta.PredictResponse.PredictionResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictionResult(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.PredictResponse.PredictionResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List results_; + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MISSING_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList missingIds_; + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + return missingIds_; + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + public java.lang.String getMissingIds(int index) { + return missingIds_.get(index); + } + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + public com.google.protobuf.ByteString getMissingIdsBytes(int index) { + return missingIds_.getByteString(index); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_; + /** + * + * + *
+   * True if the validateOnly property was set in the request.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributionToken_); + } + for (int i = 0; i < missingIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, missingIds_.getRaw(i)); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributionToken_); + } + { + int dataSize = 0; + for (int i = 0; i < missingIds_.size(); i++) { + dataSize += computeStringSizeNoTag(missingIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getMissingIdsList().size(); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PredictResponse other = + (com.google.cloud.retail.v2beta.PredictResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getMissingIdsList().equals(other.getMissingIdsList())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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 (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getMissingIdsCount() > 0) { + hash = (37 * hash) + MISSING_IDS_FIELD_NUMBER; + hash = (53 * hash) + getMissingIdsList().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PredictResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse 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.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse 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.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PredictResponse 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.PredictResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictResponse 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.PredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PredictResponse 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.PredictResponse 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.PredictResponse 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.PredictResponse 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 message for predict method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PredictResponse) + com.google.cloud.retail.v2beta.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PredictResponse.class, + com.google.cloud.retail.v2beta.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PredictResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + attributionToken_ = ""; + + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PredictionServiceProto + .internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse build() { + com.google.cloud.retail.v2beta.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PredictResponse buildPartial() { + com.google.cloud.retail.v2beta.PredictResponse result = + new com.google.cloud.retail.v2beta.PredictResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.attributionToken_ = attributionToken_; + if (((bitField0_ & 0x00000002) != 0)) { + missingIds_ = missingIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.missingIds_ = missingIds_; + result.validateOnly_ = validateOnly_; + 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.PredictResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.PredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PredictResponse other) { + if (other == com.google.cloud.retail.v2beta.PredictResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (!other.missingIds_.isEmpty()) { + if (missingIds_.isEmpty()) { + missingIds_ = other.missingIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMissingIdsIsMutable(); + missingIds_.addAll(other.missingIds_); + } + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.PredictResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.PredictResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult>(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, com.google.cloud.retail.v2beta.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, com.google.cloud.retail.v2beta.PredictResponse.PredictionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2beta.PredictResponse.PredictionResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder + getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended products. The order represents the ranking (from the
+     * most relevant product to the least).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + * + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult.Builder, + com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * recommendation, which enables accurate attribution of recommendation model
+     * performance.
+     * 
+ * + * string attribution_token = 2; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList missingIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMissingIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + missingIds_ = new com.google.protobuf.LazyStringArrayList(missingIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + return missingIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + public java.lang.String getMissingIds(int index) { + return missingIds_.get(index); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + public com.google.protobuf.ByteString getMissingIdsBytes(int index) { + return missingIds_.getByteString(index); + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index to set the value at. + * @param value The missingIds to set. + * @return This builder for chaining. + */ + public Builder setMissingIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingIdsIsMutable(); + missingIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param value The missingIds to add. + * @return This builder for chaining. + */ + public Builder addMissingIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingIdsIsMutable(); + missingIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param values The missingIds to add. + * @return This builder for chaining. + */ + public Builder addAllMissingIds(java.lang.Iterable values) { + ensureMissingIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, missingIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearMissingIds() { + missingIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of products in the request that were missing from the inventory.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @param value The bytes of the missingIds to add. + * @return This builder for chaining. + */ + public Builder addMissingIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMissingIdsIsMutable(); + missingIds_.add(value); + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the validateOnly property was set in the request.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = 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.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PredictResponse) + private static final com.google.cloud.retail.v2beta.PredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PredictResponse(); + } + + public static com.google.cloud.retail.v2beta.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PredictResponse(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.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponseOrBuilder.java new file mode 100644 index 00000000..56858123 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictResponseOrBuilder.java @@ -0,0 +1,178 @@ +/* + * 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/prediction_service.proto + +package com.google.cloud.retail.v2beta; + +public interface PredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + java.util.List getResultsList(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + com.google.cloud.retail.v2beta.PredictResponse.PredictionResult getResults(int index); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + int getResultsCount(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of recommended products. The order represents the ranking (from the
+   * most relevant product to the least).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.PredictResponse.PredictionResult results = 1; + */ + com.google.cloud.retail.v2beta.PredictResponse.PredictionResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * recommendation, which enables accurate attribution of recommendation model
+   * performance.
+   * 
+ * + * string attribution_token = 2; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + java.util.List getMissingIdsList(); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + int getMissingIdsCount(); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the element to return. + * @return The missingIds at the given index. + */ + java.lang.String getMissingIds(int index); + /** + * + * + *
+   * IDs of products in the request that were missing from the inventory.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the missingIds at the given index. + */ + com.google.protobuf.ByteString getMissingIdsBytes(int index); + + /** + * + * + *
+   * True if the validateOnly property was set in the request.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java new file mode 100644 index 00000000..fdc49290 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java @@ -0,0 +1,193 @@ +/* + * 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/prediction_service.proto + +package com.google.cloud.retail.v2beta; + +public final class PredictionServiceProto { + private PredictionServiceProto() {} + + 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_PredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/retail/v2beta/prediction_" + + "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\232\002\n\021PredictionServ" + + "ice\022\271\001\n\007Predict\022*.google.cloud.retail.v2" + + "beta.PredictRequest\032+.google.cloud.retai" + + "l.v2beta.PredictResponse\"U\202\323\344\223\002O\"J/v2bet" + + "a/{placement=projects/*/locations/*/cata" + + "logs/*/placements/*}:predict:\001*\032I\312A\025reta" + + "il.googleapis.com\322A.https://www.googleap" + + "is.com/auth/cloud-platformB\337\001\n\036com.googl" + + "e.cloud.retail.v2betaB\026PredictionService" + + "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" + }; + 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.cloud.retail.v2beta.UserEventProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_PredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor, + new java.lang.String[] { + "Placement", + "UserEvent", + "PageSize", + "PageToken", + "Filter", + "ValidateOnly", + "Params", + "Labels", + }); + internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_descriptor = + internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_descriptor = + internal_static_google_cloud_retail_v2beta_PredictRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_PredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor, + new java.lang.String[] { + "Results", "AttributionToken", "MissingIds", "ValidateOnly", + }); + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor = + internal_static_google_cloud_retail_v2beta_PredictResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor, + new java.lang.String[] { + "Id", "Metadata", + }); + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_descriptor = + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PredictResponse_PredictionResult_MetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + 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.oauthScopes); + 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.cloud.retail.v2beta.UserEventProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfo.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfo.java new file mode 100644 index 00000000..22774f13 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfo.java @@ -0,0 +1,3487 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The price information of a [Product][google.cloud.retail.v2beta.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PriceInfo} + */ +public final class PriceInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PriceInfo) + PriceInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceInfo.newBuilder() to construct. + private PriceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PriceInfo() { + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PriceInfo( + 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(); + + currencyCode_ = s; + break; + } + case 21: + { + price_ = input.readFloat(); + break; + } + case 29: + { + originalPrice_ = input.readFloat(); + break; + } + case 37: + { + cost_ = input.readFloat(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceEffectiveTime_ != null) { + subBuilder = priceEffectiveTime_.toBuilder(); + } + priceEffectiveTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceEffectiveTime_); + priceEffectiveTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (priceExpireTime_ != null) { + subBuilder = priceExpireTime_.toBuilder(); + } + priceExpireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceExpireTime_); + priceExpireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder subBuilder = null; + if (priceRange_ != null) { + subBuilder = priceRange_.toBuilder(); + } + priceRange_ = + input.readMessage( + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceRange_); + priceRange_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PriceInfo.class, + com.google.cloud.retail.v2beta.PriceInfo.Builder.class); + } + + public interface PriceRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PriceInfo.PriceRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return Whether the price field is set. + */ + boolean hasPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return The price. + */ + com.google.cloud.retail.v2beta.Interval getPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + com.google.cloud.retail.v2beta.IntervalOrBuilder getPriceOrBuilder(); + + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + boolean hasOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return The originalPrice. + */ + com.google.cloud.retail.v2beta.Interval getOriginalPrice(); + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + com.google.cloud.retail.v2beta.IntervalOrBuilder getOriginalPriceOrBuilder(); + } + /** + * + * + *
+   * The price range of all
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product] having the same
+   * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PriceInfo.PriceRange} + */ + public static final class PriceRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PriceInfo.PriceRange) + PriceRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use PriceRange.newBuilder() to construct. + private PriceRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PriceRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PriceRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PriceRange( + 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.Interval.Builder subBuilder = null; + if (price_ != null) { + subBuilder = price_.toBuilder(); + } + price_ = + input.readMessage( + com.google.cloud.retail.v2beta.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(price_); + price_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.retail.v2beta.Interval.Builder subBuilder = null; + if (originalPrice_ != null) { + subBuilder = originalPrice_.toBuilder(); + } + originalPrice_ = + input.readMessage( + com.google.cloud.retail.v2beta.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(originalPrice_); + originalPrice_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder.class); + } + + public static final int PRICE_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Interval price_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return Whether the price field is set. + */ + @java.lang.Override + public boolean hasPrice() { + return price_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return The price. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getPrice() { + return price_ == null ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() : price_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+     * interval of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.IntervalOrBuilder getPriceOrBuilder() { + return getPrice(); + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.Interval originalPrice_; + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + @java.lang.Override + public boolean hasOriginalPrice() { + return originalPrice_ != null; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return The originalPrice. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getOriginalPrice() { + return originalPrice_ == null + ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() + : originalPrice_; + } + /** + * + * + *
+     * The inclusive
+     * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+     * internal of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.IntervalOrBuilder getOriginalPriceOrBuilder() { + return getOriginalPrice(); + } + + 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 (price_ != null) { + output.writeMessage(1, getPrice()); + } + if (originalPrice_ != null) { + output.writeMessage(2, getOriginalPrice()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (price_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPrice()); + } + if (originalPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOriginalPrice()); + } + 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.PriceInfo.PriceRange)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PriceInfo.PriceRange other = + (com.google.cloud.retail.v2beta.PriceInfo.PriceRange) obj; + + if (hasPrice() != other.hasPrice()) return false; + if (hasPrice()) { + if (!getPrice().equals(other.getPrice())) return false; + } + if (hasOriginalPrice() != other.hasOriginalPrice()) return false; + if (hasOriginalPrice()) { + if (!getOriginalPrice().equals(other.getOriginalPrice())) 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 (hasPrice()) { + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + getPrice().hashCode(); + } + if (hasOriginalPrice()) { + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalPrice().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange 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.PriceInfo.PriceRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange 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.PriceInfo.PriceRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange 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.PriceInfo.PriceRange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange 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.PriceInfo.PriceRange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange 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.PriceInfo.PriceRange 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.PriceInfo.PriceRange 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.PriceInfo.PriceRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The price range of all
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] having the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PriceInfo.PriceRange} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PriceInfo.PriceRange) + com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.class, + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PriceInfo.PriceRange.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 (priceBuilder_ == null) { + price_ = null; + } else { + price_ = null; + priceBuilder_ = null; + } + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_PriceRange_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PriceInfo.PriceRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange build() { + com.google.cloud.retail.v2beta.PriceInfo.PriceRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange buildPartial() { + com.google.cloud.retail.v2beta.PriceInfo.PriceRange result = + new com.google.cloud.retail.v2beta.PriceInfo.PriceRange(this); + if (priceBuilder_ == null) { + result.price_ = price_; + } else { + result.price_ = priceBuilder_.build(); + } + if (originalPriceBuilder_ == null) { + result.originalPrice_ = originalPrice_; + } else { + result.originalPrice_ = originalPriceBuilder_.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.PriceInfo.PriceRange) { + return mergeFrom((com.google.cloud.retail.v2beta.PriceInfo.PriceRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PriceInfo.PriceRange other) { + if (other == com.google.cloud.retail.v2beta.PriceInfo.PriceRange.getDefaultInstance()) + return this; + if (other.hasPrice()) { + mergePrice(other.getPrice()); + } + if (other.hasOriginalPrice()) { + mergeOriginalPrice(other.getOriginalPrice()); + } + 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.PriceInfo.PriceRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.PriceInfo.PriceRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Interval price_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + priceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return Whether the price field is set. + */ + public boolean hasPrice() { + return priceBuilder_ != null || price_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + * + * @return The price. + */ + public com.google.cloud.retail.v2beta.Interval getPrice() { + if (priceBuilder_ == null) { + return price_ == null + ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() + : price_; + } else { + return priceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2beta.Interval value) { + if (priceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + onChanged(); + } else { + priceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public Builder setPrice(com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (priceBuilder_ == null) { + price_ = builderForValue.build(); + onChanged(); + } else { + priceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public Builder mergePrice(com.google.cloud.retail.v2beta.Interval value) { + if (priceBuilder_ == null) { + if (price_ != null) { + price_ = + com.google.cloud.retail.v2beta.Interval.newBuilder(price_) + .mergeFrom(value) + .buildPartial(); + } else { + price_ = value; + } + onChanged(); + } else { + priceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public Builder clearPrice() { + if (priceBuilder_ == null) { + price_ = null; + onChanged(); + } else { + price_ = null; + priceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public com.google.cloud.retail.v2beta.Interval.Builder getPriceBuilder() { + + onChanged(); + return getPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + public com.google.cloud.retail.v2beta.IntervalOrBuilder getPriceOrBuilder() { + if (priceBuilder_ != null) { + return priceBuilder_.getMessageOrBuilder(); + } else { + return price_ == null + ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() + : price_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price]
+       * interval of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval price = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + getPriceFieldBuilder() { + if (priceBuilder_ == null) { + priceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder>( + getPrice(), getParentForChildren(), isClean()); + price_ = null; + } + return priceBuilder_; + } + + private com.google.cloud.retail.v2beta.Interval originalPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + originalPriceBuilder_; + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return Whether the originalPrice field is set. + */ + public boolean hasOriginalPrice() { + return originalPriceBuilder_ != null || originalPrice_ != null; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + * + * @return The originalPrice. + */ + public com.google.cloud.retail.v2beta.Interval getOriginalPrice() { + if (originalPriceBuilder_ == null) { + return originalPrice_ == null + ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() + : originalPrice_; + } else { + return originalPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public Builder setOriginalPrice(com.google.cloud.retail.v2beta.Interval value) { + if (originalPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalPrice_ = value; + onChanged(); + } else { + originalPriceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public Builder setOriginalPrice( + com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (originalPriceBuilder_ == null) { + originalPrice_ = builderForValue.build(); + onChanged(); + } else { + originalPriceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public Builder mergeOriginalPrice(com.google.cloud.retail.v2beta.Interval value) { + if (originalPriceBuilder_ == null) { + if (originalPrice_ != null) { + originalPrice_ = + com.google.cloud.retail.v2beta.Interval.newBuilder(originalPrice_) + .mergeFrom(value) + .buildPartial(); + } else { + originalPrice_ = value; + } + onChanged(); + } else { + originalPriceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public Builder clearOriginalPrice() { + if (originalPriceBuilder_ == null) { + originalPrice_ = null; + onChanged(); + } else { + originalPrice_ = null; + originalPriceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public com.google.cloud.retail.v2beta.Interval.Builder getOriginalPriceBuilder() { + + onChanged(); + return getOriginalPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + public com.google.cloud.retail.v2beta.IntervalOrBuilder getOriginalPriceOrBuilder() { + if (originalPriceBuilder_ != null) { + return originalPriceBuilder_.getMessageOrBuilder(); + } else { + return originalPrice_ == null + ? com.google.cloud.retail.v2beta.Interval.getDefaultInstance() + : originalPrice_; + } + } + /** + * + * + *
+       * The inclusive
+       * [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
+       * internal of all
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] having the same
+       * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id].
+       * 
+ * + * .google.cloud.retail.v2beta.Interval original_price = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + getOriginalPriceFieldBuilder() { + if (originalPriceBuilder_ == null) { + originalPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder>( + getOriginalPrice(), getParentForChildren(), isClean()); + originalPrice_ = null; + } + return originalPriceBuilder_; + } + + @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.PriceInfo.PriceRange) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PriceInfo.PriceRange) + private static final com.google.cloud.retail.v2beta.PriceInfo.PriceRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PriceInfo.PriceRange(); + } + + public static com.google.cloud.retail.v2beta.PriceInfo.PriceRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceRange(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.PriceInfo.PriceRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_FIELD_NUMBER = 2; + private float price_; + /** + * + * + *
+   * Price of the product.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+   * property [Offer.price](https://schema.org/price).
+   * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + + public static final int ORIGINAL_PRICE_FIELD_NUMBER = 3; + private float originalPrice_; + /** + * + * + *
+   * Price of the product without any discount. If zero, by default set to be
+   * the [price][google.cloud.retail.v2beta.PriceInfo.price].
+   * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + @java.lang.Override + public float getOriginalPrice() { + return originalPrice_; + } + + public static final int COST_FIELD_NUMBER = 4; + private float cost_; + /** + * + * + *
+   * The costs associated with the sale of a particular product. Used for gross
+   * profit reporting.
+   * * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] -
+   * [cost][google.cloud.retail.v2beta.PriceInfo.cost]
+   * Google Merchant Center property
+   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int PRICE_EFFECTIVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp priceEffectiveTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + @java.lang.Override + public boolean hasPriceEffectiveTime() { + return priceEffectiveTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + return getPriceEffectiveTime(); + } + + public static final int PRICE_EXPIRE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp priceExpireTime_; + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + @java.lang.Override + public boolean hasPriceExpireTime() { + return priceExpireTime_ != null; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPriceExpireTime() { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + return getPriceExpireTime(); + } + + public static final int PRICE_RANGE_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2beta.PriceInfo.PriceRange priceRange_; + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + @java.lang.Override + public boolean hasPriceRange() { + return priceRange_ != null; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange getPriceRange() { + return priceRange_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + return getPriceRange(); + } + + 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(currencyCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currencyCode_); + } + if (java.lang.Float.floatToRawIntBits(price_) != 0) { + output.writeFloat(2, price_); + } + if (java.lang.Float.floatToRawIntBits(originalPrice_) != 0) { + output.writeFloat(3, originalPrice_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + output.writeFloat(4, cost_); + } + if (priceEffectiveTime_ != null) { + output.writeMessage(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + output.writeMessage(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + output.writeMessage(7, getPriceRange()); + } + 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(currencyCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currencyCode_); + } + if (java.lang.Float.floatToRawIntBits(price_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, price_); + } + if (java.lang.Float.floatToRawIntBits(originalPrice_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalPrice_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + } + if (priceEffectiveTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPriceEffectiveTime()); + } + if (priceExpireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPriceExpireTime()); + } + if (priceRange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPriceRange()); + } + 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.PriceInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PriceInfo other = (com.google.cloud.retail.v2beta.PriceInfo) obj; + + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + if (java.lang.Float.floatToIntBits(getPrice()) + != java.lang.Float.floatToIntBits(other.getPrice())) return false; + if (java.lang.Float.floatToIntBits(getOriginalPrice()) + != java.lang.Float.floatToIntBits(other.getOriginalPrice())) return false; + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + if (hasPriceEffectiveTime() != other.hasPriceEffectiveTime()) return false; + if (hasPriceEffectiveTime()) { + if (!getPriceEffectiveTime().equals(other.getPriceEffectiveTime())) return false; + } + if (hasPriceExpireTime() != other.hasPriceExpireTime()) return false; + if (hasPriceExpireTime()) { + if (!getPriceExpireTime().equals(other.getPriceExpireTime())) return false; + } + if (hasPriceRange() != other.hasPriceRange()) return false; + if (hasPriceRange()) { + if (!getPriceRange().equals(other.getPriceRange())) 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) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrice()); + hash = (37 * hash) + ORIGINAL_PRICE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalPrice()); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + if (hasPriceEffectiveTime()) { + hash = (37 * hash) + PRICE_EFFECTIVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceEffectiveTime().hashCode(); + } + if (hasPriceExpireTime()) { + hash = (37 * hash) + PRICE_EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPriceExpireTime().hashCode(); + } + if (hasPriceRange()) { + hash = (37 * hash) + PRICE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getPriceRange().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PriceInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo 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.PriceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo 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.PriceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PriceInfo 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.PriceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PriceInfo 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.PriceInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PriceInfo 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.PriceInfo 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.PriceInfo 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.PriceInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The price information of a [Product][google.cloud.retail.v2beta.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PriceInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PriceInfo) + com.google.cloud.retail.v2beta.PriceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PriceInfo.class, + com.google.cloud.retail.v2beta.PriceInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PriceInfo.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(); + currencyCode_ = ""; + + price_ = 0F; + + originalPrice_ = 0F; + + cost_ = 0F; + + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + if (priceRangeBuilder_ == null) { + priceRange_ = null; + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_PriceInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo build() { + com.google.cloud.retail.v2beta.PriceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo buildPartial() { + com.google.cloud.retail.v2beta.PriceInfo result = + new com.google.cloud.retail.v2beta.PriceInfo(this); + result.currencyCode_ = currencyCode_; + result.price_ = price_; + result.originalPrice_ = originalPrice_; + result.cost_ = cost_; + if (priceEffectiveTimeBuilder_ == null) { + result.priceEffectiveTime_ = priceEffectiveTime_; + } else { + result.priceEffectiveTime_ = priceEffectiveTimeBuilder_.build(); + } + if (priceExpireTimeBuilder_ == null) { + result.priceExpireTime_ = priceExpireTime_; + } else { + result.priceExpireTime_ = priceExpireTimeBuilder_.build(); + } + if (priceRangeBuilder_ == null) { + result.priceRange_ = priceRange_; + } else { + result.priceRange_ = priceRangeBuilder_.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.PriceInfo) { + return mergeFrom((com.google.cloud.retail.v2beta.PriceInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PriceInfo other) { + if (other == com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance()) return this; + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + onChanged(); + } + if (other.getPrice() != 0F) { + setPrice(other.getPrice()); + } + if (other.getOriginalPrice() != 0F) { + setOriginalPrice(other.getOriginalPrice()); + } + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (other.hasPriceEffectiveTime()) { + mergePriceEffectiveTime(other.getPriceEffectiveTime()); + } + if (other.hasPriceExpireTime()) { + mergePriceExpireTime(other.getPriceExpireTime()); + } + if (other.hasPriceRange()) { + mergePriceRange(other.getPriceRange()); + } + 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.PriceInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.PriceInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The 3-letter currency code defined in [ISO
+     * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+     * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+     * error is returned.
+     * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s with the same
+     * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * must share the same
+     * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+     * Otherwise, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string currency_code = 1; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = value; + onChanged(); + return this; + } + + private float price_; + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @return The price. + */ + @java.lang.Override + public float getPrice() { + return price_; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @param value The price to set. + * @return This builder for chaining. + */ + public Builder setPrice(float value) { + + price_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product.
+     * Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+     * property [Offer.price](https://schema.org/price).
+     * 
+ * + * float price = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrice() { + + price_ = 0F; + onChanged(); + return this; + } + + private float originalPrice_; + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2beta.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + @java.lang.Override + public float getOriginalPrice() { + return originalPrice_; + } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2beta.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @param value The originalPrice to set. + * @return This builder for chaining. + */ + public Builder setOriginalPrice(float value) { + + originalPrice_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product without any discount. If zero, by default set to be
+     * the [price][google.cloud.retail.v2beta.PriceInfo.price].
+     * 
+ * + * float original_price = 3; + * + * @return This builder for chaining. + */ + public Builder clearOriginalPrice() { + + originalPrice_ = 0F; + onChanged(); + return this; + } + + private float cost_; + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2beta.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2beta.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The costs associated with the sale of a particular product. Used for gross
+     * profit reporting.
+     * * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] -
+     * [cost][google.cloud.retail.v2beta.PriceInfo.cost]
+     * Google Merchant Center property
+     * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+     * 
+ * + * float cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + + cost_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp priceEffectiveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceEffectiveTimeBuilder_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + public boolean hasPriceEffectiveTime() { + return priceEffectiveTimeBuilder_ != null || priceEffectiveTime_ != null; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + public com.google.protobuf.Timestamp getPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } else { + return priceEffectiveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceEffectiveTime_ = value; + onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder setPriceEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = builderForValue.build(); + onChanged(); + } else { + priceEffectiveTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder mergePriceEffectiveTime(com.google.protobuf.Timestamp value) { + if (priceEffectiveTimeBuilder_ == null) { + if (priceEffectiveTime_ != null) { + priceEffectiveTime_ = + com.google.protobuf.Timestamp.newBuilder(priceEffectiveTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceEffectiveTime_ = value; + } + onChanged(); + } else { + priceEffectiveTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public Builder clearPriceEffectiveTime() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTime_ = null; + onChanged(); + } else { + priceEffectiveTime_ = null; + priceEffectiveTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getPriceEffectiveTimeBuilder() { + + onChanged(); + return getPriceEffectiveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder() { + if (priceEffectiveTimeBuilder_ != null) { + return priceEffectiveTimeBuilder_.getMessageOrBuilder(); + } else { + return priceEffectiveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceEffectiveTime_; + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * starts to be effective. This can be set as a future timestamp, and the
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+     * after
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * If so, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used before
+     * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceEffectiveTimeFieldBuilder() { + if (priceEffectiveTimeBuilder_ == null) { + priceEffectiveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceEffectiveTime(), getParentForChildren(), isClean()); + priceEffectiveTime_ = null; + } + return priceEffectiveTimeBuilder_; + } + + private com.google.protobuf.Timestamp priceExpireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + priceExpireTimeBuilder_; + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + public boolean hasPriceExpireTime() { + return priceExpireTimeBuilder_ != null || priceExpireTime_ != null; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + public com.google.protobuf.Timestamp getPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } else { + return priceExpireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder setPriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceExpireTime_ = value; + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder setPriceExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = builderForValue.build(); + onChanged(); + } else { + priceExpireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder mergePriceExpireTime(com.google.protobuf.Timestamp value) { + if (priceExpireTimeBuilder_ == null) { + if (priceExpireTime_ != null) { + priceExpireTime_ = + com.google.protobuf.Timestamp.newBuilder(priceExpireTime_) + .mergeFrom(value) + .buildPartial(); + } else { + priceExpireTime_ = value; + } + onChanged(); + } else { + priceExpireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public Builder clearPriceExpireTime() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTime_ = null; + onChanged(); + } else { + priceExpireTime_ = null; + priceExpireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getPriceExpireTimeBuilder() { + + onChanged(); + return getPriceExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder() { + if (priceExpireTimeBuilder_ != null) { + return priceExpireTimeBuilder_.getMessageOrBuilder(); + } else { + return priceExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : priceExpireTime_; + } + } + /** + * + * + *
+     * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+     * stops to be effective. The
+     * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+     * before
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * If this field is set, the
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+     * be set and
+     * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+     * used after
+     * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+     * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+     * effective because it will cause additional latency during search.
+     * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPriceExpireTimeFieldBuilder() { + if (priceExpireTimeBuilder_ == null) { + priceExpireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPriceExpireTime(), getParentForChildren(), isClean()); + priceExpireTime_ = null; + } + return priceExpireTimeBuilder_; + } + + private com.google.cloud.retail.v2beta.PriceInfo.PriceRange priceRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo.PriceRange, + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder> + priceRangeBuilder_; + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + public boolean hasPriceRange() { + return priceRangeBuilder_ != null || priceRange_ != null; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange getPriceRange() { + if (priceRangeBuilder_ == null) { + return priceRange_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } else { + return priceRangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPriceRange(com.google.cloud.retail.v2beta.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceRange_ = value; + onChanged(); + } else { + priceRangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPriceRange( + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder builderForValue) { + if (priceRangeBuilder_ == null) { + priceRange_ = builderForValue.build(); + onChanged(); + } else { + priceRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePriceRange(com.google.cloud.retail.v2beta.PriceInfo.PriceRange value) { + if (priceRangeBuilder_ == null) { + if (priceRange_ != null) { + priceRange_ = + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.newBuilder(priceRange_) + .mergeFrom(value) + .buildPartial(); + } else { + priceRange_ = value; + } + onChanged(); + } else { + priceRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPriceRange() { + if (priceRangeBuilder_ == null) { + priceRange_ = null; + onChanged(); + } else { + priceRange_ = null; + priceRangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder getPriceRangeBuilder() { + + onChanged(); + return getPriceRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder() { + if (priceRangeBuilder_ != null) { + return priceRangeBuilder_.getMessageOrBuilder(); + } else { + return priceRange_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.PriceRange.getDefaultInstance() + : priceRange_; + } + } + /** + * + * + *
+     * Output only. The price range of all the child
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+     * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo.PriceRange, + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder> + getPriceRangeFieldBuilder() { + if (priceRangeBuilder_ == null) { + priceRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo.PriceRange, + com.google.cloud.retail.v2beta.PriceInfo.PriceRange.Builder, + com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder>( + getPriceRange(), getParentForChildren(), isClean()); + priceRange_ = null; + } + return priceRangeBuilder_; + } + + @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.PriceInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PriceInfo) + private static final com.google.cloud.retail.v2beta.PriceInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PriceInfo(); + } + + public static com.google.cloud.retail.v2beta.PriceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PriceInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PriceInfo(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.PriceInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfoOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfoOrBuilder.java new file mode 100644 index 00000000..2078d5cb --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PriceInfoOrBuilder.java @@ -0,0 +1,326 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface PriceInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PriceInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * The 3-letter currency code defined in [ISO
+   * 4217](https://www.iso.org/iso-4217-currency-codes.html).
+   * If this field is an unrecognizable currency code, an INVALID_ARGUMENT
+   * error is returned.
+   * The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s with the same
+   * [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * must share the same
+   * [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code].
+   * Otherwise, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string currency_code = 1; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); + + /** + * + * + *
+   * Price of the product.
+   * Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371). Schema.org
+   * property [Offer.price](https://schema.org/price).
+   * 
+ * + * float price = 2; + * + * @return The price. + */ + float getPrice(); + + /** + * + * + *
+   * Price of the product without any discount. If zero, by default set to be
+   * the [price][google.cloud.retail.v2beta.PriceInfo.price].
+   * 
+ * + * float original_price = 3; + * + * @return The originalPrice. + */ + float getOriginalPrice(); + + /** + * + * + *
+   * The costs associated with the sale of a particular product. Used for gross
+   * profit reporting.
+   * * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] -
+   * [cost][google.cloud.retail.v2beta.PriceInfo.cost]
+   * Google Merchant Center property
+   * [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + float getCost(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return Whether the priceEffectiveTime field is set. + */ + boolean hasPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + * + * @return The priceEffectiveTime. + */ + com.google.protobuf.Timestamp getPriceEffectiveTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * starts to be effective. This can be set as a future timestamp, and the
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search
+   * after
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * If so, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used before
+   * [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_effective_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getPriceEffectiveTimeOrBuilder(); + + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return Whether the priceExpireTime field is set. + */ + boolean hasPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + * + * @return The priceExpireTime. + */ + com.google.protobuf.Timestamp getPriceExpireTime(); + /** + * + * + *
+   * The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price]
+   * stops to be effective. The
+   * [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search
+   * before
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * If this field is set, the
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must
+   * be set and
+   * [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is
+   * used after
+   * [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].
+   * Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always
+   * effective because it will cause additional latency during search.
+   * 
+ * + * .google.protobuf.Timestamp price_expire_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getPriceExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the priceRange field is set. + */ + boolean hasPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The priceRange. + */ + com.google.cloud.retail.v2beta.PriceInfo.PriceRange getPriceRange(); + /** + * + * + *
+   * Output only. The price range of all the child
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s grouped together on the
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Only populated for
+   * [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * .google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java new file mode 100644 index 00000000..2bc7e5c9 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java @@ -0,0 +1,13493 @@ +/* + * 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/product.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Product captures all metadata information of items to be recommended or
+ * searched.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Product) + ProductOrBuilder { + private static final long serialVersionUID = 0L; + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Product() { + name_ = ""; + id_ = ""; + type_ = 0; + primaryProductId_ = ""; + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + gtin_ = ""; + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + title_ = ""; + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + description_ = ""; + languageCode_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + availability_ = 0; + fulfillmentInfo_ = java.util.Collections.emptyList(); + uri_ = ""; + images_ = java.util.Collections.emptyList(); + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + promotions_ = java.util.Collections.emptyList(); + variants_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Product(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Product( + 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(); + + id_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + primaryProductId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + collectionMemberIds_.add(s); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + gtin_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + categories_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + brands_.add(s); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + tags_.add(s); + break; + } + case 114: + { + com.google.cloud.retail.v2beta.PriceInfo.Builder subBuilder = null; + if (priceInfo_ != null) { + subBuilder = priceInfo_.toBuilder(); + } + priceInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.PriceInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priceInfo_); + priceInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + com.google.cloud.retail.v2beta.Rating.Builder subBuilder = null; + if (rating_ != null) { + subBuilder = rating_.toBuilder(); + } + rating_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rating.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rating_); + rating_ = subBuilder.buildPartial(); + } + + break; + } + case 130: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expirationCase_ == 16) { + subBuilder = ((com.google.protobuf.Timestamp) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 16; + break; + } + case 138: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (expirationCase_ == 17) { + subBuilder = ((com.google.protobuf.Duration) expiration_).toBuilder(); + } + expiration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) expiration_); + expiration_ = subBuilder.buildPartial(); + } + expirationCase_ = 17; + break; + } + case 146: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (availableTime_ != null) { + subBuilder = availableTime_.toBuilder(); + } + availableTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(availableTime_); + availableTime_ = subBuilder.buildPartial(); + } + + break; + } + case 152: + { + int rawValue = input.readEnum(); + + availability_ = rawValue; + break; + } + case 162: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (availableQuantity_ != null) { + subBuilder = availableQuantity_.toBuilder(); + } + availableQuantity_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(availableQuantity_); + availableQuantity_ = subBuilder.buildPartial(); + } + + break; + } + case 170: + { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + fulfillmentInfo_.add( + input.readMessage( + com.google.cloud.retail.v2beta.FulfillmentInfo.parser(), extensionRegistry)); + break; + } + case 178: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 186: + { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + images_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + images_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Image.parser(), extensionRegistry)); + break; + } + case 194: + { + com.google.cloud.retail.v2beta.Audience.Builder subBuilder = null; + if (audience_ != null) { + subBuilder = audience_.toBuilder(); + } + audience_ = + input.readMessage( + com.google.cloud.retail.v2beta.Audience.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audience_); + audience_ = subBuilder.buildPartial(); + } + + break; + } + case 202: + { + com.google.cloud.retail.v2beta.ColorInfo.Builder subBuilder = null; + if (colorInfo_ != null) { + subBuilder = colorInfo_.toBuilder(); + } + colorInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.ColorInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(colorInfo_); + colorInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 210: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + sizes_.add(s); + break; + } + case 218: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + materials_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000200; + } + patterns_.add(s); + break; + } + case 234: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000400; + } + conditions_.add(s); + break; + } + case 242: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (retrievableFields_ != null) { + subBuilder = retrievableFields_.toBuilder(); + } + retrievableFields_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retrievableFields_); + retrievableFields_ = subBuilder.buildPartial(); + } + + break; + } + case 250: + { + if (!((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + variants_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry)); + break; + } + case 266: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (publishTime_ != null) { + subBuilder = publishTime_.toBuilder(); + } + publishTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(publishTime_); + publishTime_ = subBuilder.buildPartial(); + } + + break; + } + case 274: + { + if (!((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + promotions_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Promotion.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)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + categories_ = categories_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + tags_ = tags_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + } + if (((mutable_bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Product.class, + com.google.cloud.retail.v2beta.Product.Builder.class); + } + + /** + * + * + *
+   * The type of this product.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Product.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The primary type.
+     * As the primary unit for predicting, indexing and search serving, a
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] is grouped with multiple
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * PRIMARY = 1; + */ + PRIMARY(1), + /** + * + * + *
+     * The variant type.
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s usually share some common
+     * attributes on the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, but they have variant
+     * attributes like different colors, sizes and prices, etc.
+     * 
+ * + * VARIANT = 2; + */ + VARIANT(2), + /** + * + * + *
+     * The collection type. Collection products are bundled
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s that are sold together,
+     * such as a jewelry set with necklaces, earrings and rings, etc.
+     * 
+ * + * COLLECTION = 3; + */ + COLLECTION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The primary type.
+     * As the primary unit for predicting, indexing and search serving, a
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] is grouped with multiple
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * PRIMARY = 1; + */ + public static final int PRIMARY_VALUE = 1; + /** + * + * + *
+     * The variant type.
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s usually share some common
+     * attributes on the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, but they have variant
+     * attributes like different colors, sizes and prices, etc.
+     * 
+ * + * VARIANT = 2; + */ + public static final int VARIANT_VALUE = 2; + /** + * + * + *
+     * The collection type. Collection products are bundled
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s that are sold together,
+     * such as a jewelry set with necklaces, earrings and rings, etc.
+     * 
+ * + * COLLECTION = 3; + */ + public static final int COLLECTION_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return PRIMARY; + case 2: + return VARIANT; + case 3: + return COLLECTION; + 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 Type findValueByNumber(int number) { + return Type.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.Product.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Product.Type) + } + + /** + * + * + *
+   * Product availability. If this field is unspecified, the product is
+   * assumed to be in stock.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Product.Availability} + */ + public enum Availability implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default product availability. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK]
+     * if unset.
+     * 
+ * + * AVAILABILITY_UNSPECIFIED = 0; + */ + AVAILABILITY_UNSPECIFIED(0), + /** + * + * + *
+     * Product in stock.
+     * 
+ * + * IN_STOCK = 1; + */ + IN_STOCK(1), + /** + * + * + *
+     * Product out of stock.
+     * 
+ * + * OUT_OF_STOCK = 2; + */ + OUT_OF_STOCK(2), + /** + * + * + *
+     * Product that is in pre-order state.
+     * 
+ * + * PREORDER = 3; + */ + PREORDER(3), + /** + * + * + *
+     * Product that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 4; + */ + BACKORDER(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default product availability. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK]
+     * if unset.
+     * 
+ * + * AVAILABILITY_UNSPECIFIED = 0; + */ + public static final int AVAILABILITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Product in stock.
+     * 
+ * + * IN_STOCK = 1; + */ + public static final int IN_STOCK_VALUE = 1; + /** + * + * + *
+     * Product out of stock.
+     * 
+ * + * OUT_OF_STOCK = 2; + */ + public static final int OUT_OF_STOCK_VALUE = 2; + /** + * + * + *
+     * Product that is in pre-order state.
+     * 
+ * + * PREORDER = 3; + */ + public static final int PREORDER_VALUE = 3; + /** + * + * + *
+     * Product that is back-ordered (i.e. temporarily out of stock).
+     * 
+ * + * BACKORDER = 4; + */ + public static final int BACKORDER_VALUE = 4; + + 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 Availability 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 Availability forNumber(int value) { + switch (value) { + case 0: + return AVAILABILITY_UNSPECIFIED; + case 1: + return IN_STOCK; + case 2: + return OUT_OF_STOCK; + case 3: + return PREORDER; + case 4: + return BACKORDER; + 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 Availability findValueByNumber(int number) { + return Availability.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.Product.getDescriptor().getEnumTypes().get(1); + } + + private static final Availability[] VALUES = values(); + + public static Availability 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 Availability(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Product.Availability) + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(16), + TTL(17), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 16: + return EXPIRE_TIME; + case 17: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 16; + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 17; + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2beta.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2beta.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Product.Type result = + com.google.cloud.retail.v2beta.Product.Type.valueOf(type_); + return result == null ? com.google.cloud.retail.v2beta.Product.Type.UNRECOGNIZED : result; + } + + public static final int PRIMARY_PRODUCT_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object primaryProductId_; + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2beta.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + @java.lang.Override + public java.lang.String getPrimaryProductId() { + java.lang.Object ref = primaryProductId_; + 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(); + primaryProductId_ = s; + return s; + } + } + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2beta.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryProductIdBytes() { + java.lang.Object ref = primaryProductId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryProductId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLLECTION_MEMBER_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList collectionMemberIds_; + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_; + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + + public static final int GTIN_FIELD_NUMBER = 6; + private volatile java.lang.Object gtin_; + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + @java.lang.Override + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + 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(); + gtin_ = s; + return s; + } + } + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORIES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList categories_; + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + + public static final int TITLE_FIELD_NUMBER = 8; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANDS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList brands_; + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_; + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 10; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 11; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2beta.Product] can include text in different
+   * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+   * to provide text in multiple languages can result in degraded model
+   * performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2beta.Product] can include text in different
+   * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+   * to provide text in multiple languages can result in degraded model
+   * performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 12; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TAGS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int PRICE_INFO_FIELD_NUMBER = 14; + private com.google.cloud.retail.v2beta.PriceInfo priceInfo_; + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + @java.lang.Override + public boolean hasPriceInfo() { + return priceInfo_ != null; + } + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfo getPriceInfo() { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder() { + return getPriceInfo(); + } + + public static final int RATING_FIELD_NUMBER = 15; + private com.google.cloud.retail.v2beta.Rating rating_; + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + @java.lang.Override + public boolean hasRating() { + return rating_ != null; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return The rating. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rating getRating() { + return rating_ == null ? com.google.cloud.retail.v2beta.Rating.getDefaultInstance() : rating_; + } + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RatingOrBuilder getRatingOrBuilder() { + return getRating(); + } + + public static final int AVAILABLE_TIME_FIELD_NUMBER = 18; + private com.google.protobuf.Timestamp availableTime_; + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + @java.lang.Override + public boolean hasAvailableTime() { + return availableTime_ != null; + } + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAvailableTime() { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { + return getAvailableTime(); + } + + public static final int AVAILABILITY_FIELD_NUMBER = 19; + private int availability_; + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2beta.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + @java.lang.Override + public int getAvailabilityValue() { + return availability_; + } + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2beta.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The availability. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product.Availability getAvailability() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Product.Availability result = + com.google.cloud.retail.v2beta.Product.Availability.valueOf(availability_); + return result == null + ? com.google.cloud.retail.v2beta.Product.Availability.UNRECOGNIZED + : result; + } + + public static final int AVAILABLE_QUANTITY_FIELD_NUMBER = 20; + private com.google.protobuf.Int32Value availableQuantity_; + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + @java.lang.Override + public boolean hasAvailableQuantity() { + return availableQuantity_ != null; + } + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getAvailableQuantity() { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { + return getAvailableQuantity(); + } + + public static final int FULFILLMENT_INFO_FIELD_NUMBER = 21; + private java.util.List fulfillmentInfo_; + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public java.util.List getFulfillmentInfoList() { + return fulfillmentInfo_; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public java.util.List + getFulfillmentInfoOrBuilderList() { + return fulfillmentInfo_; + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public int getFulfillmentInfoCount() { + return fulfillmentInfo_.size(); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.FulfillmentInfo getFulfillmentInfo(int index) { + return fulfillmentInfo_.get(index); + } + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + return fulfillmentInfo_.get(index); + } + + public static final int URI_FIELD_NUMBER = 22; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGES_FIELD_NUMBER = 23; + private java.util.List images_; + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + @java.lang.Override + public java.util.List getImagesList() { + return images_; + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + @java.lang.Override + public java.util.List + getImagesOrBuilderList() { + return images_; + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + @java.lang.Override + public int getImagesCount() { + return images_.size(); + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Image getImages(int index) { + return images_.get(index); + } + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ImageOrBuilder getImagesOrBuilder(int index) { + return images_.get(index); + } + + public static final int AUDIENCE_FIELD_NUMBER = 24; + private com.google.cloud.retail.v2beta.Audience audience_; + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + @java.lang.Override + public boolean hasAudience() { + return audience_ != null; + } + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return The audience. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Audience getAudience() { + return audience_ == null + ? com.google.cloud.retail.v2beta.Audience.getDefaultInstance() + : audience_; + } + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.AudienceOrBuilder getAudienceOrBuilder() { + return getAudience(); + } + + public static final int COLOR_INFO_FIELD_NUMBER = 25; + private com.google.cloud.retail.v2beta.ColorInfo colorInfo_; + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + @java.lang.Override + public boolean hasColorInfo() { + return colorInfo_ != null; + } + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ColorInfo getColorInfo() { + return colorInfo_ == null + ? com.google.cloud.retail.v2beta.ColorInfo.getDefaultInstance() + : colorInfo_; + } + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ColorInfoOrBuilder getColorInfoOrBuilder() { + return getColorInfo(); + } + + public static final int SIZES_FIELD_NUMBER = 26; + private com.google.protobuf.LazyStringList sizes_; + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_; + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + public int getSizesCount() { + return sizes_.size(); + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + public java.lang.String getSizes(int index) { + return sizes_.get(index); + } + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); + } + + public static final int MATERIALS_FIELD_NUMBER = 27; + private com.google.protobuf.LazyStringList materials_; + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_; + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + + public static final int PATTERNS_FIELD_NUMBER = 28; + private com.google.protobuf.LazyStringList patterns_; + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_; + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + public int getPatternsCount() { + return patterns_.size(); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + public java.lang.String getPatterns(int index) { + return patterns_.get(index); + } + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); + } + + public static final int CONDITIONS_FIELD_NUMBER = 29; + private com.google.protobuf.LazyStringList conditions_; + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + + public static final int PROMOTIONS_FIELD_NUMBER = 34; + private java.util.List promotions_; + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List getPromotionsList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + @java.lang.Override + public java.util.List + getPromotionsOrBuilderList() { + return promotions_; + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + @java.lang.Override + public int getPromotionsCount() { + return promotions_.size(); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Promotion getPromotions(int index) { + return promotions_.get(index); + } + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PromotionOrBuilder getPromotionsOrBuilder(int index) { + return promotions_.get(index); + } + + public static final int PUBLISH_TIME_FIELD_NUMBER = 33; + private com.google.protobuf.Timestamp publishTime_; + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + @java.lang.Override + public boolean hasPublishTime() { + return publishTime_ != null; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getPublishTime() { + return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_; + } + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + return getPublishTime(); + } + + public static final int RETRIEVABLE_FIELDS_FIELD_NUMBER = 30; + private com.google.protobuf.FieldMask retrievableFields_; + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + @java.lang.Override + public boolean hasRetrievableFields() { + return retrievableFields_ != null; + } + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getRetrievableFields() { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + return getRetrievableFields(); + } + + public static final int VARIANTS_FIELD_NUMBER = 31; + private java.util.List variants_; + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getVariantsList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getVariantsOrBuilderList() { + return variants_; + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getVariantsCount() { + return variants_.size(); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getVariants(int index) { + return variants_.get(index); + } + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getVariantsOrBuilder(int index) { + return variants_.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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (type_ != com.google.cloud.retail.v2beta.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryProductId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryProductId_); + } + for (int i = 0; i < collectionMemberIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, collectionMemberIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gtin_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, gtin_); + } + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, categories_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, title_); + } + for (int i = 0; i < brands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, brands_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, languageCode_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 12); + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, tags_.getRaw(i)); + } + if (priceInfo_ != null) { + output.writeMessage(14, getPriceInfo()); + } + if (rating_ != null) { + output.writeMessage(15, getRating()); + } + if (expirationCase_ == 16) { + output.writeMessage(16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + output.writeMessage(17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + output.writeMessage(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2beta.Product.Availability.AVAILABILITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(19, availability_); + } + if (availableQuantity_ != null) { + output.writeMessage(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + output.writeMessage(21, fulfillmentInfo_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + output.writeMessage(23, images_.get(i)); + } + if (audience_ != null) { + output.writeMessage(24, getAudience()); + } + if (colorInfo_ != null) { + output.writeMessage(25, getColorInfo()); + } + for (int i = 0; i < sizes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, sizes_.getRaw(i)); + } + for (int i = 0; i < materials_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, materials_.getRaw(i)); + } + for (int i = 0; i < patterns_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, patterns_.getRaw(i)); + } + for (int i = 0; i < conditions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 29, conditions_.getRaw(i)); + } + if (retrievableFields_ != null) { + output.writeMessage(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + output.writeMessage(31, variants_.get(i)); + } + if (publishTime_ != null) { + output.writeMessage(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + output.writeMessage(34, promotions_.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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (type_ != com.google.cloud.retail.v2beta.Product.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryProductId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryProductId_); + } + { + int dataSize = 0; + for (int i = 0; i < collectionMemberIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionMemberIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionMemberIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gtin_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, gtin_); + } + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, title_); + } + { + int dataSize = 0; + for (int i = 0; i < brands_.size(); i++) { + dataSize += computeStringSizeNoTag(brands_.getRaw(i)); + } + size += dataSize; + size += 1 * getBrandsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, languageCode_); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, attributes__); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (priceInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPriceInfo()); + } + if (rating_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getRating()); + } + if (expirationCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (com.google.protobuf.Duration) expiration_); + } + if (availableTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getAvailableTime()); + } + if (availability_ + != com.google.cloud.retail.v2beta.Product.Availability.AVAILABILITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, availability_); + } + if (availableQuantity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getAvailableQuantity()); + } + for (int i = 0; i < fulfillmentInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, fulfillmentInfo_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, uri_); + } + for (int i = 0; i < images_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, images_.get(i)); + } + if (audience_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getAudience()); + } + if (colorInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getColorInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < sizes_.size(); i++) { + dataSize += computeStringSizeNoTag(sizes_.getRaw(i)); + } + size += dataSize; + size += 2 * getSizesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < materials_.size(); i++) { + dataSize += computeStringSizeNoTag(materials_.getRaw(i)); + } + size += dataSize; + size += 2 * getMaterialsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < patterns_.size(); i++) { + dataSize += computeStringSizeNoTag(patterns_.getRaw(i)); + } + size += dataSize; + size += 2 * getPatternsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < conditions_.size(); i++) { + dataSize += computeStringSizeNoTag(conditions_.getRaw(i)); + } + size += dataSize; + size += 2 * getConditionsList().size(); + } + if (retrievableFields_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(30, getRetrievableFields()); + } + for (int i = 0; i < variants_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(31, variants_.get(i)); + } + if (publishTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(33, getPublishTime()); + } + for (int i = 0; i < promotions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, promotions_.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.Product)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Product other = (com.google.cloud.retail.v2beta.Product) obj; + + if (!getName().equals(other.getName())) return false; + if (!getId().equals(other.getId())) return false; + if (type_ != other.type_) return false; + if (!getPrimaryProductId().equals(other.getPrimaryProductId())) return false; + if (!getCollectionMemberIdsList().equals(other.getCollectionMemberIdsList())) return false; + if (!getGtin().equals(other.getGtin())) return false; + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getBrandsList().equals(other.getBrandsList())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (hasPriceInfo() != other.hasPriceInfo()) return false; + if (hasPriceInfo()) { + if (!getPriceInfo().equals(other.getPriceInfo())) return false; + } + if (hasRating() != other.hasRating()) return false; + if (hasRating()) { + if (!getRating().equals(other.getRating())) return false; + } + if (hasAvailableTime() != other.hasAvailableTime()) return false; + if (hasAvailableTime()) { + if (!getAvailableTime().equals(other.getAvailableTime())) return false; + } + if (availability_ != other.availability_) return false; + if (hasAvailableQuantity() != other.hasAvailableQuantity()) return false; + if (hasAvailableQuantity()) { + if (!getAvailableQuantity().equals(other.getAvailableQuantity())) return false; + } + if (!getFulfillmentInfoList().equals(other.getFulfillmentInfoList())) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getImagesList().equals(other.getImagesList())) return false; + if (hasAudience() != other.hasAudience()) return false; + if (hasAudience()) { + if (!getAudience().equals(other.getAudience())) return false; + } + if (hasColorInfo() != other.hasColorInfo()) return false; + if (hasColorInfo()) { + if (!getColorInfo().equals(other.getColorInfo())) return false; + } + if (!getSizesList().equals(other.getSizesList())) return false; + if (!getMaterialsList().equals(other.getMaterialsList())) return false; + if (!getPatternsList().equals(other.getPatternsList())) return false; + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (!getPromotionsList().equals(other.getPromotionsList())) return false; + if (hasPublishTime() != other.hasPublishTime()) return false; + if (hasPublishTime()) { + if (!getPublishTime().equals(other.getPublishTime())) return false; + } + if (hasRetrievableFields() != other.hasRetrievableFields()) return false; + if (hasRetrievableFields()) { + if (!getRetrievableFields().equals(other.getRetrievableFields())) return false; + } + if (!getVariantsList().equals(other.getVariantsList())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 16: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 17: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + PRIMARY_PRODUCT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryProductId().hashCode(); + if (getCollectionMemberIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_MEMBER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionMemberIdsList().hashCode(); + } + hash = (37 * hash) + GTIN_FIELD_NUMBER; + hash = (53 * hash) + getGtin().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + if (getBrandsCount() > 0) { + hash = (37 * hash) + BRANDS_FIELD_NUMBER; + hash = (53 * hash) + getBrandsList().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + if (hasPriceInfo()) { + hash = (37 * hash) + PRICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPriceInfo().hashCode(); + } + if (hasRating()) { + hash = (37 * hash) + RATING_FIELD_NUMBER; + hash = (53 * hash) + getRating().hashCode(); + } + if (hasAvailableTime()) { + hash = (37 * hash) + AVAILABLE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAvailableTime().hashCode(); + } + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + availability_; + if (hasAvailableQuantity()) { + hash = (37 * hash) + AVAILABLE_QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableQuantity().hashCode(); + } + if (getFulfillmentInfoCount() > 0) { + hash = (37 * hash) + FULFILLMENT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFulfillmentInfoList().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getImagesCount() > 0) { + hash = (37 * hash) + IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getImagesList().hashCode(); + } + if (hasAudience()) { + hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; + hash = (53 * hash) + getAudience().hashCode(); + } + if (hasColorInfo()) { + hash = (37 * hash) + COLOR_INFO_FIELD_NUMBER; + hash = (53 * hash) + getColorInfo().hashCode(); + } + if (getSizesCount() > 0) { + hash = (37 * hash) + SIZES_FIELD_NUMBER; + hash = (53 * hash) + getSizesList().hashCode(); + } + if (getMaterialsCount() > 0) { + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + getMaterialsList().hashCode(); + } + if (getPatternsCount() > 0) { + hash = (37 * hash) + PATTERNS_FIELD_NUMBER; + hash = (53 * hash) + getPatternsList().hashCode(); + } + if (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + if (getPromotionsCount() > 0) { + hash = (37 * hash) + PROMOTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPromotionsList().hashCode(); + } + if (hasPublishTime()) { + hash = (37 * hash) + PUBLISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPublishTime().hashCode(); + } + if (hasRetrievableFields()) { + hash = (37 * hash) + RETRIEVABLE_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getRetrievableFields().hashCode(); + } + if (getVariantsCount() > 0) { + hash = (37 * hash) + VARIANTS_FIELD_NUMBER; + hash = (53 * hash) + getVariantsList().hashCode(); + } + switch (expirationCase_) { + case 16: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 17: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Product 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.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Product 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.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Product 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.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Product 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.Product parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Product 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.Product 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.Product 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.Product 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; + } + /** + * + * + *
+   * Product captures all metadata information of items to be recommended or
+   * searched.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Product) + com.google.cloud.retail.v2beta.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 12: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Product.class, + com.google.cloud.retail.v2beta.Product.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Product.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFulfillmentInfoFieldBuilder(); + getImagesFieldBuilder(); + getPromotionsFieldBuilder(); + getVariantsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + id_ = ""; + + type_ = 0; + + primaryProductId_ = ""; + + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + gtin_ = ""; + + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + title_ = ""; + + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + description_ = ""; + + languageCode_ = ""; + + internalGetMutableAttributes().clear(); + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + if (ratingBuilder_ == null) { + rating_ = null; + } else { + rating_ = null; + ratingBuilder_ = null; + } + if (availableTimeBuilder_ == null) { + availableTime_ = null; + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + availability_ = 0; + + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; + } + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + fulfillmentInfoBuilder_.clear(); + } + uri_ = ""; + + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + imagesBuilder_.clear(); + } + if (audienceBuilder_ == null) { + audience_ = null; + } else { + audience_ = null; + audienceBuilder_ = null; + } + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; + } + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + } else { + promotionsBuilder_.clear(); + } + if (publishTimeBuilder_ == null) { + publishTime_ = null; + } else { + publishTime_ = null; + publishTimeBuilder_ = null; + } + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + } else { + variantsBuilder_.clear(); + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductProto + .internal_static_google_cloud_retail_v2beta_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Product build() { + com.google.cloud.retail.v2beta.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Product buildPartial() { + com.google.cloud.retail.v2beta.Product result = + new com.google.cloud.retail.v2beta.Product(this); + int from_bitField0_ = bitField0_; + if (expirationCase_ == 16) { + if (expireTimeBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = expireTimeBuilder_.build(); + } + } + if (expirationCase_ == 17) { + if (ttlBuilder_ == null) { + result.expiration_ = expiration_; + } else { + result.expiration_ = ttlBuilder_.build(); + } + } + result.name_ = name_; + result.id_ = id_; + result.type_ = type_; + result.primaryProductId_ = primaryProductId_; + if (((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = collectionMemberIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.collectionMemberIds_ = collectionMemberIds_; + result.gtin_ = gtin_; + if (((bitField0_ & 0x00000002) != 0)) { + categories_ = categories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.categories_ = categories_; + result.title_ = title_; + if (((bitField0_ & 0x00000004) != 0)) { + brands_ = brands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.brands_ = brands_; + result.description_ = description_; + result.languageCode_ = languageCode_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + if (((bitField0_ & 0x00000010) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.tags_ = tags_; + if (priceInfoBuilder_ == null) { + result.priceInfo_ = priceInfo_; + } else { + result.priceInfo_ = priceInfoBuilder_.build(); + } + if (ratingBuilder_ == null) { + result.rating_ = rating_; + } else { + result.rating_ = ratingBuilder_.build(); + } + if (availableTimeBuilder_ == null) { + result.availableTime_ = availableTime_; + } else { + result.availableTime_ = availableTimeBuilder_.build(); + } + result.availability_ = availability_; + if (availableQuantityBuilder_ == null) { + result.availableQuantity_ = availableQuantity_; + } else { + result.availableQuantity_ = availableQuantityBuilder_.build(); + } + if (fulfillmentInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = java.util.Collections.unmodifiableList(fulfillmentInfo_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.fulfillmentInfo_ = fulfillmentInfo_; + } else { + result.fulfillmentInfo_ = fulfillmentInfoBuilder_.build(); + } + result.uri_ = uri_; + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + images_ = java.util.Collections.unmodifiableList(images_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.images_ = images_; + } else { + result.images_ = imagesBuilder_.build(); + } + if (audienceBuilder_ == null) { + result.audience_ = audience_; + } else { + result.audience_ = audienceBuilder_.build(); + } + if (colorInfoBuilder_ == null) { + result.colorInfo_ = colorInfo_; + } else { + result.colorInfo_ = colorInfoBuilder_.build(); + } + if (((bitField0_ & 0x00000080) != 0)) { + sizes_ = sizes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.sizes_ = sizes_; + if (((bitField0_ & 0x00000100) != 0)) { + materials_ = materials_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.materials_ = materials_; + if (((bitField0_ & 0x00000200) != 0)) { + patterns_ = patterns_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.patterns_ = patterns_; + if (((bitField0_ & 0x00000400) != 0)) { + conditions_ = conditions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.conditions_ = conditions_; + if (promotionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + promotions_ = java.util.Collections.unmodifiableList(promotions_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.promotions_ = promotions_; + } else { + result.promotions_ = promotionsBuilder_.build(); + } + if (publishTimeBuilder_ == null) { + result.publishTime_ = publishTime_; + } else { + result.publishTime_ = publishTimeBuilder_.build(); + } + if (retrievableFieldsBuilder_ == null) { + result.retrievableFields_ = retrievableFields_; + } else { + result.retrievableFields_ = retrievableFieldsBuilder_.build(); + } + if (variantsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + variants_ = java.util.Collections.unmodifiableList(variants_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.variants_ = variants_; + } else { + result.variants_ = variantsBuilder_.build(); + } + result.expirationCase_ = expirationCase_; + 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.Product) { + return mergeFrom((com.google.cloud.retail.v2beta.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Product other) { + if (other == com.google.cloud.retail.v2beta.Product.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getPrimaryProductId().isEmpty()) { + primaryProductId_ = other.primaryProductId_; + onChanged(); + } + if (!other.collectionMemberIds_.isEmpty()) { + if (collectionMemberIds_.isEmpty()) { + collectionMemberIds_ = other.collectionMemberIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.addAll(other.collectionMemberIds_); + } + onChanged(); + } + if (!other.getGtin().isEmpty()) { + gtin_ = other.gtin_; + onChanged(); + } + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.brands_.isEmpty()) { + if (brands_.isEmpty()) { + brands_ = other.brands_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureBrandsIsMutable(); + brands_.addAll(other.brands_); + } + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.hasPriceInfo()) { + mergePriceInfo(other.getPriceInfo()); + } + if (other.hasRating()) { + mergeRating(other.getRating()); + } + if (other.hasAvailableTime()) { + mergeAvailableTime(other.getAvailableTime()); + } + if (other.availability_ != 0) { + setAvailabilityValue(other.getAvailabilityValue()); + } + if (other.hasAvailableQuantity()) { + mergeAvailableQuantity(other.getAvailableQuantity()); + } + if (fulfillmentInfoBuilder_ == null) { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfo_.isEmpty()) { + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.addAll(other.fulfillmentInfo_); + } + onChanged(); + } + } else { + if (!other.fulfillmentInfo_.isEmpty()) { + if (fulfillmentInfoBuilder_.isEmpty()) { + fulfillmentInfoBuilder_.dispose(); + fulfillmentInfoBuilder_ = null; + fulfillmentInfo_ = other.fulfillmentInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + fulfillmentInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFulfillmentInfoFieldBuilder() + : null; + } else { + fulfillmentInfoBuilder_.addAllMessages(other.fulfillmentInfo_); + } + } + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (imagesBuilder_ == null) { + if (!other.images_.isEmpty()) { + if (images_.isEmpty()) { + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureImagesIsMutable(); + images_.addAll(other.images_); + } + onChanged(); + } + } else { + if (!other.images_.isEmpty()) { + if (imagesBuilder_.isEmpty()) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + images_ = other.images_; + bitField0_ = (bitField0_ & ~0x00000040); + imagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getImagesFieldBuilder() + : null; + } else { + imagesBuilder_.addAllMessages(other.images_); + } + } + } + if (other.hasAudience()) { + mergeAudience(other.getAudience()); + } + if (other.hasColorInfo()) { + mergeColorInfo(other.getColorInfo()); + } + if (!other.sizes_.isEmpty()) { + if (sizes_.isEmpty()) { + sizes_ = other.sizes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureSizesIsMutable(); + sizes_.addAll(other.sizes_); + } + onChanged(); + } + if (!other.materials_.isEmpty()) { + if (materials_.isEmpty()) { + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureMaterialsIsMutable(); + materials_.addAll(other.materials_); + } + onChanged(); + } + if (!other.patterns_.isEmpty()) { + if (patterns_.isEmpty()) { + patterns_ = other.patterns_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePatternsIsMutable(); + patterns_.addAll(other.patterns_); + } + onChanged(); + } + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + if (promotionsBuilder_ == null) { + if (!other.promotions_.isEmpty()) { + if (promotions_.isEmpty()) { + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePromotionsIsMutable(); + promotions_.addAll(other.promotions_); + } + onChanged(); + } + } else { + if (!other.promotions_.isEmpty()) { + if (promotionsBuilder_.isEmpty()) { + promotionsBuilder_.dispose(); + promotionsBuilder_ = null; + promotions_ = other.promotions_; + bitField0_ = (bitField0_ & ~0x00000800); + promotionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPromotionsFieldBuilder() + : null; + } else { + promotionsBuilder_.addAllMessages(other.promotions_); + } + } + } + if (other.hasPublishTime()) { + mergePublishTime(other.getPublishTime()); + } + if (other.hasRetrievableFields()) { + mergeRetrievableFields(other.getRetrievableFields()); + } + if (variantsBuilder_ == null) { + if (!other.variants_.isEmpty()) { + if (variants_.isEmpty()) { + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureVariantsIsMutable(); + variants_.addAll(other.variants_); + } + onChanged(); + } + } else { + if (!other.variants_.isEmpty()) { + if (variantsBuilder_.isEmpty()) { + variantsBuilder_.dispose(); + variantsBuilder_ = null; + variants_ = other.variants_; + bitField0_ = (bitField0_ & ~0x00001000); + variantsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVariantsFieldBuilder() + : null; + } else { + variantsBuilder_.addAllMessages(other.variants_); + } + } + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + 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.Product parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Product) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 16; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 16) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 16) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 16; + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 16) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 16) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 16) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * The timestamp when this product becomes unavailable for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+     * available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+     * However, the product can still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+     * later than
+     * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+     * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+     * otherwise an INVALID_ARGUMENT error is thrown.
+     * Corresponding properties: Google Merchant Center property
+     * [expiration_date](https://support.google.com/merchants/answer/6324499).
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 16)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 16; + onChanged(); + ; + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 17; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 17) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 17) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + expirationCase_ = 17; + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 17) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 17) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 17) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Input only. The TTL (time to live) of the product.
+     * If it is set, it must be a non-negative value, and
+     * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+     * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+     * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+     * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+     * is left blank when retrieving the
+     * [Product][google.cloud.retail.v2beta.Product].
+     * If it is set, the product is not available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * after current timestamp plus
+     * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+     * still be retrieved by
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+     * and
+     * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+     * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 17)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 17; + onChanged(); + ; + return ttlBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Full resource name of the product, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 id_ = ""; + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2beta.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2beta.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2beta.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2beta.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+     * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+     * For example, this field is "id_1", if
+     * [name][google.cloud.retail.v2beta.Product.name] is
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+     * property [Product.sku](https://schema.org/sku).
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Product.Type result = + com.google.cloud.retail.v2beta.Product.Type.valueOf(type_); + return result == null ? com.google.cloud.retail.v2beta.Product.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.retail.v2beta.Product.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the product. Default to
+     * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * if unset.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object primaryProductId_ = ""; + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2beta.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + public java.lang.String getPrimaryProductId() { + java.lang.Object ref = primaryProductId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + primaryProductId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2beta.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + public com.google.protobuf.ByteString getPrimaryProductIdBytes() { + java.lang.Object ref = primaryProductId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + primaryProductId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2beta.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @param value The primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + primaryProductId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2beta.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryProductId() { + + primaryProductId_ = getDefaultInstance().getPrimaryProductId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Variant group identifier. Must be an
+     * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+     * with this product. Otherwise, an error is thrown.
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+     * empty or set to the same value as
+     * [id][google.cloud.retail.v2beta.Product.id].
+     * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+     * cannot be empty. A maximum of 2,000 products are allowed to share the same
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [item_group_id](https://support.google.com/merchants/answer/6324507).
+     * Schema.org property
+     * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+     * 
+ * + * string primary_product_id = 4; + * + * @param value The bytes for primaryProductId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryProductIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + primaryProductId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList collectionMemberIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionMemberIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + collectionMemberIds_ = new com.google.protobuf.LazyStringArrayList(collectionMemberIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return A list containing the collectionMemberIds. + */ + public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { + return collectionMemberIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + public int getCollectionMemberIdsCount() { + return collectionMemberIds_.size(); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + public java.lang.String getCollectionMemberIds(int index) { + return collectionMemberIds_.get(index); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { + return collectionMemberIds_.getByteString(index); + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index to set the value at. + * @param value The collectionMemberIds to set. + * @return This builder for chaining. + */ + public Builder setCollectionMemberIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param value The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param values The collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addAllCollectionMemberIds(java.lang.Iterable values) { + ensureCollectionMemberIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionMemberIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @return This builder for chaining. + */ + public Builder clearCollectionMemberIds() { + collectionMemberIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+     * when [type][google.cloud.retail.v2beta.Product.type] is
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+     * Non-existent product ids are allowed.
+     * 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
+     * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+     * return.
+     * 
+ * + * repeated string collection_member_ids = 5; + * + * @param value The bytes of the collectionMemberIds to add. + * @return This builder for chaining. + */ + public Builder addCollectionMemberIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionMemberIdsIsMutable(); + collectionMemberIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object gtin_ = ""; + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gtin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The gtin to set. + * @return This builder for chaining. + */ + public Builder setGtin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gtin_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @return This builder for chaining. + */ + public Builder clearGtin() { + + gtin_ = getDefaultInstance().getGtin(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Global Trade Item Number (GTIN) of the product.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Corresponding properties: Google Merchant Center property
+     * [gtin](https://support.google.com/merchants/answer/6324461).
+     * Schema.org property
+     * [Product.isbn](https://schema.org/isbn),
+     * [Product.gtin8](https://schema.org/gtin8),
+     * [Product.gtin12](https://schema.org/gtin12),
+     * [Product.gtin13](https://schema.org/gtin13), or
+     * [Product.gtin14](https://schema.org/gtin14).
+     * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string gtin = 6; + * + * @param value The bytes for gtin to set. + * @return This builder for chaining. + */ + public Builder setGtinBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gtin_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList categories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_.getUnmodifiableView(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Product categories. This field is repeated for supporting one product
+     * 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
+     * other character(s).
+     * For example, if a shoes product belongs to both
+     * ["Shoes & Accessories" -> "Shoes"] and
+     * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+     * represented as:
+     *      "categories": [
+     *        "Shoes & Accessories > Shoes",
+     *        "Sports & Fitness > Athletic Clothing > Shoes"
+     *      ]
+     * Must be set for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+     * error is returned.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+     * allowed. Each value must be a UTF-8 encoded string with a length limit of
+     * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [google_product_category][mc_google_product_category]. Schema.org property
+     * [Product.category] (https://schema.org/category).
+     * [mc_google_product_category]:
+     * https://support.google.com/merchants/answer/6324436
+     * 
+ * + * repeated string categories = 7; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Product title.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+     * property [Product.name](https://schema.org/name).
+     * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList brands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBrandsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + brands_ = new com.google.protobuf.LazyStringArrayList(brands_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + public com.google.protobuf.ProtocolStringList getBrandsList() { + return brands_.getUnmodifiableView(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + public int getBrandsCount() { + return brands_.size(); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + public java.lang.String getBrands(int index) { + return brands_.get(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + public com.google.protobuf.ByteString getBrandsBytes(int index) { + return brands_.getByteString(index); + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param index The index to set the value at. + * @param value The brands to set. + * @return This builder for chaining. + */ + public Builder setBrands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The brands to add. + * @return This builder for chaining. + */ + public Builder addBrands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param values The brands to add. + * @return This builder for chaining. + */ + public Builder addAllBrands(java.lang.Iterable values) { + ensureBrandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, brands_); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @return This builder for chaining. + */ + public Builder clearBrands() { + brands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The brands of the product.
+     * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+     * string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+     * property [Product.brand](https://schema.org/brand).
+     * 
+ * + * repeated string brands = 9; + * + * @param value The bytes of the brands to add. + * @return This builder for chaining. + */ + public Builder addBrandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBrandsIsMutable(); + brands_.add(value); + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Product description.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [description](https://support.google.com/merchants/answer/6324468).
+     * Schema.org property [Product.description](https://schema.org/description).
+     * 
+ * + * string description = 10; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2beta.Product] can include text in different
+     * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+     * to provide text in multiple languages can result in degraded model
+     * performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2beta.Product] can include text in different
+     * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+     * to provide text in multiple languages can result in degraded model
+     * performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2beta.Product] can include text in different
+     * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+     * to provide text in multiple languages can result in degraded model
+     * performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2beta.Product] can include text in different
+     * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+     * to provide text in multiple languages can result in degraded model
+     * performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Language of the title/description and other string attributes. Use language
+     * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+     * For product prediction, this field is ignored and the model automatically
+     * detects the text language. The
+     * [Product][google.cloud.retail.v2beta.Product] can include text in different
+     * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+     * to provide text in multiple languages can result in degraded model
+     * performance.
+     * For product search this field is in use. It defaults to "en-US" if unset.
+     * 
+ * + * string language_code = 11; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Highly encouraged. Extra product attributes to be included. For example,
+     * for products, this could include the store name, vendor, style, color, etc.
+     * These are very strong signals for recommendation model, thus we highly
+     * recommend providing the attributes here.
+     * Features that can take on one of a limited number of possible values. Two
+     * types of features can be set are:
+     * Textual features. some examples would be the brand/maker of a product, or
+     * country of a customer. Numerical features. Some examples would be the
+     * height/weight of a product, or age of a customer.
+     * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+     * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+     * }`.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * Max entries count: 200.
+     * * The key must be a UTF-8 encoded string with a length limit of 128
+     *   characters.
+     * * For indexable attribute, the key must match the pattern:
+     *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+     *   `KEY_1_LIKE_THIS`.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+     *   length limit of 256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom tags associated with the product.
+     * At most 250 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+     * encoded string with a length limit of 1,000 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This tag can be used for filtering recommendation results by passing the
+     * tag as part of the
+     * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+     * Corresponding properties: Google Merchant Center property
+     * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+     * 
+ * + * repeated string tags = 13; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.PriceInfo priceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder> + priceInfoBuilder_; + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + public boolean hasPriceInfo() { + return priceInfoBuilder_ != null || priceInfo_ != null; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + public com.google.cloud.retail.v2beta.PriceInfo getPriceInfo() { + if (priceInfoBuilder_ == null) { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } else { + return priceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2beta.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priceInfo_ = value; + onChanged(); + } else { + priceInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public Builder setPriceInfo(com.google.cloud.retail.v2beta.PriceInfo.Builder builderForValue) { + if (priceInfoBuilder_ == null) { + priceInfo_ = builderForValue.build(); + onChanged(); + } else { + priceInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public Builder mergePriceInfo(com.google.cloud.retail.v2beta.PriceInfo value) { + if (priceInfoBuilder_ == null) { + if (priceInfo_ != null) { + priceInfo_ = + com.google.cloud.retail.v2beta.PriceInfo.newBuilder(priceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + priceInfo_ = value; + } + onChanged(); + } else { + priceInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public Builder clearPriceInfo() { + if (priceInfoBuilder_ == null) { + priceInfo_ = null; + onChanged(); + } else { + priceInfo_ = null; + priceInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2beta.PriceInfo.Builder getPriceInfoBuilder() { + + onChanged(); + return getPriceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + public com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder() { + if (priceInfoBuilder_ != null) { + return priceInfoBuilder_.getMessageOrBuilder(); + } else { + return priceInfo_ == null + ? com.google.cloud.retail.v2beta.PriceInfo.getDefaultInstance() + : priceInfo_; + } + } + /** + * + * + *
+     * Product price and cost information.
+     * Corresponding properties: Google Merchant Center property
+     * [price](https://support.google.com/merchants/answer/6324371).
+     * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder> + getPriceInfoFieldBuilder() { + if (priceInfoBuilder_ == null) { + priceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PriceInfo, + com.google.cloud.retail.v2beta.PriceInfo.Builder, + com.google.cloud.retail.v2beta.PriceInfoOrBuilder>( + getPriceInfo(), getParentForChildren(), isClean()); + priceInfo_ = null; + } + return priceInfoBuilder_; + } + + private com.google.cloud.retail.v2beta.Rating rating_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rating, + com.google.cloud.retail.v2beta.Rating.Builder, + com.google.cloud.retail.v2beta.RatingOrBuilder> + ratingBuilder_; + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + public boolean hasRating() { + return ratingBuilder_ != null || rating_ != null; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return The rating. + */ + public com.google.cloud.retail.v2beta.Rating getRating() { + if (ratingBuilder_ == null) { + return rating_ == null + ? com.google.cloud.retail.v2beta.Rating.getDefaultInstance() + : rating_; + } else { + return ratingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2beta.Rating value) { + if (ratingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rating_ = value; + onChanged(); + } else { + ratingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public Builder setRating(com.google.cloud.retail.v2beta.Rating.Builder builderForValue) { + if (ratingBuilder_ == null) { + rating_ = builderForValue.build(); + onChanged(); + } else { + ratingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public Builder mergeRating(com.google.cloud.retail.v2beta.Rating value) { + if (ratingBuilder_ == null) { + if (rating_ != null) { + rating_ = + com.google.cloud.retail.v2beta.Rating.newBuilder(rating_) + .mergeFrom(value) + .buildPartial(); + } else { + rating_ = value; + } + onChanged(); + } else { + ratingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public Builder clearRating() { + if (ratingBuilder_ == null) { + rating_ = null; + onChanged(); + } else { + rating_ = null; + ratingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public com.google.cloud.retail.v2beta.Rating.Builder getRatingBuilder() { + + onChanged(); + return getRatingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + public com.google.cloud.retail.v2beta.RatingOrBuilder getRatingOrBuilder() { + if (ratingBuilder_ != null) { + return ratingBuilder_.getMessageOrBuilder(); + } else { + return rating_ == null + ? com.google.cloud.retail.v2beta.Rating.getDefaultInstance() + : rating_; + } + } + /** + * + * + *
+     * The rating of this product.
+     * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rating, + com.google.cloud.retail.v2beta.Rating.Builder, + com.google.cloud.retail.v2beta.RatingOrBuilder> + getRatingFieldBuilder() { + if (ratingBuilder_ == null) { + ratingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rating, + com.google.cloud.retail.v2beta.Rating.Builder, + com.google.cloud.retail.v2beta.RatingOrBuilder>( + getRating(), getParentForChildren(), isClean()); + rating_ = null; + } + return ratingBuilder_; + } + + private com.google.protobuf.Timestamp availableTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + availableTimeBuilder_; + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + public boolean hasAvailableTime() { + return availableTimeBuilder_ != null || availableTime_ != null; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + public com.google.protobuf.Timestamp getAvailableTime() { + if (availableTimeBuilder_ == null) { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } else { + return availableTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableTime_ = value; + onChanged(); + } else { + availableTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder setAvailableTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (availableTimeBuilder_ == null) { + availableTime_ = builderForValue.build(); + onChanged(); + } else { + availableTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder mergeAvailableTime(com.google.protobuf.Timestamp value) { + if (availableTimeBuilder_ == null) { + if (availableTime_ != null) { + availableTime_ = + com.google.protobuf.Timestamp.newBuilder(availableTime_) + .mergeFrom(value) + .buildPartial(); + } else { + availableTime_ = value; + } + onChanged(); + } else { + availableTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public Builder clearAvailableTime() { + if (availableTimeBuilder_ == null) { + availableTime_ = null; + onChanged(); + } else { + availableTime_ = null; + availableTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.Timestamp.Builder getAvailableTimeBuilder() { + + onChanged(); + return getAvailableTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + public com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder() { + if (availableTimeBuilder_ != null) { + return availableTimeBuilder_.getMessageOrBuilder(); + } else { + return availableTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : availableTime_; + } + } + /** + * + * + *
+     * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+     * becomes available for
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAvailableTimeFieldBuilder() { + if (availableTimeBuilder_ == null) { + availableTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAvailableTime(), getParentForChildren(), isClean()); + availableTime_ = null; + } + return availableTimeBuilder_; + } + + private int availability_ = 0; + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2beta.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + @java.lang.Override + public int getAvailabilityValue() { + return availability_; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2beta.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @param value The enum numeric value on the wire for availability to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityValue(int value) { + + availability_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2beta.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The availability. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product.Availability getAvailability() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Product.Availability result = + com.google.cloud.retail.v2beta.Product.Availability.valueOf(availability_); + return result == null + ? com.google.cloud.retail.v2beta.Product.Availability.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2beta.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @param value The availability to set. + * @return This builder for chaining. + */ + public Builder setAvailability(com.google.cloud.retail.v2beta.Product.Availability value) { + if (value == null) { + throw new NullPointerException(); + } + + availability_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The online availability of the
+     * [Product][google.cloud.retail.v2beta.Product]. Default to
+     * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+     * Corresponding properties: Google Merchant Center property
+     * [availability](https://support.google.com/merchants/answer/6324448).
+     * Schema.org property [Offer.availability](https://schema.org/availability).
+     * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return This builder for chaining. + */ + public Builder clearAvailability() { + + availability_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value availableQuantity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + availableQuantityBuilder_; + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + public boolean hasAvailableQuantity() { + return availableQuantityBuilder_ != null || availableQuantity_ != null; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + public com.google.protobuf.Int32Value getAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } else { + return availableQuantityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + availableQuantity_ = value; + onChanged(); + } else { + availableQuantityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder setAvailableQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = builderForValue.build(); + onChanged(); + } else { + availableQuantityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder mergeAvailableQuantity(com.google.protobuf.Int32Value value) { + if (availableQuantityBuilder_ == null) { + if (availableQuantity_ != null) { + availableQuantity_ = + com.google.protobuf.Int32Value.newBuilder(availableQuantity_) + .mergeFrom(value) + .buildPartial(); + } else { + availableQuantity_ = value; + } + onChanged(); + } else { + availableQuantityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public Builder clearAvailableQuantity() { + if (availableQuantityBuilder_ == null) { + availableQuantity_ = null; + onChanged(); + } else { + availableQuantity_ = null; + availableQuantityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32Value.Builder getAvailableQuantityBuilder() { + + onChanged(); + return getAvailableQuantityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + public com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder() { + if (availableQuantityBuilder_ != null) { + return availableQuantityBuilder_.getMessageOrBuilder(); + } else { + return availableQuantity_ == null + ? com.google.protobuf.Int32Value.getDefaultInstance() + : availableQuantity_; + } + } + /** + * + * + *
+     * The available quantity of the item.
+     * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getAvailableQuantityFieldBuilder() { + if (availableQuantityBuilder_ == null) { + availableQuantityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getAvailableQuantity(), getParentForChildren(), isClean()); + availableQuantity_ = null; + } + return availableQuantityBuilder_; + } + + private java.util.List fulfillmentInfo_ = + java.util.Collections.emptyList(); + + private void ensureFulfillmentInfoIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + fulfillmentInfo_ = + new java.util.ArrayList( + fulfillmentInfo_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.FulfillmentInfo, + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder, + com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder> + fulfillmentInfoBuilder_; + + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List getFulfillmentInfoList() { + if (fulfillmentInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(fulfillmentInfo_); + } else { + return fulfillmentInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public int getFulfillmentInfoCount() { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.size(); + } else { + return fulfillmentInfoBuilder_.getCount(); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2beta.FulfillmentInfo getFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); + } else { + return fulfillmentInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo( + int index, com.google.cloud.retail.v2beta.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder setFulfillmentInfo( + int index, com.google.cloud.retail.v2beta.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo(com.google.cloud.retail.v2beta.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + int index, com.google.cloud.retail.v2beta.FulfillmentInfo value) { + if (fulfillmentInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, value); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addFulfillmentInfo( + int index, com.google.cloud.retail.v2beta.FulfillmentInfo.Builder builderForValue) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + fulfillmentInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder addAllFulfillmentInfo( + java.lang.Iterable values) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fulfillmentInfo_); + onChanged(); + } else { + fulfillmentInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder clearFulfillmentInfo() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + fulfillmentInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public Builder removeFulfillmentInfo(int index) { + if (fulfillmentInfoBuilder_ == null) { + ensureFulfillmentInfoIsMutable(); + fulfillmentInfo_.remove(index); + onChanged(); + } else { + fulfillmentInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2beta.FulfillmentInfo.Builder getFulfillmentInfoBuilder( + int index) { + return getFulfillmentInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder( + int index) { + if (fulfillmentInfoBuilder_ == null) { + return fulfillmentInfo_.get(index); + } else { + return fulfillmentInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoOrBuilderList() { + if (fulfillmentInfoBuilder_ != null) { + return fulfillmentInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fulfillmentInfo_); + } + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2beta.FulfillmentInfo.Builder addFulfillmentInfoBuilder() { + return getFulfillmentInfoFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.FulfillmentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public com.google.cloud.retail.v2beta.FulfillmentInfo.Builder addFulfillmentInfoBuilder( + int index) { + return getFulfillmentInfoFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.FulfillmentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * Fulfillment information, such as the store IDs for in-store pickup or
+     * region IDs for different shipping methods.
+     * All the elements must have distinct
+     * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + public java.util.List + getFulfillmentInfoBuilderList() { + return getFulfillmentInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.FulfillmentInfo, + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder, + com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder> + getFulfillmentInfoFieldBuilder() { + if (fulfillmentInfoBuilder_ == null) { + fulfillmentInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.FulfillmentInfo, + com.google.cloud.retail.v2beta.FulfillmentInfo.Builder, + com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder>( + fulfillmentInfo_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + fulfillmentInfo_ = null; + } + return fulfillmentInfoBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Canonical URL directly linking to the product detail page.
+     * It is strongly recommended to provide a valid uri for the product,
+     * otherwise the service performance could be significantly degraded.
+     * This field must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+     * property [Offer.url](https://schema.org/url).
+     * 
+ * + * string uri = 22; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.util.List images_ = + java.util.Collections.emptyList(); + + private void ensureImagesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + images_ = new java.util.ArrayList(images_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Image, + com.google.cloud.retail.v2beta.Image.Builder, + com.google.cloud.retail.v2beta.ImageOrBuilder> + imagesBuilder_; + + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public java.util.List getImagesList() { + if (imagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(images_); + } else { + return imagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public int getImagesCount() { + if (imagesBuilder_ == null) { + return images_.size(); + } else { + return imagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public com.google.cloud.retail.v2beta.Image getImages(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder setImages(int index, com.google.cloud.retail.v2beta.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.set(index, value); + onChanged(); + } else { + imagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder setImages( + int index, com.google.cloud.retail.v2beta.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.set(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder addImages(com.google.cloud.retail.v2beta.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(value); + onChanged(); + } else { + imagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder addImages(int index, com.google.cloud.retail.v2beta.Image value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImagesIsMutable(); + images_.add(index, value); + onChanged(); + } else { + imagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder addImages(com.google.cloud.retail.v2beta.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder addImages( + int index, com.google.cloud.retail.v2beta.Image.Builder builderForValue) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.add(index, builderForValue.build()); + onChanged(); + } else { + imagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder addAllImages( + java.lang.Iterable values) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, images_); + onChanged(); + } else { + imagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder clearImages() { + if (imagesBuilder_ == null) { + images_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + imagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public Builder removeImages(int index) { + if (imagesBuilder_ == null) { + ensureImagesIsMutable(); + images_.remove(index); + onChanged(); + } else { + imagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public com.google.cloud.retail.v2beta.Image.Builder getImagesBuilder(int index) { + return getImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public com.google.cloud.retail.v2beta.ImageOrBuilder getImagesOrBuilder(int index) { + if (imagesBuilder_ == null) { + return images_.get(index); + } else { + return imagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public java.util.List + getImagesOrBuilderList() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(images_); + } + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public com.google.cloud.retail.v2beta.Image.Builder addImagesBuilder() { + return getImagesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public com.google.cloud.retail.v2beta.Image.Builder addImagesBuilder(int index) { + return getImagesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Image.getDefaultInstance()); + } + /** + * + * + *
+     * Product images for the product. We highly recommend putting the main
+     * image first.
+     * A maximum of 300 images are allowed.
+     * Corresponding properties: Google Merchant Center property
+     * [image_link](https://support.google.com/merchants/answer/6324350).
+     * Schema.org property [Product.image](https://schema.org/image).
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + public java.util.List getImagesBuilderList() { + return getImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Image, + com.google.cloud.retail.v2beta.Image.Builder, + com.google.cloud.retail.v2beta.ImageOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Image, + com.google.cloud.retail.v2beta.Image.Builder, + com.google.cloud.retail.v2beta.ImageOrBuilder>( + images_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + images_ = null; + } + return imagesBuilder_; + } + + private com.google.cloud.retail.v2beta.Audience audience_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Audience, + com.google.cloud.retail.v2beta.Audience.Builder, + com.google.cloud.retail.v2beta.AudienceOrBuilder> + audienceBuilder_; + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + public boolean hasAudience() { + return audienceBuilder_ != null || audience_ != null; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return The audience. + */ + public com.google.cloud.retail.v2beta.Audience getAudience() { + if (audienceBuilder_ == null) { + return audience_ == null + ? com.google.cloud.retail.v2beta.Audience.getDefaultInstance() + : audience_; + } else { + return audienceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public Builder setAudience(com.google.cloud.retail.v2beta.Audience value) { + if (audienceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audience_ = value; + onChanged(); + } else { + audienceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public Builder setAudience(com.google.cloud.retail.v2beta.Audience.Builder builderForValue) { + if (audienceBuilder_ == null) { + audience_ = builderForValue.build(); + onChanged(); + } else { + audienceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public Builder mergeAudience(com.google.cloud.retail.v2beta.Audience value) { + if (audienceBuilder_ == null) { + if (audience_ != null) { + audience_ = + com.google.cloud.retail.v2beta.Audience.newBuilder(audience_) + .mergeFrom(value) + .buildPartial(); + } else { + audience_ = value; + } + onChanged(); + } else { + audienceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public Builder clearAudience() { + if (audienceBuilder_ == null) { + audience_ = null; + onChanged(); + } else { + audience_ = null; + audienceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public com.google.cloud.retail.v2beta.Audience.Builder getAudienceBuilder() { + + onChanged(); + return getAudienceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + public com.google.cloud.retail.v2beta.AudienceOrBuilder getAudienceOrBuilder() { + if (audienceBuilder_ != null) { + return audienceBuilder_.getMessageOrBuilder(); + } else { + return audience_ == null + ? com.google.cloud.retail.v2beta.Audience.getDefaultInstance() + : audience_; + } + } + /** + * + * + *
+     * The target group associated with a given audience (e.g. male, veterans,
+     * car owners, musicians, etc.) of the product.
+     * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Audience, + com.google.cloud.retail.v2beta.Audience.Builder, + com.google.cloud.retail.v2beta.AudienceOrBuilder> + getAudienceFieldBuilder() { + if (audienceBuilder_ == null) { + audienceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Audience, + com.google.cloud.retail.v2beta.Audience.Builder, + com.google.cloud.retail.v2beta.AudienceOrBuilder>( + getAudience(), getParentForChildren(), isClean()); + audience_ = null; + } + return audienceBuilder_; + } + + private com.google.cloud.retail.v2beta.ColorInfo colorInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ColorInfo, + com.google.cloud.retail.v2beta.ColorInfo.Builder, + com.google.cloud.retail.v2beta.ColorInfoOrBuilder> + colorInfoBuilder_; + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + public boolean hasColorInfo() { + return colorInfoBuilder_ != null || colorInfo_ != null; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + public com.google.cloud.retail.v2beta.ColorInfo getColorInfo() { + if (colorInfoBuilder_ == null) { + return colorInfo_ == null + ? com.google.cloud.retail.v2beta.ColorInfo.getDefaultInstance() + : colorInfo_; + } else { + return colorInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public Builder setColorInfo(com.google.cloud.retail.v2beta.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + colorInfo_ = value; + onChanged(); + } else { + colorInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public Builder setColorInfo(com.google.cloud.retail.v2beta.ColorInfo.Builder builderForValue) { + if (colorInfoBuilder_ == null) { + colorInfo_ = builderForValue.build(); + onChanged(); + } else { + colorInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public Builder mergeColorInfo(com.google.cloud.retail.v2beta.ColorInfo value) { + if (colorInfoBuilder_ == null) { + if (colorInfo_ != null) { + colorInfo_ = + com.google.cloud.retail.v2beta.ColorInfo.newBuilder(colorInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + colorInfo_ = value; + } + onChanged(); + } else { + colorInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public Builder clearColorInfo() { + if (colorInfoBuilder_ == null) { + colorInfo_ = null; + onChanged(); + } else { + colorInfo_ = null; + colorInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public com.google.cloud.retail.v2beta.ColorInfo.Builder getColorInfoBuilder() { + + onChanged(); + return getColorInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + public com.google.cloud.retail.v2beta.ColorInfoOrBuilder getColorInfoOrBuilder() { + if (colorInfoBuilder_ != null) { + return colorInfoBuilder_.getMessageOrBuilder(); + } else { + return colorInfo_ == null + ? com.google.cloud.retail.v2beta.ColorInfo.getDefaultInstance() + : colorInfo_; + } + } + /** + * + * + *
+     * The color of the product.
+     * Corresponding properties: Google Merchant Center property
+     * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+     * property [Product.color](https://schema.org/color).
+     * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ColorInfo, + com.google.cloud.retail.v2beta.ColorInfo.Builder, + com.google.cloud.retail.v2beta.ColorInfoOrBuilder> + getColorInfoFieldBuilder() { + if (colorInfoBuilder_ == null) { + colorInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ColorInfo, + com.google.cloud.retail.v2beta.ColorInfo.Builder, + com.google.cloud.retail.v2beta.ColorInfoOrBuilder>( + getColorInfo(), getParentForChildren(), isClean()); + colorInfo_ = null; + } + return colorInfoBuilder_; + } + + private com.google.protobuf.LazyStringList sizes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSizesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + sizes_ = new com.google.protobuf.LazyStringArrayList(sizes_); + bitField0_ |= 0x00000080; + } + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + public com.google.protobuf.ProtocolStringList getSizesList() { + return sizes_.getUnmodifiableView(); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + public int getSizesCount() { + return sizes_.size(); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + public java.lang.String getSizes(int index) { + return sizes_.get(index); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + public com.google.protobuf.ByteString getSizesBytes(int index) { + return sizes_.getByteString(index); + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param index The index to set the value at. + * @param value The sizes to set. + * @return This builder for chaining. + */ + public Builder setSizes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizesIsMutable(); + sizes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param value The sizes to add. + * @return This builder for chaining. + */ + public Builder addSizes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizesIsMutable(); + sizes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param values The sizes to add. + * @return This builder for chaining. + */ + public Builder addAllSizes(java.lang.Iterable values) { + ensureSizesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sizes_); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @return This builder for chaining. + */ + public Builder clearSizes() { + sizes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the product. To represent different size systems or size types,
+     * consider using this format: [[[size_system:]size_type:]size_value].
+     * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+     * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+     * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+     * both size system and size type are empty, while size value is "32 inches".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [size](https://support.google.com/merchants/answer/6324492),
+     * [size_type](https://support.google.com/merchants/answer/6324497), and
+     * [size_system](https://support.google.com/merchants/answer/6324502).
+     * Schema.org property [Product.size](https://schema.org/size).
+     * 
+ * + * repeated string sizes = 26; + * + * @param value The bytes of the sizes to add. + * @return This builder for chaining. + */ + public Builder addSizesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSizesIsMutable(); + sizes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList materials_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMaterialsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(materials_); + bitField0_ |= 0x00000100; + } + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_.getUnmodifiableView(); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param index The index to set the value at. + * @param value The materials to set. + * @return This builder for chaining. + */ + public Builder setMaterials(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param value The materials to add. + * @return This builder for chaining. + */ + public Builder addMaterials(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param values The materials to add. + * @return This builder for chaining. + */ + public Builder addAllMaterials(java.lang.Iterable values) { + ensureMaterialsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @return This builder for chaining. + */ + public Builder clearMaterials() { + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of the product. For example, "leather", "wooden".
+     * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+     * string with a length limit of 200 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+     * property [Product.material](https://schema.org/material).
+     * 
+ * + * repeated string materials = 27; + * + * @param value The bytes of the materials to add. + * @return This builder for chaining. + */ + public Builder addMaterialsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList patterns_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePatternsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + patterns_ = new com.google.protobuf.LazyStringArrayList(patterns_); + bitField0_ |= 0x00000200; + } + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + public com.google.protobuf.ProtocolStringList getPatternsList() { + return patterns_.getUnmodifiableView(); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + public int getPatternsCount() { + return patterns_.size(); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + public java.lang.String getPatterns(int index) { + return patterns_.get(index); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + public com.google.protobuf.ByteString getPatternsBytes(int index) { + return patterns_.getByteString(index); + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param index The index to set the value at. + * @param value The patterns to set. + * @return This builder for chaining. + */ + public Builder setPatterns(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePatternsIsMutable(); + patterns_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param value The patterns to add. + * @return This builder for chaining. + */ + public Builder addPatterns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePatternsIsMutable(); + patterns_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param values The patterns to add. + * @return This builder for chaining. + */ + public Builder addAllPatterns(java.lang.Iterable values) { + ensurePatternsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, patterns_); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @return This builder for chaining. + */ + public Builder clearPatterns() { + patterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The pattern or graphic print of the product. For example, "striped", "polka
+     * dot", "paisley".
+     * A maximum of 20 values are allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+     * property [Product.pattern](https://schema.org/pattern).
+     * 
+ * + * repeated string patterns = 28; + * + * @param value The bytes of the patterns to add. + * @return This builder for chaining. + */ + public Builder addPatternsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePatternsIsMutable(); + patterns_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList conditions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + conditions_ = new com.google.protobuf.LazyStringArrayList(conditions_); + bitField0_ |= 0x00000400; + } + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + public com.google.protobuf.ProtocolStringList getConditionsList() { + return conditions_.getUnmodifiableView(); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + public java.lang.String getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + public com.google.protobuf.ByteString getConditionsBytes(int index) { + return conditions_.getByteString(index); + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param index The index to set the value at. + * @param value The conditions to set. + * @return This builder for chaining. + */ + public Builder setConditions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param value The conditions to add. + * @return This builder for chaining. + */ + public Builder addConditions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param values The conditions to add. + * @return This builder for chaining. + */ + public Builder addAllConditions(java.lang.Iterable values) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @return This builder for chaining. + */ + public Builder clearConditions() { + conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * The condition of the product. Strongly encouraged to use the standard
+     * values: "new", "refurbished", "used".
+     * A maximum of 1 value is allowed per
+     * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+     * encoded string with a length limit of 128 characters. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * Corresponding properties: Google Merchant Center property
+     * [condition](https://support.google.com/merchants/answer/6324469).
+     * Schema.org property
+     * [Offer.itemCondition](https://schema.org/itemCondition).
+     * 
+ * + * repeated string conditions = 29; + * + * @param value The bytes of the conditions to add. + * @return This builder for chaining. + */ + public Builder addConditionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + return this; + } + + private java.util.List promotions_ = + java.util.Collections.emptyList(); + + private void ensurePromotionsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + promotions_ = + new java.util.ArrayList(promotions_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Promotion, + com.google.cloud.retail.v2beta.Promotion.Builder, + com.google.cloud.retail.v2beta.PromotionOrBuilder> + promotionsBuilder_; + + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public java.util.List getPromotionsList() { + if (promotionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(promotions_); + } else { + return promotionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public int getPromotionsCount() { + if (promotionsBuilder_ == null) { + return promotions_.size(); + } else { + return promotionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2beta.Promotion getPromotions(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder setPromotions(int index, com.google.cloud.retail.v2beta.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.set(index, value); + onChanged(); + } else { + promotionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder setPromotions( + int index, com.google.cloud.retail.v2beta.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.set(index, builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder addPromotions(com.google.cloud.retail.v2beta.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.add(value); + onChanged(); + } else { + promotionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder addPromotions(int index, com.google.cloud.retail.v2beta.Promotion value) { + if (promotionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionsIsMutable(); + promotions_.add(index, value); + onChanged(); + } else { + promotionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder addPromotions(com.google.cloud.retail.v2beta.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder addPromotions( + int index, com.google.cloud.retail.v2beta.Promotion.Builder builderForValue) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.add(index, builderForValue.build()); + onChanged(); + } else { + promotionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder addAllPromotions( + java.lang.Iterable values) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotions_); + onChanged(); + } else { + promotionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder clearPromotions() { + if (promotionsBuilder_ == null) { + promotions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + promotionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public Builder removePromotions(int index) { + if (promotionsBuilder_ == null) { + ensurePromotionsIsMutable(); + promotions_.remove(index); + onChanged(); + } else { + promotionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2beta.Promotion.Builder getPromotionsBuilder(int index) { + return getPromotionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2beta.PromotionOrBuilder getPromotionsOrBuilder(int index) { + if (promotionsBuilder_ == null) { + return promotions_.get(index); + } else { + return promotionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public java.util.List + getPromotionsOrBuilderList() { + if (promotionsBuilder_ != null) { + return promotionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(promotions_); + } + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2beta.Promotion.Builder addPromotionsBuilder() { + return getPromotionsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Promotion.getDefaultInstance()); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public com.google.cloud.retail.v2beta.Promotion.Builder addPromotionsBuilder(int index) { + return getPromotionsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Promotion.getDefaultInstance()); + } + /** + * + * + *
+     * The promotions applied to the product. A maximum of 10 values are allowed
+     * per [Product][google.cloud.retail.v2beta.Product]. Only
+     * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+     * will be used, other fields will be ignored if set.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + public java.util.List + getPromotionsBuilderList() { + return getPromotionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Promotion, + com.google.cloud.retail.v2beta.Promotion.Builder, + com.google.cloud.retail.v2beta.PromotionOrBuilder> + getPromotionsFieldBuilder() { + if (promotionsBuilder_ == null) { + promotionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Promotion, + com.google.cloud.retail.v2beta.Promotion.Builder, + com.google.cloud.retail.v2beta.PromotionOrBuilder>( + promotions_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); + promotions_ = null; + } + return promotionsBuilder_; + } + + private com.google.protobuf.Timestamp publishTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + publishTimeBuilder_; + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + public boolean hasPublishTime() { + return publishTimeBuilder_ != null || publishTime_ != null; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + public com.google.protobuf.Timestamp getPublishTime() { + if (publishTimeBuilder_ == null) { + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; + } else { + return publishTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder setPublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + publishTime_ = value; + onChanged(); + } else { + publishTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder setPublishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (publishTimeBuilder_ == null) { + publishTime_ = builderForValue.build(); + onChanged(); + } else { + publishTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder mergePublishTime(com.google.protobuf.Timestamp value) { + if (publishTimeBuilder_ == null) { + if (publishTime_ != null) { + publishTime_ = + com.google.protobuf.Timestamp.newBuilder(publishTime_) + .mergeFrom(value) + .buildPartial(); + } else { + publishTime_ = value; + } + onChanged(); + } else { + publishTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public Builder clearPublishTime() { + if (publishTimeBuilder_ == null) { + publishTime_ = null; + onChanged(); + } else { + publishTime_ = null; + publishTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public com.google.protobuf.Timestamp.Builder getPublishTimeBuilder() { + + onChanged(); + return getPublishTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { + if (publishTimeBuilder_ != null) { + return publishTimeBuilder_.getMessageOrBuilder(); + } else { + return publishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : publishTime_; + } + } + /** + * + * + *
+     * The timestamp when the product is published by the retailer for the first
+     * time, which indicates the freshness of the products. Note that this field
+     * is different from
+     * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+     * it purely describes product freshness regardless of when it is available on
+     * search and recommendation.
+     * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getPublishTimeFieldBuilder() { + if (publishTimeBuilder_ == null) { + publishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getPublishTime(), getParentForChildren(), isClean()); + publishTime_ = null; + } + return publishTimeBuilder_; + } + + private com.google.protobuf.FieldMask retrievableFields_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + retrievableFieldsBuilder_; + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + public boolean hasRetrievableFields() { + return retrievableFieldsBuilder_ != null || retrievableFields_ != null; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + public com.google.protobuf.FieldMask getRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } else { + return retrievableFieldsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retrievableFields_ = value; + onChanged(); + } else { + retrievableFieldsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder setRetrievableFields(com.google.protobuf.FieldMask.Builder builderForValue) { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = builderForValue.build(); + onChanged(); + } else { + retrievableFieldsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder mergeRetrievableFields(com.google.protobuf.FieldMask value) { + if (retrievableFieldsBuilder_ == null) { + if (retrievableFields_ != null) { + retrievableFields_ = + com.google.protobuf.FieldMask.newBuilder(retrievableFields_) + .mergeFrom(value) + .buildPartial(); + } else { + retrievableFields_ = value; + } + onChanged(); + } else { + retrievableFieldsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public Builder clearRetrievableFields() { + if (retrievableFieldsBuilder_ == null) { + retrievableFields_ = null; + onChanged(); + } else { + retrievableFields_ = null; + retrievableFieldsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMask.Builder getRetrievableFieldsBuilder() { + + onChanged(); + return getRetrievableFieldsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + public com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder() { + if (retrievableFieldsBuilder_ != null) { + return retrievableFieldsBuilder_.getMessageOrBuilder(); + } else { + return retrievableFields_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : retrievableFields_; + } + } + /** + * + * + *
+     * Indicates which fields in the
+     * [Product][google.cloud.retail.v2beta.Product]s are returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+     * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+     * * [audience][google.cloud.retail.v2beta.Product.audience]
+     * * [availability][google.cloud.retail.v2beta.Product.availability]
+     * * [brands][google.cloud.retail.v2beta.Product.brands]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+     * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+     * * [materials][google.cloud.retail.v2beta.Product.materials]
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+     * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [rating][google.cloud.retail.v2beta.Product.rating]
+     * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+     * * [title][google.cloud.retail.v2beta.Product.title]
+     * * [uri][google.cloud.retail.v2beta.Product.uri]
+     * Supported fields only for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+     * * [categories][google.cloud.retail.v2beta.Product.categories]
+     * * [description][google.cloud.retail.v2beta.Product.description]
+     * * [images][google.cloud.retail.v2beta.Product.images]
+     * Supported fields only for
+     * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+     * * Only the first image in
+     * [images][google.cloud.retail.v2beta.Product.images]
+     * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+     * retrievable, include paths of the form "attributes.key" where "key" is the
+     * key of a custom attribute, as specified in
+     * [attributes][google.cloud.retail.v2beta.Product.attributes].
+     * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+     * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+     * following fields are always returned in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+     * following fields are always returned in by default:
+     * * [name][google.cloud.retail.v2beta.Product.name]
+     * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+     * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Note: Returning more fields in
+     * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+     * response payload size and serving latency.
+     * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getRetrievableFieldsFieldBuilder() { + if (retrievableFieldsBuilder_ == null) { + retrievableFieldsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getRetrievableFields(), getParentForChildren(), isClean()); + retrievableFields_ = null; + } + return retrievableFieldsBuilder_; + } + + private java.util.List variants_ = + java.util.Collections.emptyList(); + + private void ensureVariantsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + variants_ = new java.util.ArrayList(variants_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + variantsBuilder_; + + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getVariantsList() { + if (variantsBuilder_ == null) { + return java.util.Collections.unmodifiableList(variants_); + } else { + return variantsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getVariantsCount() { + if (variantsBuilder_ == null) { + return variants_.size(); + } else { + return variantsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Product getVariants(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); + } else { + return variantsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVariants(int index, com.google.cloud.retail.v2beta.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.set(index, value); + onChanged(); + } else { + variantsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVariants( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.set(index, builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(com.google.cloud.retail.v2beta.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.add(value); + onChanged(); + } else { + variantsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(int index, com.google.cloud.retail.v2beta.Product value) { + if (variantsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantsIsMutable(); + variants_.add(index, value); + onChanged(); + } else { + variantsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVariants( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.add(index, builderForValue.build()); + onChanged(); + } else { + variantsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllVariants( + java.lang.Iterable values) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variants_); + onChanged(); + } else { + variantsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVariants() { + if (variantsBuilder_ == null) { + variants_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + variantsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeVariants(int index) { + if (variantsBuilder_ == null) { + ensureVariantsIsMutable(); + variants_.remove(index); + onChanged(); + } else { + variantsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getVariantsBuilder(int index) { + return getVariantsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getVariantsOrBuilder(int index) { + if (variantsBuilder_ == null) { + return variants_.get(index); + } else { + return variantsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getVariantsOrBuilderList() { + if (variantsBuilder_ != null) { + return variantsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(variants_); + } + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder addVariantsBuilder() { + return getVariantsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder addVariantsBuilder(int index) { + return getVariantsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Product variants grouped together on primary product which
+     * share similar product attributes. It's automatically grouped by
+     * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     * for all the product variants. Only populated for
+     * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * Note: This field is OUTPUT_ONLY for
+     * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+     * Do not set this field in API requests.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getVariantsBuilderList() { + return getVariantsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getVariantsFieldBuilder() { + if (variantsBuilder_ == null) { + variantsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + variants_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + variants_ = null; + } + return variantsBuilder_; + } + + @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.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Product) + private static final com.google.cloud.retail.v2beta.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Product(); + } + + public static com.google.cloud.retail.v2beta.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Product parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Product(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.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetail.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetail.java new file mode 100644 index 00000000..d88ebb86 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetail.java @@ -0,0 +1,1181 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Detailed product information associated with a user event.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductDetail} + */ +public final class ProductDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ProductDetail) + ProductDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductDetail.newBuilder() to construct. + private ProductDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductDetail( + 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.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (quantity_ != null) { + subBuilder = quantity_.toBuilder(); + } + quantity_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(quantity_); + quantity_ = 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.UserEventProto + .internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductDetail.class, + com.google.cloud.retail.v2beta.ProductDetail.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Product product_; + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int QUANTITY_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value quantity_; + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return quantity_ != null; + } + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getQuantity() { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder() { + return getQuantity(); + } + + 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 (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (quantity_ != null) { + output.writeMessage(2, getQuantity()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); + } + if (quantity_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuantity()); + } + 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.ProductDetail)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ProductDetail other = + (com.google.cloud.retail.v2beta.ProductDetail) obj; + + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (hasQuantity() != other.hasQuantity()) return false; + if (hasQuantity()) { + if (!getQuantity().equals(other.getQuantity())) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + if (hasQuantity()) { + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getQuantity().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ProductDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductDetail 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.ProductDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductDetail 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.ProductDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductDetail 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.ProductDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductDetail 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.ProductDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductDetail 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.ProductDetail 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.ProductDetail 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.ProductDetail 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; + } + /** + * + * + *
+   * Detailed product information associated with a user event.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ProductDetail) + com.google.cloud.retail.v2beta.ProductDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductDetail.class, + com.google.cloud.retail.v2beta.ProductDetail.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ProductDetail.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + if (quantityBuilder_ == null) { + quantity_ = null; + } else { + quantity_ = null; + quantityBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductDetail getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ProductDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductDetail build() { + com.google.cloud.retail.v2beta.ProductDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductDetail buildPartial() { + com.google.cloud.retail.v2beta.ProductDetail result = + new com.google.cloud.retail.v2beta.ProductDetail(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + if (quantityBuilder_ == null) { + result.quantity_ = quantity_; + } else { + result.quantity_ = quantityBuilder_.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.ProductDetail) { + return mergeFrom((com.google.cloud.retail.v2beta.ProductDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ProductDetail other) { + if (other == com.google.cloud.retail.v2beta.ProductDetail.getDefaultInstance()) return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasQuantity()) { + mergeQuantity(other.getQuantity()); + } + 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.ProductDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ProductDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2beta.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2beta.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. [Product][google.cloud.retail.v2beta.Product] information.
+     * Required field(s):
+     * * [Product.id][google.cloud.retail.v2beta.Product.id]
+     * Optional override field(s):
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * If any supported optional fields are provided, we will treat them as a full
+     * override when looking up product information from the catalog. Thus, it is
+     * important to ensure that the overriding fields are accurate and
+     * complete.
+     * All other product fields are ignored and instead populated via catalog
+     * lookup after event ingestion.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private com.google.protobuf.Int32Value quantity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + quantityBuilder_; + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + public boolean hasQuantity() { + return quantityBuilder_ != null || quantity_ != null; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + public com.google.protobuf.Int32Value getQuantity() { + if (quantityBuilder_ == null) { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } else { + return quantityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder setQuantity(com.google.protobuf.Int32Value value) { + if (quantityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quantity_ = value; + onChanged(); + } else { + quantityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder setQuantity(com.google.protobuf.Int32Value.Builder builderForValue) { + if (quantityBuilder_ == null) { + quantity_ = builderForValue.build(); + onChanged(); + } else { + quantityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder mergeQuantity(com.google.protobuf.Int32Value value) { + if (quantityBuilder_ == null) { + if (quantity_ != null) { + quantity_ = + com.google.protobuf.Int32Value.newBuilder(quantity_).mergeFrom(value).buildPartial(); + } else { + quantity_ = value; + } + onChanged(); + } else { + quantityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public Builder clearQuantity() { + if (quantityBuilder_ == null) { + quantity_ = null; + onChanged(); + } else { + quantity_ = null; + quantityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public com.google.protobuf.Int32Value.Builder getQuantityBuilder() { + + onChanged(); + return getQuantityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder() { + if (quantityBuilder_ != null) { + return quantityBuilder_.getMessageOrBuilder(); + } else { + return quantity_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : quantity_; + } + } + /** + * + * + *
+     * Quantity of the product associated with the user event.
+     * For example, this field will be 2 if two products are added to the shopping
+     * cart for `purchase-complete` event. Required for `add-to-cart` and
+     * `purchase-complete` event types.
+     * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getQuantityFieldBuilder() { + if (quantityBuilder_ == null) { + quantityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getQuantity(), getParentForChildren(), isClean()); + quantity_ = null; + } + return quantityBuilder_; + } + + @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.ProductDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ProductDetail) + private static final com.google.cloud.retail.v2beta.ProductDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ProductDetail(); + } + + public static com.google.cloud.retail.v2beta.ProductDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductDetail(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.ProductDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetailOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetailOrBuilder.java new file mode 100644 index 00000000..6cd5f617 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductDetailOrBuilder.java @@ -0,0 +1,140 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +public interface ProductDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ProductDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2beta.Product getProduct(); + /** + * + * + *
+   * Required. [Product][google.cloud.retail.v2beta.Product] information.
+   * Required field(s):
+   * * [Product.id][google.cloud.retail.v2beta.Product.id]
+   * Optional override field(s):
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * If any supported optional fields are provided, we will treat them as a full
+   * override when looking up product information from the catalog. Thus, it is
+   * important to ensure that the overriding fields are accurate and
+   * complete.
+   * All other product fields are ignored and instead populated via catalog
+   * lookup after event ingestion.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return Whether the quantity field is set. + */ + boolean hasQuantity(); + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + * + * @return The quantity. + */ + com.google.protobuf.Int32Value getQuantity(); + /** + * + * + *
+   * Quantity of the product associated with the user event.
+   * For example, this field will be 2 if two products are added to the shopping
+   * cart for `purchase-complete` event. Required for `add-to-cart` and
+   * `purchase-complete` event types.
+   * 
+ * + * .google.protobuf.Int32Value quantity = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getQuantityOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSource.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSource.java new file mode 100644 index 00000000..7f48e4fc --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSource.java @@ -0,0 +1,1042 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The inline source for the input config for ImportProducts method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductInlineSource} + */ +public final class ProductInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ProductInlineSource) + ProductInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductInlineSource.newBuilder() to construct. + private ProductInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductInlineSource() { + products_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductInlineSource( + 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)) { + products_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + products_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Product.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)) { + products_ = java.util.Collections.unmodifiableList(products_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductInlineSource.class, + com.google.cloud.retail.v2beta.ProductInlineSource.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + private java.util.List products_; + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProducts(int index) { + return products_.get(index); + } + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.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 { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.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.ProductInlineSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ProductInlineSource other = + (com.google.cloud.retail.v2beta.ProductInlineSource) obj; + + if (!getProductsList().equals(other.getProductsList())) 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 (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource 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.ProductInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource 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.ProductInlineSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource 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.ProductInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource 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.ProductInlineSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource 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.ProductInlineSource 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.ProductInlineSource 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.ProductInlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inline source for the input config for ImportProducts method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ProductInlineSource) + com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductInlineSource.class, + com.google.cloud.retail.v2beta.ProductInlineSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ProductInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + productsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSource build() { + com.google.cloud.retail.v2beta.ProductInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSource buildPartial() { + com.google.cloud.retail.v2beta.ProductInlineSource result = + new com.google.cloud.retail.v2beta.ProductInlineSource(this); + int from_bitField0_ = bitField0_; + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.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.ProductInlineSource) { + return mergeFrom((com.google.cloud.retail.v2beta.ProductInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ProductInlineSource other) { + if (other == com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + 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.ProductInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ProductInlineSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProducts(int index, com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProducts( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(int index, com.google.cloud.retail.v2beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProducts( + int index, com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Product.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of products to update/create. Each product must have a
+     * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+     * of 100 items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + @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.ProductInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ProductInlineSource) + private static final com.google.cloud.retail.v2beta.ProductInlineSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ProductInlineSource(); + } + + public static com.google.cloud.retail.v2beta.ProductInlineSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductInlineSource(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.ProductInlineSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSourceOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSourceOrBuilder.java new file mode 100644 index 00000000..75eae060 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInlineSourceOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ProductInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ProductInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getProductsList(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.Product getProducts(int index); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getProductsCount(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getProductsOrBuilderList(); + /** + * + * + *
+   * Required. A list of products to update/create. Each product must have a
+   * valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max
+   * of 100 items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product products = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfig.java new file mode 100644 index 00000000..3784ba84 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfig.java @@ -0,0 +1,1458 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The input config source for products.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductInputConfig} + */ +public final class ProductInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ProductInputConfig) + ProductInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductInputConfig.newBuilder() to construct. + private ProductInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductInputConfig( + 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.ProductInlineSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.retail.v2beta.ProductInlineSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.ProductInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.ProductInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.retail.v2beta.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2beta.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = ((com.google.cloud.retail.v2beta.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductInputConfig.class, + com.google.cloud.retail.v2beta.ProductInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRODUCT_INLINE_SOURCE(1), + GCS_SOURCE(2), + BIG_QUERY_SOURCE(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return PRODUCT_INLINE_SOURCE; + case 2: + return GCS_SOURCE; + case 3: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int PRODUCT_INLINE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + @java.lang.Override + public boolean hasProductInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSource getProductInlineSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder + getProductInlineSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2beta.ProductInlineSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2beta.GcsSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2beta.ProductInlineSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2beta.GcsSource) source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + 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.ProductInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ProductInputConfig other = + (com.google.cloud.retail.v2beta.ProductInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getProductInlineSource().equals(other.getProductInlineSource())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 3: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + PRODUCT_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getProductInlineSource().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 3: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig 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.ProductInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig 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.ProductInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig 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.ProductInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig 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.ProductInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig 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.ProductInputConfig 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.ProductInputConfig 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.ProductInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for products.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ProductInputConfig) + com.google.cloud.retail.v2beta.ProductInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductInputConfig.class, + com.google.cloud.retail.v2beta.ProductInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ProductInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_ProductInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ProductInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInputConfig build() { + com.google.cloud.retail.v2beta.ProductInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInputConfig buildPartial() { + com.google.cloud.retail.v2beta.ProductInputConfig result = + new com.google.cloud.retail.v2beta.ProductInputConfig(this); + if (sourceCase_ == 1) { + if (productInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = productInlineSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.ProductInputConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.ProductInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ProductInputConfig other) { + if (other == com.google.cloud.retail.v2beta.ProductInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case PRODUCT_INLINE_SOURCE: + { + mergeProductInlineSource(other.getProductInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.ProductInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ProductInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInlineSource, + com.google.cloud.retail.v2beta.ProductInlineSource.Builder, + com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder> + productInlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + @java.lang.Override + public boolean hasProductInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSource getProductInlineSource() { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return productInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + public Builder setProductInlineSource( + com.google.cloud.retail.v2beta.ProductInlineSource value) { + if (productInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + productInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + public Builder setProductInlineSource( + com.google.cloud.retail.v2beta.ProductInlineSource.Builder builderForValue) { + if (productInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + productInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + public Builder mergeProductInlineSource( + com.google.cloud.retail.v2beta.ProductInlineSource value) { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.ProductInlineSource.newBuilder( + (com.google.cloud.retail.v2beta.ProductInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + productInlineSourceBuilder_.mergeFrom(value); + } else { + productInlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + public Builder clearProductInlineSource() { + if (productInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + productInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + public com.google.cloud.retail.v2beta.ProductInlineSource.Builder + getProductInlineSourceBuilder() { + return getProductInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder + getProductInlineSourceOrBuilder() { + if ((sourceCase_ == 1) && (productInlineSourceBuilder_ != null)) { + return productInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.ProductInlineSource) source_; + } + return com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for products.
+     * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInlineSource, + com.google.cloud.retail.v2beta.ProductInlineSource.Builder, + com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder> + getProductInlineSourceFieldBuilder() { + if (productInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2beta.ProductInlineSource.getDefaultInstance(); + } + productInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductInlineSource, + com.google.cloud.retail.v2beta.ProductInlineSource.Builder, + com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder>( + (com.google.cloud.retail.v2beta.ProductInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return productInlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.retail.v2beta.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.retail.v2beta.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.retail.v2beta.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.GcsSource.newBuilder( + (com.google.cloud.retail.v2beta.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + public com.google.cloud.retail.v2beta.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder>( + (com.google.cloud.retail.v2beta.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2beta.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2beta.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + public com.google.cloud.retail.v2beta.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 3) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2beta.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @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.ProductInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ProductInputConfig) + private static final com.google.cloud.retail.v2beta.ProductInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ProductInputConfig(); + } + + public static com.google.cloud.retail.v2beta.ProductInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductInputConfig(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.ProductInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfigOrBuilder.java new file mode 100644 index 00000000..ec9fba48 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductInputConfigOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ProductInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ProductInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return Whether the productInlineSource field is set. + */ + boolean hasProductInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + * + * @return The productInlineSource. + */ + com.google.cloud.retail.v2beta.ProductInlineSource getProductInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for products.
+   * 
+ * + * .google.cloud.retail.v2beta.ProductInlineSource product_inline_source = 1; + */ + com.google.cloud.retail.v2beta.ProductInlineSourceOrBuilder getProductInlineSourceOrBuilder(); + + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.retail.v2beta.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2; + */ + com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3; + */ + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2beta.ProductInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfig.java new file mode 100644 index 00000000..2a9e026c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfig.java @@ -0,0 +1,1074 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Configures what level the product should be uploaded with regards to
+ * how users will be send events and how predictions will be made.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductLevelConfig} + */ +public final class ProductLevelConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ProductLevelConfig) + ProductLevelConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductLevelConfig.newBuilder() to construct. + private ProductLevelConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductLevelConfig() { + ingestionProductType_ = ""; + merchantCenterProductIdField_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductLevelConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProductLevelConfig( + 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(); + + ingestionProductType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + merchantCenterProductIdField_ = 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.CatalogProto + .internal_static_google_cloud_retail_v2beta_ProductLevelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_ProductLevelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductLevelConfig.class, + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder.class); + } + + public static final int INGESTION_PRODUCT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object ingestionProductType_; + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + @java.lang.Override + public java.lang.String getIngestionProductType() { + java.lang.Object ref = ingestionProductType_; + 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(); + ingestionProductType_ = s; + return s; + } + } + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIngestionProductTypeBytes() { + java.lang.Object ref = ingestionProductType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ingestionProductType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER = 2; + private volatile java.lang.Object merchantCenterProductIdField_; + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+   * values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + @java.lang.Override + public java.lang.String getMerchantCenterProductIdField() { + java.lang.Object ref = merchantCenterProductIdField_; + 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(); + merchantCenterProductIdField_ = s; + return s; + } + } + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+   * values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { + java.lang.Object ref = merchantCenterProductIdField_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + merchantCenterProductIdField_ = 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(ingestionProductType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ingestionProductType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, merchantCenterProductIdField_); + } + 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(ingestionProductType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ingestionProductType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, merchantCenterProductIdField_); + } + 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.ProductLevelConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ProductLevelConfig other = + (com.google.cloud.retail.v2beta.ProductLevelConfig) obj; + + if (!getIngestionProductType().equals(other.getIngestionProductType())) return false; + if (!getMerchantCenterProductIdField().equals(other.getMerchantCenterProductIdField())) + 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) + INGESTION_PRODUCT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getIngestionProductType().hashCode(); + hash = (37 * hash) + MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getMerchantCenterProductIdField().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig 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.ProductLevelConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig 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.ProductLevelConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig 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.ProductLevelConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig 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.ProductLevelConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig 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.ProductLevelConfig 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.ProductLevelConfig 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.ProductLevelConfig 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; + } + /** + * + * + *
+   * Configures what level the product should be uploaded with regards to
+   * how users will be send events and how predictions will be made.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ProductLevelConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ProductLevelConfig) + com.google.cloud.retail.v2beta.ProductLevelConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_ProductLevelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_ProductLevelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ProductLevelConfig.class, + com.google.cloud.retail.v2beta.ProductLevelConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ProductLevelConfig.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(); + ingestionProductType_ = ""; + + merchantCenterProductIdField_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogProto + .internal_static_google_cloud_retail_v2beta_ProductLevelConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductLevelConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ProductLevelConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductLevelConfig build() { + com.google.cloud.retail.v2beta.ProductLevelConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductLevelConfig buildPartial() { + com.google.cloud.retail.v2beta.ProductLevelConfig result = + new com.google.cloud.retail.v2beta.ProductLevelConfig(this); + result.ingestionProductType_ = ingestionProductType_; + result.merchantCenterProductIdField_ = merchantCenterProductIdField_; + 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.ProductLevelConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.ProductLevelConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ProductLevelConfig other) { + if (other == com.google.cloud.retail.v2beta.ProductLevelConfig.getDefaultInstance()) + return this; + if (!other.getIngestionProductType().isEmpty()) { + ingestionProductType_ = other.ingestionProductType_; + onChanged(); + } + if (!other.getMerchantCenterProductIdField().isEmpty()) { + merchantCenterProductIdField_ = other.merchantCenterProductIdField_; + 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.ProductLevelConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ProductLevelConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object ingestionProductType_ = ""; + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + public java.lang.String getIngestionProductType() { + java.lang.Object ref = ingestionProductType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ingestionProductType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + public com.google.protobuf.ByteString getIngestionProductTypeBytes() { + java.lang.Object ref = ingestionProductType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ingestionProductType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @param value The ingestionProductType to set. + * @return This builder for chaining. + */ + public Builder setIngestionProductType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ingestionProductType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearIngestionProductType() { + + ingestionProductType_ = getDefaultInstance().getIngestionProductType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+     * ingested into the catalog. Acceptable values are:
+     * * `primary` (default): You can ingest
+     * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+     *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+     *   default to
+     *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+     *   if unset.
+     * * `variant`: You can only ingest
+     * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     *   This means
+     *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+     *   cannot be empty.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `variant` and
+     * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+     * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string ingestion_product_type = 1; + * + * @param value The bytes for ingestionProductType to set. + * @return This builder for chaining. + */ + public Builder setIngestionProductTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ingestionProductType_ = value; + onChanged(); + return this; + } + + private java.lang.Object merchantCenterProductIdField_ = ""; + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+     * values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + public java.lang.String getMerchantCenterProductIdField() { + java.lang.Object ref = merchantCenterProductIdField_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + merchantCenterProductIdField_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+     * values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { + java.lang.Object ref = merchantCenterProductIdField_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + merchantCenterProductIdField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+     * values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @param value The merchantCenterProductIdField to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterProductIdField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + merchantCenterProductIdField_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+     * values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return This builder for chaining. + */ + public Builder clearMerchantCenterProductIdField() { + + merchantCenterProductIdField_ = getDefaultInstance().getMerchantCenterProductIdField(); + onChanged(); + return this; + } + /** + * + * + *
+     * Which field of [Merchant Center
+     * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+     * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+     * values are:
+     * * `offerId` (default): Import `offerId` as the product ID.
+     * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+     *   API will choose one item from the ones with the same `itemGroupId`, and
+     *   use it to represent the item group.
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * If this field is `itemGroupId` and
+     * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+     * is `variant`, an INVALID_ARGUMENT error is returned.
+     * See [Using product
+     * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+     * for more details.
+     * 
+ * + * string merchant_center_product_id_field = 2; + * + * @param value The bytes for merchantCenterProductIdField to set. + * @return This builder for chaining. + */ + public Builder setMerchantCenterProductIdFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + merchantCenterProductIdField_ = 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.ProductLevelConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ProductLevelConfig) + private static final com.google.cloud.retail.v2beta.ProductLevelConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ProductLevelConfig(); + } + + public static com.google.cloud.retail.v2beta.ProductLevelConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductLevelConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProductLevelConfig(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.ProductLevelConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfigOrBuilder.java new file mode 100644 index 00000000..a0f05710 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductLevelConfigOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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.proto + +package com.google.cloud.retail.v2beta; + +public interface ProductLevelConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ProductLevelConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The ingestionProductType. + */ + java.lang.String getIngestionProductType(); + /** + * + * + *
+   * The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be
+   * ingested into the catalog. Acceptable values are:
+   * * `primary` (default): You can ingest
+   * [Product][google.cloud.retail.v2beta.Product]s of all types. When
+   *   ingesting a [Product][google.cloud.retail.v2beta.Product], its type will
+   *   default to
+   *   [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   *   if unset.
+   * * `variant`: You can only ingest
+   * [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   *   This means
+   *   [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   *   cannot be empty.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `variant` and
+   * [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
+   * is `itemGroupId`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string ingestion_product_type = 1; + * + * @return The bytes for ingestionProductType. + */ + com.google.protobuf.ByteString getIngestionProductTypeBytes(); + + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+   * values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The merchantCenterProductIdField. + */ + java.lang.String getMerchantCenterProductIdField(); + /** + * + * + *
+   * Which field of [Merchant Center
+   * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
+   * imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable
+   * values are:
+   * * `offerId` (default): Import `offerId` as the product ID.
+   * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
+   *   API will choose one item from the ones with the same `itemGroupId`, and
+   *   use it to represent the item group.
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * If this field is `itemGroupId` and
+   * [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * is `variant`, an INVALID_ARGUMENT error is returned.
+   * See [Using product
+   * levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
+   * for more details.
+   * 
+ * + * string merchant_center_product_id_field = 2; + * + * @return The bytes for merchantCenterProductIdField. + */ + com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductName.java new file mode 100644 index 00000000..03da1622 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductName.java @@ -0,0 +1,298 @@ +/* + * 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 ProductName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String branch; + private final String product; + + @Deprecated + protected ProductName() { + project = null; + location = null; + catalog = null; + branch = null; + product = null; + } + + private ProductName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + branch = Preconditions.checkNotNull(builder.getBranch()); + product = Preconditions.checkNotNull(builder.getProduct()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public String getProduct() { + return product; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProductName of( + String project, String location, String catalog, String branch, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .setProduct(product) + .build(); + } + + public static String format( + String project, String location, String catalog, String branch, String product) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setBranch(branch) + .setProduct(product) + .build() + .toString(); + } + + public static ProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.validatedMatch( + formattedString, "ProductName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("branch"), + matchMap.get("product")); + } + + 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 (ProductName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.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 (branch != null) { + fieldMapBuilder.put("branch", branch); + } + if (product != null) { + fieldMapBuilder.put("product", product); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_BRANCH_PRODUCT.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "branch", + branch, + "product", + product); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProductName that = ((ProductName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.branch, that.branch) + && Objects.equals(this.product, that.product); + } + 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(branch); + h *= 1000003; + h ^= Objects.hashCode(product); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}. + */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String branch; + private String product; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getBranch() { + return branch; + } + + public String getProduct() { + return product; + } + + 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 setBranch(String branch) { + this.branch = branch; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + private Builder(ProductName productName) { + this.project = productName.project; + this.location = productName.location; + this.catalog = productName.catalog; + this.branch = productName.branch; + this.product = productName.product; + } + + public ProductName build() { + return new ProductName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java new file mode 100644 index 00000000..05e0efd2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java @@ -0,0 +1,2286 @@ +/* + * 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/product.proto + +package com.google.cloud.retail.v2beta; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Product) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * The timestamp when this product becomes unavailable for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * If it is set, the [Product][google.cloud.retail.v2beta.Product] is not
+   * available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after [expire_time][google.cloud.retail.v2beta.Product.expire_time].
+   * However, the product can still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be
+   * later than
+   * [available_time][google.cloud.retail.v2beta.Product.available_time] and
+   * [publish_time][google.cloud.retail.v2beta.Product.publish_time],
+   * otherwise an INVALID_ARGUMENT error is thrown.
+   * Corresponding properties: Google Merchant Center property
+   * [expiration_date](https://support.google.com/merchants/answer/6324499).
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 16; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + * + * + *
+   * Input only. The TTL (time to live) of the product.
+   * If it is set, it must be a non-negative value, and
+   * [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as
+   * current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The
+   * derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is
+   * returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl]
+   * is left blank when retrieving the
+   * [Product][google.cloud.retail.v2beta.Product].
+   * If it is set, the product is not available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * after current timestamp plus
+   * [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can
+   * still be retrieved by
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]
+   * and
+   * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
+   * 
+ * + * .google.protobuf.Duration ttl = 17 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Full resource name of the product, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2beta.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which
+   * is the final component of [name][google.cloud.retail.v2beta.Product.name].
+   * For example, this field is "id_1", if
+   * [name][google.cloud.retail.v2beta.Product.name] is
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [id](https://support.google.com/merchants/answer/6324405). Schema.org
+   * property [Product.sku](https://schema.org/sku).
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Immutable. The type of the product. Default to
+   * [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
+   * if unset.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product.Type type = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The type. + */ + com.google.cloud.retail.v2beta.Product.Type getType(); + + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2beta.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The primaryProductId. + */ + java.lang.String getPrimaryProductId(); + /** + * + * + *
+   * Variant group identifier. Must be an
+   * [id][google.cloud.retail.v2beta.Product.id], with the same parent branch
+   * with this product. Otherwise, an error is thrown.
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s, this field can only be
+   * empty or set to the same value as
+   * [id][google.cloud.retail.v2beta.Product.id].
+   * For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field
+   * cannot be empty. A maximum of 2,000 products are allowed to share the same
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [item_group_id](https://support.google.com/merchants/answer/6324507).
+   * Schema.org property
+   * [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
+   * 
+ * + * string primary_product_id = 4; + * + * @return The bytes for primaryProductId. + */ + com.google.protobuf.ByteString getPrimaryProductIdBytes(); + + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return A list containing the collectionMemberIds. + */ + java.util.List getCollectionMemberIdsList(); + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @return The count of collectionMemberIds. + */ + int getCollectionMemberIdsCount(); + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the element to return. + * @return The collectionMemberIds at the given index. + */ + java.lang.String getCollectionMemberIds(int index); + /** + * + * + *
+   * The [id][google.cloud.retail.v2beta.Product.id] of the collection members
+   * when [type][google.cloud.retail.v2beta.Product.type] is
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION].
+   * Non-existent product ids are allowed.
+   * 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
+   * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
+   * return.
+   * 
+ * + * repeated string collection_member_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the collectionMemberIds at the given index. + */ + com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index); + + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The gtin. + */ + java.lang.String getGtin(); + /** + * + * + *
+   * The Global Trade Item Number (GTIN) of the product.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Corresponding properties: Google Merchant Center property
+   * [gtin](https://support.google.com/merchants/answer/6324461).
+   * Schema.org property
+   * [Product.isbn](https://schema.org/isbn),
+   * [Product.gtin8](https://schema.org/gtin8),
+   * [Product.gtin12](https://schema.org/gtin12),
+   * [Product.gtin13](https://schema.org/gtin13), or
+   * [Product.gtin14](https://schema.org/gtin14).
+   * If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string gtin = 6; + * + * @return The bytes for gtin. + */ + com.google.protobuf.ByteString getGtinBytes(); + + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+   * Product categories. This field is repeated for supporting one product
+   * 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
+   * other character(s).
+   * For example, if a shoes product belongs to both
+   * ["Shoes & Accessories" -> "Shoes"] and
+   * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
+   * represented as:
+   *      "categories": [
+   *        "Shoes & Accessories > Shoes",
+   *        "Sports & Fitness > Athletic Clothing > Shoes"
+   *      ]
+   * Must be set for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT
+   * error is returned.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Empty values are not
+   * allowed. Each value must be a UTF-8 encoded string with a length limit of
+   * 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [google_product_category][mc_google_product_category]. Schema.org property
+   * [Product.category] (https://schema.org/category).
+   * [mc_google_product_category]:
+   * https://support.google.com/merchants/answer/6324436
+   * 
+ * + * repeated string categories = 7; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + com.google.protobuf.ByteString getCategoriesBytes(int index); + + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Required. Product title.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [title](https://support.google.com/merchants/answer/6324415). Schema.org
+   * property [Product.name](https://schema.org/name).
+   * 
+ * + * string title = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return A list containing the brands. + */ + java.util.List getBrandsList(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @return The count of brands. + */ + int getBrandsCount(); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the element to return. + * @return The brands at the given index. + */ + java.lang.String getBrands(int index); + /** + * + * + *
+   * The brands of the product.
+   * A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
+   * string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [brand](https://support.google.com/merchants/answer/6324351). Schema.org
+   * property [Product.brand](https://schema.org/brand).
+   * 
+ * + * repeated string brands = 9; + * + * @param index The index of the value to return. + * @return The bytes of the brands at the given index. + */ + com.google.protobuf.ByteString getBrandsBytes(int index); + + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Product description.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [description](https://support.google.com/merchants/answer/6324468).
+   * Schema.org property [Product.description](https://schema.org/description).
+   * 
+ * + * string description = 10; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2beta.Product] can include text in different
+   * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+   * to provide text in multiple languages can result in degraded model
+   * performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Language of the title/description and other string attributes. Use language
+   * tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+   * For product prediction, this field is ignored and the model automatically
+   * detects the text language. The
+   * [Product][google.cloud.retail.v2beta.Product] can include text in different
+   * languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s
+   * to provide text in multiple languages can result in degraded model
+   * performance.
+   * For product search this field is in use. It defaults to "en-US" if unset.
+   * 
+ * + * string language_code = 11; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + int getAttributesCount(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute defaultValue); + /** + * + * + *
+   * Highly encouraged. Extra product attributes to be included. For example,
+   * for products, this could include the store name, vendor, style, color, etc.
+   * These are very strong signals for recommendation model, thus we highly
+   * recommend providing the attributes here.
+   * Features that can take on one of a limited number of possible values. Two
+   * types of features can be set are:
+   * Textual features. some examples would be the brand/maker of a product, or
+   * country of a customer. Numerical features. Some examples would be the
+   * height/weight of a product, or age of a customer.
+   * For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
+   * "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]}
+   * }`.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * Max entries count: 200.
+   * * The key must be a UTF-8 encoded string with a length limit of 128
+   *   characters.
+   * * For indexable attribute, the key must match the pattern:
+   *   `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or
+   *   `KEY_1_LIKE_THIS`.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a non-empty UTF-8 encoded string with a
+   *   length limit of 256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 12; + */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+   * Custom tags associated with the product.
+   * At most 250 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8
+   * encoded string with a length limit of 1,000 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This tag can be used for filtering recommendation results by passing the
+   * tag as part of the
+   * [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter].
+   * Corresponding properties: Google Merchant Center property
+   * [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
+   * 
+ * + * repeated string tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return Whether the priceInfo field is set. + */ + boolean hasPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + * + * @return The priceInfo. + */ + com.google.cloud.retail.v2beta.PriceInfo getPriceInfo(); + /** + * + * + *
+   * Product price and cost information.
+   * Corresponding properties: Google Merchant Center property
+   * [price](https://support.google.com/merchants/answer/6324371).
+   * 
+ * + * .google.cloud.retail.v2beta.PriceInfo price_info = 14; + */ + com.google.cloud.retail.v2beta.PriceInfoOrBuilder getPriceInfoOrBuilder(); + + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return Whether the rating field is set. + */ + boolean hasRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + * + * @return The rating. + */ + com.google.cloud.retail.v2beta.Rating getRating(); + /** + * + * + *
+   * The rating of this product.
+   * 
+ * + * .google.cloud.retail.v2beta.Rating rating = 15; + */ + com.google.cloud.retail.v2beta.RatingOrBuilder getRatingOrBuilder(); + + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return Whether the availableTime field is set. + */ + boolean hasAvailableTime(); + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + * + * @return The availableTime. + */ + com.google.protobuf.Timestamp getAvailableTime(); + /** + * + * + *
+   * The timestamp when this [Product][google.cloud.retail.v2beta.Product]
+   * becomes available for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * 
+ * + * .google.protobuf.Timestamp available_time = 18; + */ + com.google.protobuf.TimestampOrBuilder getAvailableTimeOrBuilder(); + + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2beta.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The enum numeric value on the wire for availability. + */ + int getAvailabilityValue(); + /** + * + * + *
+   * The online availability of the
+   * [Product][google.cloud.retail.v2beta.Product]. Default to
+   * [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK].
+   * Corresponding properties: Google Merchant Center property
+   * [availability](https://support.google.com/merchants/answer/6324448).
+   * Schema.org property [Offer.availability](https://schema.org/availability).
+   * 
+ * + * .google.cloud.retail.v2beta.Product.Availability availability = 19; + * + * @return The availability. + */ + com.google.cloud.retail.v2beta.Product.Availability getAvailability(); + + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return Whether the availableQuantity field is set. + */ + boolean hasAvailableQuantity(); + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + * + * @return The availableQuantity. + */ + com.google.protobuf.Int32Value getAvailableQuantity(); + /** + * + * + *
+   * The available quantity of the item.
+   * 
+ * + * .google.protobuf.Int32Value available_quantity = 20; + */ + com.google.protobuf.Int32ValueOrBuilder getAvailableQuantityOrBuilder(); + + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List getFulfillmentInfoList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2beta.FulfillmentInfo getFulfillmentInfo(int index); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + int getFulfillmentInfoCount(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + java.util.List + getFulfillmentInfoOrBuilderList(); + /** + * + * + *
+   * Fulfillment information, such as the store IDs for in-store pickup or
+   * region IDs for different shipping methods.
+   * All the elements must have distinct
+   * [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type].
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.FulfillmentInfo fulfillment_info = 21; + */ + com.google.cloud.retail.v2beta.FulfillmentInfoOrBuilder getFulfillmentInfoOrBuilder(int index); + + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Canonical URL directly linking to the product detail page.
+   * It is strongly recommended to provide a valid uri for the product,
+   * otherwise the service performance could be significantly degraded.
+   * This field must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [link](https://support.google.com/merchants/answer/6324416). Schema.org
+   * property [Offer.url](https://schema.org/url).
+   * 
+ * + * string uri = 22; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + java.util.List getImagesList(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + com.google.cloud.retail.v2beta.Image getImages(int index); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + int getImagesCount(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + java.util.List getImagesOrBuilderList(); + /** + * + * + *
+   * Product images for the product. We highly recommend putting the main
+   * image first.
+   * A maximum of 300 images are allowed.
+   * Corresponding properties: Google Merchant Center property
+   * [image_link](https://support.google.com/merchants/answer/6324350).
+   * Schema.org property [Product.image](https://schema.org/image).
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Image images = 23; + */ + com.google.cloud.retail.v2beta.ImageOrBuilder getImagesOrBuilder(int index); + + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return Whether the audience field is set. + */ + boolean hasAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + * + * @return The audience. + */ + com.google.cloud.retail.v2beta.Audience getAudience(); + /** + * + * + *
+   * The target group associated with a given audience (e.g. male, veterans,
+   * car owners, musicians, etc.) of the product.
+   * 
+ * + * .google.cloud.retail.v2beta.Audience audience = 24; + */ + com.google.cloud.retail.v2beta.AudienceOrBuilder getAudienceOrBuilder(); + + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return Whether the colorInfo field is set. + */ + boolean hasColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + * + * @return The colorInfo. + */ + com.google.cloud.retail.v2beta.ColorInfo getColorInfo(); + /** + * + * + *
+   * The color of the product.
+   * Corresponding properties: Google Merchant Center property
+   * [color](https://support.google.com/merchants/answer/6324487). Schema.org
+   * property [Product.color](https://schema.org/color).
+   * 
+ * + * .google.cloud.retail.v2beta.ColorInfo color_info = 25; + */ + com.google.cloud.retail.v2beta.ColorInfoOrBuilder getColorInfoOrBuilder(); + + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return A list containing the sizes. + */ + java.util.List getSizesList(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @return The count of sizes. + */ + int getSizesCount(); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the element to return. + * @return The sizes at the given index. + */ + java.lang.String getSizes(int index); + /** + * + * + *
+   * The size of the product. To represent different size systems or size types,
+   * consider using this format: [[[size_system:]size_type:]size_value].
+   * For example, in "US:MENS:M", "US" represents size system; "MENS" represents
+   * size type; "M" represents size value. In "GIRLS:27", size system is empty;
+   * "GIRLS" represents size type; "27" represents size value. In "32 inches",
+   * both size system and size type are empty, while size value is "32 inches".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [size](https://support.google.com/merchants/answer/6324492),
+   * [size_type](https://support.google.com/merchants/answer/6324497), and
+   * [size_system](https://support.google.com/merchants/answer/6324502).
+   * Schema.org property [Product.size](https://schema.org/size).
+   * 
+ * + * repeated string sizes = 26; + * + * @param index The index of the value to return. + * @return The bytes of the sizes at the given index. + */ + com.google.protobuf.ByteString getSizesBytes(int index); + + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return A list containing the materials. + */ + java.util.List getMaterialsList(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @return The count of materials. + */ + int getMaterialsCount(); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + java.lang.String getMaterials(int index); + /** + * + * + *
+   * The material of the product. For example, "leather", "wooden".
+   * A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
+   * string with a length limit of 200 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [material](https://support.google.com/merchants/answer/6324410). Schema.org
+   * property [Product.material](https://schema.org/material).
+   * 
+ * + * repeated string materials = 27; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + com.google.protobuf.ByteString getMaterialsBytes(int index); + + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return A list containing the patterns. + */ + java.util.List getPatternsList(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @return The count of patterns. + */ + int getPatternsCount(); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the element to return. + * @return The patterns at the given index. + */ + java.lang.String getPatterns(int index); + /** + * + * + *
+   * The pattern or graphic print of the product. For example, "striped", "polka
+   * dot", "paisley".
+   * A maximum of 20 values are allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
+   * property [Product.pattern](https://schema.org/pattern).
+   * 
+ * + * repeated string patterns = 28; + * + * @param index The index of the value to return. + * @return The bytes of the patterns at the given index. + */ + com.google.protobuf.ByteString getPatternsBytes(int index); + + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return A list containing the conditions. + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @return The count of conditions. + */ + int getConditionsCount(); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the element to return. + * @return The conditions at the given index. + */ + java.lang.String getConditions(int index); + /** + * + * + *
+   * The condition of the product. Strongly encouraged to use the standard
+   * values: "new", "refurbished", "used".
+   * A maximum of 1 value is allowed per
+   * [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8
+   * encoded string with a length limit of 128 characters. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * Corresponding properties: Google Merchant Center property
+   * [condition](https://support.google.com/merchants/answer/6324469).
+   * Schema.org property
+   * [Offer.itemCondition](https://schema.org/itemCondition).
+   * 
+ * + * repeated string conditions = 29; + * + * @param index The index of the value to return. + * @return The bytes of the conditions at the given index. + */ + com.google.protobuf.ByteString getConditionsBytes(int index); + + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + java.util.List getPromotionsList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + com.google.cloud.retail.v2beta.Promotion getPromotions(int index); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + int getPromotionsCount(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + java.util.List + getPromotionsOrBuilderList(); + /** + * + * + *
+   * The promotions applied to the product. A maximum of 10 values are allowed
+   * per [Product][google.cloud.retail.v2beta.Product]. Only
+   * [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id]
+   * will be used, other fields will be ignored if set.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Promotion promotions = 34; + */ + com.google.cloud.retail.v2beta.PromotionOrBuilder getPromotionsOrBuilder(int index); + + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return Whether the publishTime field is set. + */ + boolean hasPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + * + * @return The publishTime. + */ + com.google.protobuf.Timestamp getPublishTime(); + /** + * + * + *
+   * The timestamp when the product is published by the retailer for the first
+   * time, which indicates the freshness of the products. Note that this field
+   * is different from
+   * [available_time][google.cloud.retail.v2beta.Product.available_time], given
+   * it purely describes product freshness regardless of when it is available on
+   * search and recommendation.
+   * 
+ * + * .google.protobuf.Timestamp publish_time = 33; + */ + com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return Whether the retrievableFields field is set. + */ + boolean hasRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + * + * @return The retrievableFields. + */ + com.google.protobuf.FieldMask getRetrievableFields(); + /** + * + * + *
+   * Indicates which fields in the
+   * [Product][google.cloud.retail.v2beta.Product]s are returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse].
+   * Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s:
+   * * [audience][google.cloud.retail.v2beta.Product.audience]
+   * * [availability][google.cloud.retail.v2beta.Product.availability]
+   * * [brands][google.cloud.retail.v2beta.Product.brands]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * * [conditions][google.cloud.retail.v2beta.Product.conditions]
+   * * [gtin][google.cloud.retail.v2beta.Product.gtin]
+   * * [materials][google.cloud.retail.v2beta.Product.materials]
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [patterns][google.cloud.retail.v2beta.Product.patterns]
+   * * [price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [rating][google.cloud.retail.v2beta.Product.rating]
+   * * [sizes][google.cloud.retail.v2beta.Product.sizes]
+   * * [title][google.cloud.retail.v2beta.Product.title]
+   * * [uri][google.cloud.retail.v2beta.Product.uri]
+   * Supported fields only for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]:
+   * * [categories][google.cloud.retail.v2beta.Product.categories]
+   * * [description][google.cloud.retail.v2beta.Product.description]
+   * * [images][google.cloud.retail.v2beta.Product.images]
+   * Supported fields only for
+   * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]:
+   * * Only the first image in
+   * [images][google.cloud.retail.v2beta.Product.images]
+   * To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as
+   * retrievable, include paths of the form "attributes.key" where "key" is the
+   * key of a custom attribute, as specified in
+   * [attributes][google.cloud.retail.v2beta.Product.attributes].
+   * For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and
+   * [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the
+   * following fields are always returned in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the
+   * following fields are always returned in by default:
+   * * [name][google.cloud.retail.v2beta.Product.name]
+   * * [color_info][google.cloud.retail.v2beta.Product.color_info]
+   * Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Note: Returning more fields in
+   * [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase
+   * response payload size and serving latency.
+   * 
+ * + * .google.protobuf.FieldMask retrievable_fields = 30; + */ + com.google.protobuf.FieldMaskOrBuilder getRetrievableFieldsOrBuilder(); + + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getVariantsList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.Product getVariants(int index); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getVariantsCount(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getVariantsOrBuilderList(); + /** + * + * + *
+   * Output only. Product variants grouped together on primary product which
+   * share similar product attributes. It's automatically grouped by
+   * [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
+   * for all the product variants. Only populated for
+   * [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
+   * [Product][google.cloud.retail.v2beta.Product]s.
+   * Note: This field is OUTPUT_ONLY for
+   * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
+   * Do not set this field in API requests.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Product variants = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getVariantsOrBuilder(int index); + + public com.google.cloud.retail.v2beta.Product.ExpirationCase getExpirationCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java new file mode 100644 index 00000000..f0a512f6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java @@ -0,0 +1,189 @@ +/* + * 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/product.proto + +package com.google.cloud.retail.v2beta; + +public final class ProductProto { + private ProductProto() {} + + 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_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_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/product.pro" + + "to\022\032google.cloud.retail.v2beta\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032\'google/cloud/retail/v2beta/c" + + "ommon.proto\032*google/cloud/retail/v2beta/" + + "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" + + "\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" + + "d\030\002 \001(\tB\003\340A\005\022;\n\004type\030\003 \001(\0162(.google.clou" + + "d.retail.v2beta.Product.TypeB\003\340A\005\022\032\n\022pri" + + "mary_product_id\030\004 \001(\t\022\035\n\025collection_memb" + + "er_ids\030\005 \003(\t\022\014\n\004gtin\030\006 \001(\t\022\022\n\ncategories" + + "\030\007 \003(\t\022\022\n\005title\030\010 \001(\tB\003\340A\002\022\016\n\006brands\030\t \003" + + "(\t\022\023\n\013description\030\n \001(\t\022\025\n\rlanguage_code" + + "\030\013 \001(\t\022G\n\nattributes\030\014 \003(\01323.google.clou" + + "d.retail.v2beta.Product.AttributesEntry\022" + + "\014\n\004tags\030\r \003(\t\0229\n\nprice_info\030\016 \001(\0132%.goog" + + "le.cloud.retail.v2beta.PriceInfo\0222\n\006rati" + + "ng\030\017 \001(\0132\".google.cloud.retail.v2beta.Ra" + + "ting\0222\n\016available_time\030\022 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022F\n\014availability\030\023 \001(\01620" + + ".google.cloud.retail.v2beta.Product.Avai" + + "lability\0227\n\022available_quantity\030\024 \001(\0132\033.g" + + "oogle.protobuf.Int32Value\022E\n\020fulfillment" + + "_info\030\025 \003(\0132+.google.cloud.retail.v2beta" + + ".FulfillmentInfo\022\013\n\003uri\030\026 \001(\t\0221\n\006images\030" + + "\027 \003(\0132!.google.cloud.retail.v2beta.Image" + + "\0226\n\010audience\030\030 \001(\0132$.google.cloud.retail" + + ".v2beta.Audience\0229\n\ncolor_info\030\031 \001(\0132%.g" + + "oogle.cloud.retail.v2beta.ColorInfo\022\r\n\005s" + + "izes\030\032 \003(\t\022\021\n\tmaterials\030\033 \003(\t\022\020\n\010pattern" + + "s\030\034 \003(\t\022\022\n\nconditions\030\035 \003(\t\0229\n\npromotion" + + "s\030\" \003(\0132%.google.cloud.retail.v2beta.Pro" + + "motion\0220\n\014publish_time\030! \001(\0132\032.google.pr" + + "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" + }; + 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.cloud.retail.v2beta.PromotionProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_Product_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Product_descriptor, + new java.lang.String[] { + "ExpireTime", + "Ttl", + "Name", + "Id", + "Type", + "PrimaryProductId", + "CollectionMemberIds", + "Gtin", + "Categories", + "Title", + "Brands", + "Description", + "LanguageCode", + "Attributes", + "Tags", + "PriceInfo", + "Rating", + "AvailableTime", + "Availability", + "AvailableQuantity", + "FulfillmentInfo", + "Uri", + "Images", + "Audience", + "ColorInfo", + "Sizes", + "Materials", + "Patterns", + "Conditions", + "Promotions", + "PublishTime", + "RetrievableFields", + "Variants", + "Expiration", + }); + internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_Product_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + 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.cloud.retail.v2beta.PromotionProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceProto.java new file mode 100644 index 00000000..6ea396e4 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceProto.java @@ -0,0 +1,463 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public final class ProductServiceProto { + private ProductServiceProto() {} + + 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_CreateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CreateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_DeleteProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListProductsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SetInventoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SetInventoryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/retail/v2beta/product_ser" + + "vice.proto\022\032google.cloud.retail.v2beta\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032\'googl" + + "e/cloud/retail/v2beta/common.proto\032.goog" + + "le/cloud/retail/v2beta/import_config.pro" + + "to\032(google/cloud/retail/v2beta/product.p" + + "roto\032#google/longrunning/operations.prot" + + "o\032\033google/protobuf/empty.proto\032 google/p" + + "rotobuf/field_mask.proto\032\037google/protobu" + + "f/timestamp.proto\"\240\001\n\024CreateProductReque" + + "st\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\n\034retail.googl" + + "eapis.com/Branch\0229\n\007product\030\002 \001(\0132#.goog" + + "le.cloud.retail.v2beta.ProductB\003\340A\002\022\027\n\np" + + "roduct_id\030\003 \001(\tB\003\340A\002\"H\n\021GetProductReques" + + "t\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleap" + + "is.com/Product\"\231\001\n\024UpdateProductRequest\022" + + "9\n\007product\030\001 \001(\0132#.google.cloud.retail.v" + + "2beta.ProductB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132" + + "\032.google.protobuf.FieldMask\022\025\n\rallow_mis" + + "sing\030\003 \001(\010\"K\n\024DeleteProductRequest\0223\n\004na" + + "me\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.com/" + + "Product\"\261\001\n\023ListProductsRequest\0224\n\006paren" + + "t\030\001 \001(\tB$\340A\002\372A\036\n\034retail.googleapis.com/B" + + "ranch\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\022\016\n\006filter\030\004 \001(\t\022-\n\tread_mask\030\005 \001(\0132" + + "\032.google.protobuf.FieldMask\"f\n\024ListProdu" + + "ctsResponse\0225\n\010products\030\001 \003(\0132#.google.c" + + "loud.retail.v2beta.Product\022\027\n\017next_page_" + + "token\030\002 \001(\t\"\305\001\n\023SetInventoryRequest\022;\n\ti" + + "nventory\030\001 \001(\0132#.google.cloud.retail.v2b" + + "eta.ProductB\003\340A\002\022,\n\010set_mask\030\002 \001(\0132\032.goo" + + "gle.protobuf.FieldMask\022,\n\010set_time\030\003 \001(\013" + + "2\032.google.protobuf.Timestamp\022\025\n\rallow_mi" + + "ssing\030\004 \001(\010\"\026\n\024SetInventoryMetadata\"\026\n\024S" + + "etInventoryResponse\"\305\001\n\033AddFulfillmentPl" + + "acesRequest\0226\n\007product\030\001 \001(\tB%\340A\002\372A\037\n\035re" + + "tail.googleapis.com/Product\022\021\n\004type\030\002 \001(" + + "\tB\003\340A\002\022\026\n\tplace_ids\030\003 \003(\tB\003\340A\002\022,\n\010add_ti" + + "me\030\004 \001(\0132\032.google.protobuf.Timestamp\022\025\n\r" + + "allow_missing\030\005 \001(\010\"\036\n\034AddFulfillmentPla" + + "cesMetadata\"\036\n\034AddFulfillmentPlacesRespo" + + "nse\"\223\002\n\032AddLocalInventoriesRequest\0226\n\007pr" + + "oduct\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.c" + + "om/Product\022J\n\021local_inventories\030\002 \003(\0132*." + + "google.cloud.retail.v2beta.LocalInventor" + + "yB\003\340A\002\022,\n\010add_mask\030\004 \001(\0132\032.google.protob" + + "uf.FieldMask\022,\n\010add_time\030\005 \001(\0132\032.google." + + "protobuf.Timestamp\022\025\n\rallow_missing\030\006 \001(" + + "\010\"\035\n\033AddLocalInventoriesMetadata\"\035\n\033AddL" + + "ocalInventoriesResponse\"\267\001\n\035RemoveLocalI" + + "nventoriesRequest\0226\n\007product\030\001 \001(\tB%\340A\002\372" + + "A\037\n\035retail.googleapis.com/Product\022\026\n\tpla" + + "ce_ids\030\002 \003(\tB\003\340A\002\022/\n\013remove_time\030\005 \001(\0132\032" + + ".google.protobuf.Timestamp\022\025\n\rallow_miss" + + "ing\030\003 \001(\010\" \n\036RemoveLocalInventoriesMetad" + + "ata\" \n\036RemoveLocalInventoriesResponse\"\313\001" + + "\n\036RemoveFulfillmentPlacesRequest\0226\n\007prod" + + "uct\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.com" + + "/Product\022\021\n\004type\030\002 \001(\tB\003\340A\002\022\026\n\tplace_ids" + + "\030\003 \003(\tB\003\340A\002\022/\n\013remove_time\030\004 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\025\n\rallow_missing\030\005 " + + "\001(\010\"!\n\037RemoveFulfillmentPlacesMetadata\"!" + + "\n\037RemoveFulfillmentPlacesResponse2\306\030\n\016Pr" + + "oductService\022\333\001\n\rCreateProduct\0220.google." + + "cloud.retail.v2beta.CreateProductRequest" + + "\032#.google.cloud.retail.v2beta.Product\"s\202" + + "\323\344\223\002Q\"F/v2beta/{parent=projects/*/locati" + + "ons/*/catalogs/*/branches/*}/products:\007p" + + "roduct\332A\031parent,product,product_id\022\270\001\n\nG" + + "etProduct\022-.google.cloud.retail.v2beta.G" + + "etProductRequest\032#.google.cloud.retail.v" + + "2beta.Product\"V\202\323\344\223\002I\022G/v2beta/{name=pro" + + "jects/*/locations/*/catalogs/*/branches/" + + "*/products/**}\332A\004name\022\312\001\n\014ListProducts\022/" + + ".google.cloud.retail.v2beta.ListProducts" + + "Request\0320.google.cloud.retail.v2beta.Lis" + + "tProductsResponse\"W\202\323\344\223\002H\022F/v2beta/{pare" + + "nt=projects/*/locations/*/catalogs/*/bra" + + "nches/*}/products\332A\006parent\022\336\001\n\rUpdatePro" + + "duct\0220.google.cloud.retail.v2beta.Update" + + "ProductRequest\032#.google.cloud.retail.v2b" + + "eta.Product\"v\202\323\344\223\002Z2O/v2beta/{product.na" + + "me=projects/*/locations/*/catalogs/*/bra" + + "nches/*/products/**}:\007product\332A\023product," + + "update_mask\022\261\001\n\rDeleteProduct\0220.google.c" + + "loud.retail.v2beta.DeleteProductRequest\032" + + "\026.google.protobuf.Empty\"V\202\323\344\223\002I*G/v2beta" + + "/{name=projects/*/locations/*/catalogs/*" + + "/branches/*/products/**}\332A\004name\022\236\002\n\016Impo" + + "rtProducts\0221.google.cloud.retail.v2beta." + + "ImportProductsRequest\032\035.google.longrunni" + + "ng.Operation\"\271\001\202\323\344\223\002R\"M/v2beta/{parent=p" + + "rojects/*/locations/*/catalogs/*/branche" + + "s/*}/products:import:\001*\312A^\n1google.cloud" + + ".retail.v2beta.ImportProductsResponse\022)g" + + "oogle.cloud.retail.v2beta.ImportMetadata" + + "\022\304\002\n\014SetInventory\022/.google.cloud.retail." + + "v2beta.SetInventoryRequest\032\035.google.long" + + "running.Operation\"\343\001\202\323\344\223\002c\"^/v2beta/{inv" + + "entory.name=projects/*/locations/*/catal" + + "ogs/*/branches/*/products/**}:setInvento" + + "ry:\001*\332A\022inventory,set_mask\312Ab\n/google.cl" + + "oud.retail.v2beta.SetInventoryResponse\022/" + + "google.cloud.retail.v2beta.SetInventoryM" + + "etadata\022\332\002\n\024AddFulfillmentPlaces\0227.googl" + + "e.cloud.retail.v2beta.AddFulfillmentPlac" + + "esRequest\032\035.google.longrunning.Operation" + + "\"\351\001\202\323\344\223\002d\"_/v2beta/{product=projects/*/l" + + "ocations/*/catalogs/*/branches/*/product" + + "s/**}:addFulfillmentPlaces:\001*\332A\007product\312" + + "Ar\n7google.cloud.retail.v2beta.AddFulfil" + + "lmentPlacesResponse\0227google.cloud.retail" + + ".v2beta.AddFulfillmentPlacesMetadata\022\351\002\n" + + "\027RemoveFulfillmentPlaces\022:.google.cloud." + + "retail.v2beta.RemoveFulfillmentPlacesReq" + + "uest\032\035.google.longrunning.Operation\"\362\001\202\323" + + "\344\223\002g\"b/v2beta/{product=projects/*/locati" + + "ons/*/catalogs/*/branches/*/products/**}" + + ":removeFulfillmentPlaces:\001*\332A\007product\312Ax" + + "\n:google.cloud.retail.v2beta.RemoveFulfi" + + "llmentPlacesResponse\022:google.cloud.retai" + + "l.v2beta.RemoveFulfillmentPlacesMetadata" + + "\022\325\002\n\023AddLocalInventories\0226.google.cloud." + + "retail.v2beta.AddLocalInventoriesRequest" + + "\032\035.google.longrunning.Operation\"\346\001\202\323\344\223\002c" + + "\"^/v2beta/{product=projects/*/locations/" + + "*/catalogs/*/branches/*/products/**}:add" + + "LocalInventories:\001*\332A\007product\312Ap\n6google" + + ".cloud.retail.v2beta.AddLocalInventories" + + "Response\0226google.cloud.retail.v2beta.Add" + + "LocalInventoriesMetadata\022\344\002\n\026RemoveLocal" + + "Inventories\0229.google.cloud.retail.v2beta" + + ".RemoveLocalInventoriesRequest\032\035.google." + + "longrunning.Operation\"\357\001\202\323\344\223\002f\"a/v2beta/" + + "{product=projects/*/locations/*/catalogs" + + "/*/branches/*/products/**}:removeLocalIn" + + "ventories:\001*\332A\007product\312Av\n9google.cloud." + + "retail.v2beta.RemoveLocalInventoriesResp" + + "onse\0229google.cloud.retail.v2beta.RemoveL" + + "ocalInventoriesMetadata\032I\312A\025retail.googl" + + "eapis.com\322A.https://www.googleapis.com/a" + + "uth/cloud-platformB\334\001\n\036com.google.cloud." + + "retail.v2betaB\023ProductServiceProtoP\001Z@go" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/retail/v2beta;retail\242\002\006RETAIL\252\002\032Google" + + ".Cloud.Retail.V2Beta\312\002\032Google\\Cloud\\Reta" + + "il\\V2beta\352\002\035Google::Cloud::Retail::V2bet" + + "ab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(), + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_CreateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_CreateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CreateProductRequest_descriptor, + new java.lang.String[] { + "Parent", "Product", "ProductId", + }); + internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_GetProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_UpdateProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor, + new java.lang.String[] { + "Product", "UpdateMask", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_DeleteProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_DeleteProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_ListProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "ReadMask", + }); + internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_ListProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListProductsResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", + }); + internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_SetInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor, + new java.lang.String[] { + "Inventory", "SetMask", "SetTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2beta_SetInventoryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesRequest_descriptor, + new java.lang.String[] { + "Product", "Type", "PlaceIds", "AddTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddFulfillmentPlacesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesRequest_descriptor, + new java.lang.String[] { + "Product", "LocalInventories", "AddMask", "AddTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddLocalInventoriesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor, + new java.lang.String[] { + "Product", "PlaceIds", "RemoveTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor, + new java.lang.String[] { + "Product", "Type", "PlaceIds", "RemoveTime", "AllowMissing", + }); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_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.CommonProto.getDescriptor(); + com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(); + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Promotion.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Promotion.java new file mode 100644 index 00000000..cd63327d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Promotion.java @@ -0,0 +1,677 @@ +/* + * 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/promotion.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Promotion information.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Promotion} + */ +public final class Promotion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Promotion) + PromotionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Promotion.newBuilder() to construct. + private Promotion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Promotion() { + promotionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Promotion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Promotion( + 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(); + + promotionId_ = 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.PromotionProto + .internal_static_google_cloud_retail_v2beta_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PromotionProto + .internal_static_google_cloud_retail_v2beta_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Promotion.class, + com.google.cloud.retail.v2beta.Promotion.Builder.class); + } + + public static final int PROMOTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object promotionId_; + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + @java.lang.Override + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + 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(); + promotionId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = 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(promotionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, promotionId_); + } + 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(promotionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, promotionId_); + } + 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.Promotion)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Promotion other = (com.google.cloud.retail.v2beta.Promotion) obj; + + if (!getPromotionId().equals(other.getPromotionId())) 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) + PROMOTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPromotionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Promotion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Promotion 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.Promotion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Promotion 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.Promotion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Promotion 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.Promotion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Promotion 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.Promotion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Promotion 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.Promotion 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.Promotion 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.Promotion 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; + } + /** + * + * + *
+   * Promotion information.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Promotion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Promotion) + com.google.cloud.retail.v2beta.PromotionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PromotionProto + .internal_static_google_cloud_retail_v2beta_Promotion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PromotionProto + .internal_static_google_cloud_retail_v2beta_Promotion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Promotion.class, + com.google.cloud.retail.v2beta.Promotion.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Promotion.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(); + promotionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PromotionProto + .internal_static_google_cloud_retail_v2beta_Promotion_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Promotion getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Promotion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Promotion build() { + com.google.cloud.retail.v2beta.Promotion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Promotion buildPartial() { + com.google.cloud.retail.v2beta.Promotion result = + new com.google.cloud.retail.v2beta.Promotion(this); + result.promotionId_ = promotionId_; + 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.Promotion) { + return mergeFrom((com.google.cloud.retail.v2beta.Promotion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Promotion other) { + if (other == com.google.cloud.retail.v2beta.Promotion.getDefaultInstance()) return this; + if (!other.getPromotionId().isEmpty()) { + promotionId_ = other.promotionId_; + 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.Promotion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Promotion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object promotionId_ = ""; + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + public java.lang.String getPromotionId() { + java.lang.Object ref = promotionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + promotionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + public com.google.protobuf.ByteString getPromotionIdBytes() { + java.lang.Object ref = promotionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + promotionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + promotionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPromotionId() { + + promotionId_ = getDefaultInstance().getPromotionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the promotion. For example, "free gift".
+     * The value must be a UTF-8 encoded string with a length limit of 128
+     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * Google Merchant Center property
+     * [promotion](https://support.google.com/merchants/answer/7050148).
+     * 
+ * + * string promotion_id = 1; + * + * @param value The bytes for promotionId to set. + * @return This builder for chaining. + */ + public Builder setPromotionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + promotionId_ = 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.Promotion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Promotion) + private static final com.google.cloud.retail.v2beta.Promotion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Promotion(); + } + + public static com.google.cloud.retail.v2beta.Promotion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Promotion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Promotion(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.Promotion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionOrBuilder.java new file mode 100644 index 00000000..5776a19f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionOrBuilder.java @@ -0,0 +1,62 @@ +/* + * 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/promotion.proto + +package com.google.cloud.retail.v2beta; + +public interface PromotionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Promotion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The promotionId. + */ + java.lang.String getPromotionId(); + /** + * + * + *
+   * ID of the promotion. For example, "free gift".
+   * The value must be a UTF-8 encoded string with a length limit of 128
+   * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
+   * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * Google Merchant Center property
+   * [promotion](https://support.google.com/merchants/answer/7050148).
+   * 
+ * + * string promotion_id = 1; + * + * @return The bytes for promotionId. + */ + com.google.protobuf.ByteString getPromotionIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionProto.java new file mode 100644 index 00000000..de4a687e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PromotionProto.java @@ -0,0 +1,67 @@ +/* + * 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/promotion.proto + +package com.google.cloud.retail.v2beta; + +public final class PromotionProto { + private PromotionProto() {} + + 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_Promotion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Promotion_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/promotion.p" + + "roto\022\032google.cloud.retail.v2beta\"!\n\tProm" + + "otion\022\024\n\014promotion_id\030\001 \001(\tB\327\001\n\036com.goog" + + "le.cloud.retail.v2betaB\016PromotionProtoP\001" + + "Z@google.golang.org/genproto/googleapis/" + + "cloud/retail/v2beta;retail\242\002\006RETAIL\252\002\032Go" + + "ogle.Cloud.Retail.V2Beta\312\002\032Google\\Cloud\\" + + "Retail\\V2beta\352\002\035Google::Cloud::Retail::V" + + "2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_retail_v2beta_Promotion_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_Promotion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Promotion_descriptor, + new java.lang.String[] { + "PromotionId", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransaction.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransaction.java new file mode 100644 index 00000000..8309ee66 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransaction.java @@ -0,0 +1,1126 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * A transaction represents the entire purchase transaction.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurchaseTransaction} + */ +public final class PurchaseTransaction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PurchaseTransaction) + PurchaseTransactionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurchaseTransaction.newBuilder() to construct. + private PurchaseTransaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurchaseTransaction() { + id_ = ""; + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurchaseTransaction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurchaseTransaction( + 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(); + + id_ = s; + break; + } + case 21: + { + revenue_ = input.readFloat(); + break; + } + case 29: + { + tax_ = input.readFloat(); + break; + } + case 37: + { + cost_ = input.readFloat(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + currencyCode_ = 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.UserEventProto + .internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurchaseTransaction.class, + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVENUE_FIELD_NUMBER = 2; + private float revenue_; + /** + * + * + *
+   * Required. Total non-zero revenue or grand total associated with the
+   * transaction. This value include shipping, tax, or other adjustments to
+   * total revenue that you want to include as part of your revenue
+   * calculations.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + @java.lang.Override + public float getRevenue() { + return revenue_; + } + + public static final int TAX_FIELD_NUMBER = 3; + private float tax_; + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * float tax = 3; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + + public static final int COST_FIELD_NUMBER = 4; + private float cost_; + /** + * + * + *
+   * All the costs associated with the products. These can be manufacturing
+   * costs, shipping expenses not borne by the end user, or any other costs,
+   * such that:
+   * * Profit =
+   * [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] -
+   * [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] -
+   * [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost]
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object currencyCode_; + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (java.lang.Float.floatToRawIntBits(revenue_) != 0) { + output.writeFloat(2, revenue_); + } + if (java.lang.Float.floatToRawIntBits(tax_) != 0) { + output.writeFloat(3, tax_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + output.writeFloat(4, cost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, currencyCode_); + } + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (java.lang.Float.floatToRawIntBits(revenue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, revenue_); + } + if (java.lang.Float.floatToRawIntBits(tax_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, tax_); + } + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, cost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, currencyCode_); + } + 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.PurchaseTransaction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PurchaseTransaction other = + (com.google.cloud.retail.v2beta.PurchaseTransaction) obj; + + if (!getId().equals(other.getId())) return false; + if (java.lang.Float.floatToIntBits(getRevenue()) + != java.lang.Float.floatToIntBits(other.getRevenue())) return false; + if (java.lang.Float.floatToIntBits(getTax()) != java.lang.Float.floatToIntBits(other.getTax())) + return false; + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + REVENUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getRevenue()); + hash = (37 * hash) + TAX_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTax()); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction 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.PurchaseTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction 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.PurchaseTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction 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.PurchaseTransaction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction 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.PurchaseTransaction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction 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.PurchaseTransaction 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.PurchaseTransaction 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.PurchaseTransaction 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; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurchaseTransaction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PurchaseTransaction) + com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_PurchaseTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurchaseTransaction.class, + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PurchaseTransaction.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(); + id_ = ""; + + revenue_ = 0F; + + tax_ = 0F; + + cost_ = 0F; + + currencyCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurchaseTransaction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PurchaseTransaction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurchaseTransaction build() { + com.google.cloud.retail.v2beta.PurchaseTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurchaseTransaction buildPartial() { + com.google.cloud.retail.v2beta.PurchaseTransaction result = + new com.google.cloud.retail.v2beta.PurchaseTransaction(this); + result.id_ = id_; + result.revenue_ = revenue_; + result.tax_ = tax_; + result.cost_ = cost_; + result.currencyCode_ = currencyCode_; + 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.PurchaseTransaction) { + return mergeFrom((com.google.cloud.retail.v2beta.PurchaseTransaction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PurchaseTransaction other) { + if (other == com.google.cloud.retail.v2beta.PurchaseTransaction.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.getRevenue() != 0F) { + setRevenue(other.getRevenue()); + } + if (other.getTax() != 0F) { + setTax(other.getTax()); + } + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + 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.PurchaseTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.PurchaseTransaction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private float revenue_; + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + @java.lang.Override + public float getRevenue() { + return revenue_; + } + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The revenue to set. + * @return This builder for chaining. + */ + public Builder setRevenue(float value) { + + revenue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Total non-zero revenue or grand total associated with the
+     * transaction. This value include shipping, tax, or other adjustments to
+     * total revenue that you want to include as part of your revenue
+     * calculations.
+     * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRevenue() { + + revenue_ = 0F; + onChanged(); + return this; + } + + private float tax_; + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @param value The tax to set. + * @return This builder for chaining. + */ + public Builder setTax(float value) { + + tax_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * float tax = 3; + * + * @return This builder for chaining. + */ + public Builder clearTax() { + + tax_ = 0F; + onChanged(); + return this; + } + + private float cost_; + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * All the costs associated with the products. These can be manufacturing
+     * costs, shipping expenses not borne by the end user, or any other costs,
+     * such that:
+     * * Profit =
+     * [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] -
+     * [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] -
+     * [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost]
+     * 
+ * + * float cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + + cost_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currencyCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + + currencyCode_ = getDefaultInstance().getCurrencyCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currencyCode_ = 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.PurchaseTransaction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PurchaseTransaction) + private static final com.google.cloud.retail.v2beta.PurchaseTransaction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PurchaseTransaction(); + } + + public static com.google.cloud.retail.v2beta.PurchaseTransaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurchaseTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurchaseTransaction(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.PurchaseTransaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransactionOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransactionOrBuilder.java new file mode 100644 index 00000000..4dc9d8a4 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurchaseTransactionOrBuilder.java @@ -0,0 +1,123 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +public interface PurchaseTransactionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PurchaseTransaction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. Total non-zero revenue or grand total associated with the
+   * transaction. This value include shipping, tax, or other adjustments to
+   * total revenue that you want to include as part of your revenue
+   * calculations.
+   * 
+ * + * float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revenue. + */ + float getRevenue(); + + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * float tax = 3; + * + * @return The tax. + */ + float getTax(); + + /** + * + * + *
+   * All the costs associated with the products. These can be manufacturing
+   * costs, shipping expenses not borne by the end user, or any other costs,
+   * such that:
+   * * Profit =
+   * [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] -
+   * [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] -
+   * [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost]
+   * 
+ * + * float cost = 4; + * + * @return The cost. + */ + float getCost(); + + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency_code = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeConfigProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeConfigProto.java new file mode 100644 index 00000000..75859d85 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeConfigProto.java @@ -0,0 +1,104 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +public final class PurgeConfigProto { + private PurgeConfigProto() {} + + 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_PurgeMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PurgeMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_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/purge_confi" + + "g.proto\022\032google.cloud.retail.v2beta\032\037goo" + + "gle/api/field_behavior.proto\032\031google/api" + + "/resource.proto\"\017\n\rPurgeMetadata\"Q\n\026Purg" + + "eUserEventsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022" + + "\023\n\006filter\030\002 \001(\tB\003\340A\002\022\r\n\005force\030\003 \001(\010\"6\n\027P" + + "urgeUserEventsResponse\022\033\n\023purged_events_" + + "count\030\001 \001(\003B\331\001\n\036com.google.cloud.retail." + + "v2betaB\020PurgeConfigProtoP\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( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_PurgeMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_PurgeMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PurgeMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor, + new java.lang.String[] { + "PurgedEventsCount", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadata.java new file mode 100644 index 00000000..8d8fe990 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadata.java @@ -0,0 +1,458 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the Purge operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeMetadata} + */ +public final class PurgeMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PurgeMetadata) + PurgeMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeMetadata.newBuilder() to construct. + private PurgeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeMetadata( + 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.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeMetadata.class, + com.google.cloud.retail.v2beta.PurgeMetadata.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.PurgeMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PurgeMetadata other = + (com.google.cloud.retail.v2beta.PurgeMetadata) 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.PurgeMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata 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.PurgeMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata 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.PurgeMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata 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.PurgeMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata 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.PurgeMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata 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.PurgeMetadata 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.PurgeMetadata 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.PurgeMetadata 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 related to the progress of the Purge operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PurgeMetadata) + com.google.cloud.retail.v2beta.PurgeMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeMetadata.class, + com.google.cloud.retail.v2beta.PurgeMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PurgeMetadata.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.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PurgeMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeMetadata build() { + com.google.cloud.retail.v2beta.PurgeMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeMetadata buildPartial() { + com.google.cloud.retail.v2beta.PurgeMetadata result = + new com.google.cloud.retail.v2beta.PurgeMetadata(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.PurgeMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.PurgeMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PurgeMetadata other) { + if (other == com.google.cloud.retail.v2beta.PurgeMetadata.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.PurgeMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.PurgeMetadata) 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.PurgeMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PurgeMetadata) + private static final com.google.cloud.retail.v2beta.PurgeMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PurgeMetadata(); + } + + public static com.google.cloud.retail.v2beta.PurgeMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeMetadata(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.PurgeMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadataOrBuilder.java new file mode 100644 index 00000000..74398e6b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeMetadataOrBuilder.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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +public interface PurgeMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PurgeMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequest.java new file mode 100644 index 00000000..555a4cd8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequest.java @@ -0,0 +1,1063 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for PurgeUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeUserEventsRequest} + */ +public final class PurgeUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PurgeUserEventsRequest) + PurgeUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsRequest.newBuilder() to construct. + private PurgeUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + force_ = 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.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest.class, + com.google.cloud.retail.v2beta.PurgeUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any user events.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (force_ != false) { + output.writeBool(3, force_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } + 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.PurgeUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PurgeUserEventsRequest other = + (com.google.cloud.retail.v2beta.PurgeUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest 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.PurgeUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest 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.PurgeUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest 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.PurgeUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest 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.PurgeUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest 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.PurgeUserEventsRequest 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.PurgeUserEventsRequest 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.PurgeUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for PurgeUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PurgeUserEventsRequest) + com.google.cloud.retail.v2beta.PurgeUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeUserEventsRequest.class, + com.google.cloud.retail.v2beta.PurgeUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PurgeUserEventsRequest.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_ = ""; + + filter_ = ""; + + force_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PurgeUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsRequest build() { + com.google.cloud.retail.v2beta.PurgeUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsRequest buildPartial() { + com.google.cloud.retail.v2beta.PurgeUserEventsRequest result = + new com.google.cloud.retail.v2beta.PurgeUserEventsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.force_ = force_; + 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.PurgeUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.PurgeUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PurgeUserEventsRequest other) { + if (other == com.google.cloud.retail.v2beta.PurgeUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.PurgeUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.PurgeUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. Empty string filter is not allowed. The
+     * eligible fields for filtering are:
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `visitorId`: Double quoted string. Specifying this will delete all
+     *   events associated with a visitor.
+     * * `userId`: Double quoted string. Specifying this will delete all events
+     *   associated with a user.
+     * Examples:
+     * * Deleting all events in a time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z"
+     *   eventTime < "2012-04-23T18:30:43.511Z"`
+     * * Deleting specific eventType in time range:
+     *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+     * * Deleting all events for a specific visitor:
+     *   `visitorId = "visitor1024"`
+     * The filtering fields are assumed to have an implicit AND.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Actually perform the purge.
+     * If `force` is set to false, the method will return the expected purge count
+     * without deleting any user events.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = 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.PurgeUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PurgeUserEventsRequest) + private static final com.google.cloud.retail.v2beta.PurgeUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PurgeUserEventsRequest(); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsRequest(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.PurgeUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..83e70048 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +public interface PurgeUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PurgeUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/catalogs/${catalogId}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. The filter string to specify the events to be deleted with a
+   * length limit of 5,000 characters. Empty string filter is not allowed. The
+   * eligible fields for filtering are:
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `visitorId`: Double quoted string. Specifying this will delete all
+   *   events associated with a visitor.
+   * * `userId`: Double quoted string. Specifying this will delete all events
+   *   associated with a user.
+   * Examples:
+   * * Deleting all events in a time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z"
+   *   eventTime < "2012-04-23T18:30:43.511Z"`
+   * * Deleting specific eventType in time range:
+   *   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
+   * * Deleting all events for a specific visitor:
+   *   `visitorId = "visitor1024"`
+   * The filtering fields are assumed to have an implicit AND.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Actually perform the purge.
+   * If `force` is set to false, the method will return the expected purge count
+   * without deleting any user events.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponse.java new file mode 100644 index 00000000..4c6f6318 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponse.java @@ -0,0 +1,553 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the PurgeUserEventsRequest. If the long running operation is
+ * successfully done, then this message is returned by the
+ * google.longrunning.Operations.response field.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeUserEventsResponse} + */ +public final class PurgeUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PurgeUserEventsResponse) + PurgeUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsResponse.newBuilder() to construct. + private PurgeUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PurgeUserEventsResponse( + 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 8: + { + purgedEventsCount_ = input.readInt64(); + 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.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeUserEventsResponse.class, + com.google.cloud.retail.v2beta.PurgeUserEventsResponse.Builder.class); + } + + public static final int PURGED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long purgedEventsCount_; + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + @java.lang.Override + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + + 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 (purgedEventsCount_ != 0L) { + output.writeInt64(1, purgedEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (purgedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, purgedEventsCount_); + } + 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.PurgeUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PurgeUserEventsResponse other = + (com.google.cloud.retail.v2beta.PurgeUserEventsResponse) obj; + + if (getPurgedEventsCount() != other.getPurgedEventsCount()) 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) + PURGED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPurgedEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse 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.PurgeUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse 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.PurgeUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse 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.PurgeUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse 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.PurgeUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse 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.PurgeUserEventsResponse 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.PurgeUserEventsResponse 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.PurgeUserEventsResponse 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 PurgeUserEventsRequest. If the long running operation is
+   * successfully done, then this message is returned by the
+   * google.longrunning.Operations.response field.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PurgeUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PurgeUserEventsResponse) + com.google.cloud.retail.v2beta.PurgeUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PurgeUserEventsResponse.class, + com.google.cloud.retail.v2beta.PurgeUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PurgeUserEventsResponse.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(); + purgedEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.PurgeConfigProto + .internal_static_google_cloud_retail_v2beta_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PurgeUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsResponse build() { + com.google.cloud.retail.v2beta.PurgeUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PurgeUserEventsResponse buildPartial() { + com.google.cloud.retail.v2beta.PurgeUserEventsResponse result = + new com.google.cloud.retail.v2beta.PurgeUserEventsResponse(this); + result.purgedEventsCount_ = purgedEventsCount_; + 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.PurgeUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.PurgeUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PurgeUserEventsResponse other) { + if (other == com.google.cloud.retail.v2beta.PurgeUserEventsResponse.getDefaultInstance()) + return this; + if (other.getPurgedEventsCount() != 0L) { + setPurgedEventsCount(other.getPurgedEventsCount()); + } + 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.PurgeUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.PurgeUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long purgedEventsCount_; + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + @java.lang.Override + public long getPurgedEventsCount() { + return purgedEventsCount_; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @param value The purgedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setPurgedEventsCount(long value) { + + purgedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purged_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgedEventsCount() { + + purgedEventsCount_ = 0L; + 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.PurgeUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PurgeUserEventsResponse) + private static final com.google.cloud.retail.v2beta.PurgeUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PurgeUserEventsResponse(); + } + + public static com.google.cloud.retail.v2beta.PurgeUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PurgeUserEventsResponse(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.PurgeUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..5d6b417f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PurgeUserEventsResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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/purge_config.proto + +package com.google.cloud.retail.v2beta; + +public interface PurgeUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PurgeUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purged_events_count = 1; + * + * @return The purgedEventsCount. + */ + long getPurgedEventsCount(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rating.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rating.java new file mode 100644 index 00000000..c376ff40 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rating.java @@ -0,0 +1,955 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The rating of a [Product][google.cloud.retail.v2beta.Product].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rating} + */ +public final class Rating extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rating) + RatingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rating.newBuilder() to construct. + private Rating(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rating() { + ratingHistogram_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rating(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rating( + 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 8: + { + ratingCount_ = input.readInt32(); + break; + } + case 21: + { + averageRating_ = input.readFloat(); + break; + } + case 24: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + ratingHistogram_.addInt(input.readInt32()); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + ratingHistogram_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + ratingHistogram_.addInt(input.readInt32()); + } + input.popLimit(limit); + 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)) { + ratingHistogram_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rating.class, + com.google.cloud.retail.v2beta.Rating.Builder.class); + } + + public static final int RATING_COUNT_FIELD_NUMBER = 1; + private int ratingCount_; + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + + public static final int AVERAGE_RATING_FIELD_NUMBER = 2; + private float averageRating_; + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2beta.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + + public static final int RATING_HISTOGRAM_FIELD_NUMBER = 3; + private com.google.protobuf.Internal.IntList ratingHistogram_; + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + @java.lang.Override + public java.util.List getRatingHistogramList() { + return ratingHistogram_; + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + + private int ratingHistogramMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (ratingCount_ != 0) { + output.writeInt32(1, ratingCount_); + } + if (java.lang.Float.floatToRawIntBits(averageRating_) != 0) { + output.writeFloat(2, averageRating_); + } + if (getRatingHistogramList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(ratingHistogramMemoizedSerializedSize); + } + for (int i = 0; i < ratingHistogram_.size(); i++) { + output.writeInt32NoTag(ratingHistogram_.getInt(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ratingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, ratingCount_); + } + if (java.lang.Float.floatToRawIntBits(averageRating_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, averageRating_); + } + { + int dataSize = 0; + for (int i = 0; i < ratingHistogram_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(ratingHistogram_.getInt(i)); + } + size += dataSize; + if (!getRatingHistogramList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + ratingHistogramMemoizedSerializedSize = dataSize; + } + 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.Rating)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rating other = (com.google.cloud.retail.v2beta.Rating) obj; + + if (getRatingCount() != other.getRatingCount()) return false; + if (java.lang.Float.floatToIntBits(getAverageRating()) + != java.lang.Float.floatToIntBits(other.getAverageRating())) return false; + if (!getRatingHistogramList().equals(other.getRatingHistogramList())) 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) + RATING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getRatingCount(); + hash = (37 * hash) + AVERAGE_RATING_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getAverageRating()); + if (getRatingHistogramCount() > 0) { + hash = (37 * hash) + RATING_HISTOGRAM_FIELD_NUMBER; + hash = (53 * hash) + getRatingHistogramList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rating parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rating 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.Rating parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rating 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.Rating parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rating 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.Rating parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rating 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.Rating parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rating 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.Rating 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.Rating 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.Rating prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The rating of a [Product][google.cloud.retail.v2beta.Product].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rating} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rating) + com.google.cloud.retail.v2beta.RatingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rating.class, + com.google.cloud.retail.v2beta.Rating.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rating.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(); + ratingCount_ = 0; + + averageRating_ = 0F; + + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rating_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rating getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rating.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rating build() { + com.google.cloud.retail.v2beta.Rating result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rating buildPartial() { + com.google.cloud.retail.v2beta.Rating result = + new com.google.cloud.retail.v2beta.Rating(this); + int from_bitField0_ = bitField0_; + result.ratingCount_ = ratingCount_; + result.averageRating_ = averageRating_; + if (((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ratingHistogram_ = ratingHistogram_; + 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.Rating) { + return mergeFrom((com.google.cloud.retail.v2beta.Rating) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rating other) { + if (other == com.google.cloud.retail.v2beta.Rating.getDefaultInstance()) return this; + if (other.getRatingCount() != 0) { + setRatingCount(other.getRatingCount()); + } + if (other.getAverageRating() != 0F) { + setAverageRating(other.getAverageRating()); + } + if (!other.ratingHistogram_.isEmpty()) { + if (ratingHistogram_.isEmpty()) { + ratingHistogram_ = other.ratingHistogram_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addAll(other.ratingHistogram_); + } + 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.Rating parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Rating) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int ratingCount_; + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + @java.lang.Override + public int getRatingCount() { + return ratingCount_; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @param value The ratingCount to set. + * @return This builder for chaining. + */ + public Builder setRatingCount(int value) { + + ratingCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of ratings. This value is independent of the value of
+     * [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].
+     * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * int32 rating_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRatingCount() { + + ratingCount_ = 0; + onChanged(); + return this; + } + + private float averageRating_; + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2beta.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + @java.lang.Override + public float getAverageRating() { + return averageRating_; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2beta.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @param value The averageRating to set. + * @return This builder for chaining. + */ + public Builder setAverageRating(float value) { + + averageRating_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The average rating of the [Product][google.cloud.retail.v2beta.Product].
+     * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+     * returned.
+     * 
+ * + * float average_rating = 2; + * + * @return This builder for chaining. + */ + public Builder clearAverageRating() { + + averageRating_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList ratingHistogram_ = emptyIntList(); + + private void ensureRatingHistogramIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ratingHistogram_ = mutableCopy(ratingHistogram_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + public java.util.List getRatingHistogramList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(ratingHistogram_) + : ratingHistogram_; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + public int getRatingHistogramCount() { + return ratingHistogram_.size(); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + public int getRatingHistogram(int index) { + return ratingHistogram_.getInt(index); + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index to set the value at. + * @param value The ratingHistogram to set. + * @return This builder for chaining. + */ + public Builder setRatingHistogram(int index, int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param value The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addRatingHistogram(int value) { + ensureRatingHistogramIsMutable(); + ratingHistogram_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param values The ratingHistogram to add. + * @return This builder for chaining. + */ + public Builder addAllRatingHistogram(java.lang.Iterable values) { + ensureRatingHistogramIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ratingHistogram_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of rating counts per rating value (index = rating - 1). The list is
+     * empty if there is no rating. If the list is non-empty, its size is
+     * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+     * For example, [41, 14, 13, 47, 303]. It means that the
+     * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+     * 14 ratings with 2 star, and so on.
+     * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return This builder for chaining. + */ + public Builder clearRatingHistogram() { + ratingHistogram_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.Rating) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rating) + private static final com.google.cloud.retail.v2beta.Rating DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rating(); + } + + public static com.google.cloud.retail.v2beta.Rating getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rating parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rating(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.Rating getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RatingOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RatingOrBuilder.java new file mode 100644 index 00000000..6384cfe2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RatingOrBuilder.java @@ -0,0 +1,109 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface RatingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rating) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of ratings. This value is independent of the value of
+   * [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].
+   * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * int32 rating_count = 1; + * + * @return The ratingCount. + */ + int getRatingCount(); + + /** + * + * + *
+   * The average rating of the [Product][google.cloud.retail.v2beta.Product].
+   * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
+   * returned.
+   * 
+ * + * float average_rating = 2; + * + * @return The averageRating. + */ + float getAverageRating(); + + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return A list containing the ratingHistogram. + */ + java.util.List getRatingHistogramList(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @return The count of ratingHistogram. + */ + int getRatingHistogramCount(); + /** + * + * + *
+   * List of rating counts per rating value (index = rating - 1). The list is
+   * empty if there is no rating. If the list is non-empty, its size is
+   * always 5. Otherwise, an INVALID_ARGUMENT error is returned.
+   * For example, [41, 14, 13, 47, 303]. It means that the
+   * [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star,
+   * 14 ratings with 2 star, and so on.
+   * 
+ * + * repeated int32 rating_histogram = 3; + * + * @param index The index of the element to return. + * @return The ratingHistogram at the given index. + */ + int getRatingHistogram(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java new file mode 100644 index 00000000..52e8a15c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java @@ -0,0 +1,459 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsMetadata} + */ +public final class RejoinUserEventsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RejoinUserEventsMetadata) + RejoinUserEventsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsMetadata.newBuilder() to construct. + private RejoinUserEventsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsMetadata( + 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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.class, + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.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.RejoinUserEventsMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata other = + (com.google.cloud.retail.v2beta.RejoinUserEventsMetadata) 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.RejoinUserEventsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata 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.RejoinUserEventsMetadata 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 for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RejoinUserEventsMetadata) + com.google.cloud.retail.v2beta.RejoinUserEventsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.class, + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsMetadata build() { + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsMetadata buildPartial() { + com.google.cloud.retail.v2beta.RejoinUserEventsMetadata result = + new com.google.cloud.retail.v2beta.RejoinUserEventsMetadata(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.RejoinUserEventsMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.RejoinUserEventsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RejoinUserEventsMetadata other) { + if (other == com.google.cloud.retail.v2beta.RejoinUserEventsMetadata.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.RejoinUserEventsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RejoinUserEventsMetadata) 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.RejoinUserEventsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RejoinUserEventsMetadata) + private static final com.google.cloud.retail.v2beta.RejoinUserEventsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RejoinUserEventsMetadata(); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsMetadata(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.RejoinUserEventsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadataOrBuilder.java new file mode 100644 index 00000000..b3940cec --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadataOrBuilder.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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RejoinUserEventsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RejoinUserEventsMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java new file mode 100644 index 00000000..f7170b6f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java @@ -0,0 +1,1016 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsRequest} + */ +public final class RejoinUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RejoinUserEventsRequest) + RejoinUserEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsRequest.newBuilder() to construct. + private RejoinUserEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsRequest() { + parent_ = ""; + userEventRejoinScope_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsRequest( + 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: + { + int rawValue = input.readEnum(); + + userEventRejoinScope_ = rawValue; + 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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.class, + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.Builder.class); + } + + /** + * + * + *
+   * 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.
+   * 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.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope} + */ + public enum UserEventRejoinScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Rejoin all events with the latest product catalog, including both joined
+     * events and unjoined events.
+     * 
+ * + * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + */ + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Only rejoin joined events with the latest product catalog.
+     * 
+ * + * JOINED_EVENTS = 1; + */ + JOINED_EVENTS(1), + /** + * + * + *
+     * Only rejoin unjoined events with the latest product catalog.
+     * 
+ * + * UNJOINED_EVENTS = 2; + */ + UNJOINED_EVENTS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Rejoin all events with the latest product catalog, including both joined
+     * events and unjoined events.
+     * 
+ * + * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + */ + public static final int USER_EVENT_REJOIN_SCOPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Only rejoin joined events with the latest product catalog.
+     * 
+ * + * JOINED_EVENTS = 1; + */ + public static final int JOINED_EVENTS_VALUE = 1; + /** + * + * + *
+     * Only rejoin unjoined events with the latest product catalog.
+     * 
+ * + * UNJOINED_EVENTS = 2; + */ + public static final int UNJOINED_EVENTS_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 UserEventRejoinScope 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 UserEventRejoinScope forNumber(int value) { + switch (value) { + case 0: + return USER_EVENT_REJOIN_SCOPE_UNSPECIFIED; + case 1: + return JOINED_EVENTS; + case 2: + return UNJOINED_EVENTS; + 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 UserEventRejoinScope findValueByNumber(int number) { + return UserEventRejoinScope.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.RejoinUserEventsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final UserEventRejoinScope[] VALUES = values(); + + public static UserEventRejoinScope 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 UserEventRejoinScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope) + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_REJOIN_SCOPE_FIELD_NUMBER = 2; + private int userEventRejoinScope_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + @java.lang.Override + public int getUserEventRejoinScopeValue() { + return userEventRejoinScope_; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope result = + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope.valueOf( + userEventRejoinScope_); + return result == null + ? com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope.UNRECOGNIZED + : result; + } + + 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 (userEventRejoinScope_ + != com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope + .USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, userEventRejoinScope_); + } + 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 (userEventRejoinScope_ + != com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope + .USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, userEventRejoinScope_); + } + 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.RejoinUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RejoinUserEventsRequest other = + (com.google.cloud.retail.v2beta.RejoinUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (userEventRejoinScope_ != other.userEventRejoinScope_) 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) + USER_EVENT_REJOIN_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + userEventRejoinScope_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest 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.RejoinUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest 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.RejoinUserEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest 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.RejoinUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest 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.RejoinUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest 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.RejoinUserEventsRequest 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.RejoinUserEventsRequest 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.RejoinUserEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RejoinUserEventsRequest) + com.google.cloud.retail.v2beta.RejoinUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.class, + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RejoinUserEventsRequest.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_ = ""; + + userEventRejoinScope_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RejoinUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsRequest build() { + com.google.cloud.retail.v2beta.RejoinUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsRequest buildPartial() { + com.google.cloud.retail.v2beta.RejoinUserEventsRequest result = + new com.google.cloud.retail.v2beta.RejoinUserEventsRequest(this); + result.parent_ = parent_; + result.userEventRejoinScope_ = userEventRejoinScope_; + 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.RejoinUserEventsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.RejoinUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RejoinUserEventsRequest other) { + if (other == com.google.cloud.retail.v2beta.RejoinUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.userEventRejoinScope_ != 0) { + setUserEventRejoinScopeValue(other.getUserEventRejoinScopeValue()); + } + 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.RejoinUserEventsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RejoinUserEventsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 userEventRejoinScope_ = 0; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + @java.lang.Override + public int getUserEventRejoinScopeValue() { + return userEventRejoinScope_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @param value The enum numeric value on the wire for userEventRejoinScope to set. + * @return This builder for chaining. + */ + public Builder setUserEventRejoinScopeValue(int value) { + + userEventRejoinScope_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope result = + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope.valueOf( + userEventRejoinScope_); + return result == null + ? com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @param value The userEventRejoinScope to set. + * @return This builder for chaining. + */ + public Builder setUserEventRejoinScope( + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope value) { + if (value == null) { + throw new NullPointerException(); + } + + userEventRejoinScope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearUserEventRejoinScope() { + + userEventRejoinScope_ = 0; + 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.RejoinUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RejoinUserEventsRequest) + private static final com.google.cloud.retail.v2beta.RejoinUserEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RejoinUserEventsRequest(); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsRequest(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.RejoinUserEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java new file mode 100644 index 00000000..a130669c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RejoinUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RejoinUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The enum numeric value on the wire for userEventRejoinScope. + */ + 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.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope user_event_rejoin_scope = 2; + * + * + * @return The userEventRejoinScope. + */ + com.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope + getUserEventRejoinScope(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java new file mode 100644 index 00000000..4267ed3c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java @@ -0,0 +1,549 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response message for RejoinUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsResponse} + */ +public final class RejoinUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RejoinUserEventsResponse) + RejoinUserEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RejoinUserEventsResponse.newBuilder() to construct. + private RejoinUserEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RejoinUserEventsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RejoinUserEventsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RejoinUserEventsResponse( + 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 8: + { + rejoinedUserEventsCount_ = input.readInt64(); + 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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsResponse.class, + com.google.cloud.retail.v2beta.RejoinUserEventsResponse.Builder.class); + } + + public static final int REJOINED_USER_EVENTS_COUNT_FIELD_NUMBER = 1; + private long rejoinedUserEventsCount_; + /** + * + * + *
+   * Number of user events that were joined with latest product catalog.
+   * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + @java.lang.Override + public long getRejoinedUserEventsCount() { + return rejoinedUserEventsCount_; + } + + 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 (rejoinedUserEventsCount_ != 0L) { + output.writeInt64(1, rejoinedUserEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rejoinedUserEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rejoinedUserEventsCount_); + } + 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.RejoinUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RejoinUserEventsResponse other = + (com.google.cloud.retail.v2beta.RejoinUserEventsResponse) obj; + + if (getRejoinedUserEventsCount() != other.getRejoinedUserEventsCount()) 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) + REJOINED_USER_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRejoinedUserEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse 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.RejoinUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse 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.RejoinUserEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse 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.RejoinUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse 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.RejoinUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse 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.RejoinUserEventsResponse 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.RejoinUserEventsResponse 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.RejoinUserEventsResponse 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 message for RejoinUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RejoinUserEventsResponse) + com.google.cloud.retail.v2beta.RejoinUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RejoinUserEventsResponse.class, + com.google.cloud.retail.v2beta.RejoinUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RejoinUserEventsResponse.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(); + rejoinedUserEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RejoinUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsResponse build() { + com.google.cloud.retail.v2beta.RejoinUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RejoinUserEventsResponse buildPartial() { + com.google.cloud.retail.v2beta.RejoinUserEventsResponse result = + new com.google.cloud.retail.v2beta.RejoinUserEventsResponse(this); + result.rejoinedUserEventsCount_ = rejoinedUserEventsCount_; + 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.RejoinUserEventsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.RejoinUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RejoinUserEventsResponse other) { + if (other == com.google.cloud.retail.v2beta.RejoinUserEventsResponse.getDefaultInstance()) + return this; + if (other.getRejoinedUserEventsCount() != 0L) { + setRejoinedUserEventsCount(other.getRejoinedUserEventsCount()); + } + 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.RejoinUserEventsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RejoinUserEventsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long rejoinedUserEventsCount_; + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + @java.lang.Override + public long getRejoinedUserEventsCount() { + return rejoinedUserEventsCount_; + } + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @param value The rejoinedUserEventsCount to set. + * @return This builder for chaining. + */ + public Builder setRejoinedUserEventsCount(long value) { + + rejoinedUserEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of user events that were joined with latest product catalog.
+     * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRejoinedUserEventsCount() { + + rejoinedUserEventsCount_ = 0L; + 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.RejoinUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RejoinUserEventsResponse) + private static final com.google.cloud.retail.v2beta.RejoinUserEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RejoinUserEventsResponse(); + } + + public static com.google.cloud.retail.v2beta.RejoinUserEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RejoinUserEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RejoinUserEventsResponse(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.RejoinUserEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponseOrBuilder.java new file mode 100644 index 00000000..bd932d2e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RejoinUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RejoinUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of user events that were joined with latest product catalog.
+   * 
+ * + * int64 rejoined_user_events_count = 1; + * + * @return The rejoinedUserEventsCount. + */ + long getRejoinedUserEventsCount(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequest.java new file mode 100644 index 00000000..e6d1fc07 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequest.java @@ -0,0 +1,853 @@ +/* + * 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.RemoveCatalogAttribute][google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} + */ +public final class RemoveCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) + RemoveCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveCatalogAttributeRequest.newBuilder() to construct. + private RemoveCatalogAttributeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveCatalogAttributeRequest() { + attributesConfig_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = 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(attributesConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributesConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + 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.RemoveCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest other = + (com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (!getKey().equals(other.getKey())) 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(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest 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.RemoveCatalogAttributeRequest 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.RemoveCatalogAttribute][google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.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_ = ""; + + key_ = ""; + + 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_RemoveCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest build() { + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest result = + new com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + result.key_ = key_; + 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.RemoveCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest other) { + if (other + == com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + 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.RemoveCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 java.lang.Object key_ = ""; + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name key of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = 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.RemoveCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) + private static final com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveCatalogAttributeRequest(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.RemoveCatalogAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..50bf0b83 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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 RemoveCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 key of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Required. The attribute name key of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java new file mode 100644 index 00000000..3f477160 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java @@ -0,0 +1,845 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for RemoveControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveControlRequest} + */ +public final class RemoveControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveControlRequest) + RemoveControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveControlRequest.newBuilder() to construct. + private RemoveControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveControlRequest() { + servingConfig_ = ""; + controlId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveControlRequest( + 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(); + + servingConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + controlId_ = 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveControlRequest.class, + com.google.cloud.retail.v2beta.RemoveControlRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object servingConfig_; + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTROL_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object controlId_; + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + @java.lang.Override + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + 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(); + controlId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = 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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, controlId_); + } + 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(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(controlId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, controlId_); + } + 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.RemoveControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveControlRequest other = + (com.google.cloud.retail.v2beta.RemoveControlRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getControlId().equals(other.getControlId())) 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) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + CONTROL_ID_FIELD_NUMBER; + hash = (53 * hash) + getControlId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest 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.RemoveControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest 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.RemoveControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest 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.RemoveControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest 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.RemoveControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest 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.RemoveControlRequest 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.RemoveControlRequest 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.RemoveControlRequest 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 RemoveControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveControlRequest) + com.google.cloud.retail.v2beta.RemoveControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveControlRequest.class, + com.google.cloud.retail.v2beta.RemoveControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveControlRequest.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(); + servingConfig_ = ""; + + controlId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveControlRequest build() { + com.google.cloud.retail.v2beta.RemoveControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveControlRequest buildPartial() { + com.google.cloud.retail.v2beta.RemoveControlRequest result = + new com.google.cloud.retail.v2beta.RemoveControlRequest(this); + result.servingConfig_ = servingConfig_; + result.controlId_ = controlId_; + 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.RemoveControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveControlRequest other) { + if (other == com.google.cloud.retail.v2beta.RemoveControlRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + onChanged(); + } + if (!other.getControlId().isEmpty()) { + controlId_ = other.controlId_; + 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.RemoveControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + + servingConfig_ = getDefaultInstance().getServingConfig(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The source ServingConfig resource name . Format:
+     * 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) = { ... } + * + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingConfig_ = value; + onChanged(); + return this; + } + + private java.lang.Object controlId_ = ""; + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + public java.lang.String getControlId() { + java.lang.Object ref = controlId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + controlId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + public com.google.protobuf.ByteString getControlIdBytes() { + java.lang.Object ref = controlId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + controlId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The controlId to set. + * @return This builder for chaining. + */ + public Builder setControlId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + controlId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearControlId() { + + controlId_ = getDefaultInstance().getControlId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the control to apply. Assumed to be in the same catalog
+     * as the serving config.
+     * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for controlId to set. + * @return This builder for chaining. + */ + public Builder setControlIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + controlId_ = 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.RemoveControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveControlRequest) + private static final com.google.cloud.retail.v2beta.RemoveControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveControlRequest(); + } + + public static com.google.cloud.retail.v2beta.RemoveControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveControlRequest(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.RemoveControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java new file mode 100644 index 00000000..524f449b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. The source ServingConfig resource name . Format:
+   * 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) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The controlId. + */ + java.lang.String getControlId(); + /** + * + * + *
+   * Required. The id of the control to apply. Assumed to be in the same catalog
+   * as the serving config.
+   * 
+ * + * string control_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for controlId. + */ + com.google.protobuf.ByteString getControlIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadata.java new file mode 100644 index 00000000..0d97cc11 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadata.java @@ -0,0 +1,470 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the RemoveFulfillmentPlaces operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} + */ +public final class RemoveFulfillmentPlacesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + RemoveFulfillmentPlacesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesMetadata.newBuilder() to construct. + private RemoveFulfillmentPlacesMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesMetadata( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.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.RemoveFulfillmentPlacesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata other = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) 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.RemoveFulfillmentPlacesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata 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.RemoveFulfillmentPlacesMetadata 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 related to the progress of the RemoveFulfillmentPlaces operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata build() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata buildPartial() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata result = + new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata(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.RemoveFulfillmentPlacesMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata other) { + if (other + == com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata.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.RemoveFulfillmentPlacesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + 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.RemoveFulfillmentPlacesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + private static final com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata(); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesMetadata(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.RemoveFulfillmentPlacesMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadataOrBuilder.java new file mode 100644 index 00000000..04e1bada --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesMetadataOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveFulfillmentPlacesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequest.java new file mode 100644 index 00000000..99163fa0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequest.java @@ -0,0 +1,1760 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [RemoveFulfillmentPlaces][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} + */ +public final class RemoveFulfillmentPlacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + RemoveFulfillmentPlacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesRequest.newBuilder() to construct. + private RemoveFulfillmentPlacesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesRequest() { + product_ = ""; + type_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (removeTime_ != null) { + subBuilder = removeTime_.toBuilder(); + } + removeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(removeTime_); + removeTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + allowMissing_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.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 PLACE_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int REMOVE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp removeTime_; + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + @java.lang.Override + public boolean hasRemoveTime() { + return removeTime_ != null; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRemoveTime() { + return removeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : removeTime_; + } + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + return getRemoveTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 5; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, placeIds_.getRaw(i)); + } + if (removeTime_ != null) { + output.writeMessage(4, getRemoveTime()); + } + if (allowMissing_ != false) { + output.writeBool(5, allowMissing_); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (removeTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRemoveTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowMissing_); + } + 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.RemoveFulfillmentPlacesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest other = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getType().equals(other.getType())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasRemoveTime() != other.hasRemoveTime()) return false; + if (hasRemoveTime()) { + if (!getRemoveTime().equals(other.getRemoveTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasRemoveTime()) { + hash = (37 * hash) + REMOVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest 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.RemoveFulfillmentPlacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [RemoveFulfillmentPlaces][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.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(); + product_ = ""; + + type_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (removeTimeBuilder_ == null) { + removeTime_ = null; + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest build() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest buildPartial() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest result = + new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + result.type_ = type_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (removeTimeBuilder_ == null) { + result.removeTime_ = removeTime_; + } else { + result.removeTime_ = removeTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.RemoveFulfillmentPlacesRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest other) { + if (other + == com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasRemoveTime()) { + mergeRemoveTime(other.getRemoveTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.RemoveFulfillmentPlacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fulfillment type, including commonly used types (such as
+     * pickup in store and same day delivery), and custom types.
+     * Supported values:
+     * * "pickup-in-store"
+     * * "ship-to-store"
+     * * "same-day-delivery"
+     * * "next-day-delivery"
+     * * "custom-type-1"
+     * * "custom-type-2"
+     * * "custom-type-3"
+     * * "custom-type-4"
+     * * "custom-type-5"
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * This field directly corresponds to [Product.fulfillment_info.type][].
+     * 
+ * + * string type = 2 [(.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 com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IDs for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+     * such as the store IDs for "pickup-in-store" or the region IDs for
+     * "same-day-delivery", to be removed for this
+     * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+     * At least 1 value is required, and a maximum of 2000 values are allowed.
+     * Each value must be a string with a length limit of 10 characters, matching
+     * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp removeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + removeTimeBuilder_; + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + public boolean hasRemoveTime() { + return removeTimeBuilder_ != null || removeTime_ != null; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + public com.google.protobuf.Timestamp getRemoveTime() { + if (removeTimeBuilder_ == null) { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } else { + return removeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + removeTime_ = value; + onChanged(); + } else { + removeTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (removeTimeBuilder_ == null) { + removeTime_ = builderForValue.build(); + onChanged(); + } else { + removeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder mergeRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (removeTime_ != null) { + removeTime_ = + com.google.protobuf.Timestamp.newBuilder(removeTime_).mergeFrom(value).buildPartial(); + } else { + removeTime_ = value; + } + onChanged(); + } else { + removeTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public Builder clearRemoveTime() { + if (removeTimeBuilder_ == null) { + removeTime_ = null; + onChanged(); + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getRemoveTimeBuilder() { + + onChanged(); + return getRemoveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + if (removeTimeBuilder_ != null) { + return removeTimeBuilder_.getMessageOrBuilder(); + } else { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } + } + /** + * + * + *
+     * The time when the fulfillment updates are issued, used to prevent
+     * out-of-order updates on fulfillment information. If not provided, the
+     * internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRemoveTimeFieldBuilder() { + if (removeTimeBuilder_ == null) { + removeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRemoveTime(), getParentForChildren(), isClean()); + removeTime_ = null; + } + return removeTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the fulfillment information will still be processed and retained
+     * for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.RemoveFulfillmentPlacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + private static final com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest(); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesRequest(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.RemoveFulfillmentPlacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequestOrBuilder.java new file mode 100644 index 00000000..99d8c948 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesRequestOrBuilder.java @@ -0,0 +1,259 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveFulfillmentPlacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The fulfillment type, including commonly used types (such as
+   * pickup in store and same day delivery), and custom types.
+   * Supported values:
+   * * "pickup-in-store"
+   * * "ship-to-store"
+   * * "same-day-delivery"
+   * * "next-day-delivery"
+   * * "custom-type-1"
+   * * "custom-type-2"
+   * * "custom-type-3"
+   * * "custom-type-4"
+   * * "custom-type-5"
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * This field directly corresponds to [Product.fulfillment_info.type][].
+   * 
+ * + * string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. The IDs for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type],
+   * such as the store IDs for "pickup-in-store" or the region IDs for
+   * "same-day-delivery", to be removed for this
+   * [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type].
+   * At least 1 value is required, and a maximum of 2000 values are allowed.
+   * Each value must be a string with a length limit of 10 characters, matching
+   * the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string place_ids = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return Whether the removeTime field is set. + */ + boolean hasRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + * + * @return The removeTime. + */ + com.google.protobuf.Timestamp getRemoveTime(); + /** + * + * + *
+   * The time when the fulfillment updates are issued, used to prevent
+   * out-of-order updates on fulfillment information. If not provided, the
+   * internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the fulfillment information will still be processed and retained
+   * for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 5; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponse.java new file mode 100644 index 00000000..78319a88 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponse.java @@ -0,0 +1,470 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
+ * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} + */ +public final class RemoveFulfillmentPlacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + RemoveFulfillmentPlacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveFulfillmentPlacesResponse.newBuilder() to construct. + private RemoveFulfillmentPlacesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveFulfillmentPlacesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveFulfillmentPlacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveFulfillmentPlacesResponse( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.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.RemoveFulfillmentPlacesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse other = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) 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.RemoveFulfillmentPlacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse 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.RemoveFulfillmentPlacesResponse 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 RemoveFulfillmentPlacesRequest. Currently empty because there
+   * is no meaningful response populated from the [RemoveFulfillmentPlaces][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.class, + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveFulfillmentPlacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse build() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse buildPartial() { + com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse result = + new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse(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.RemoveFulfillmentPlacesResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse other) { + if (other + == com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse.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.RemoveFulfillmentPlacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + 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.RemoveFulfillmentPlacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + private static final com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse(); + } + + public static com.google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveFulfillmentPlacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveFulfillmentPlacesResponse(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.RemoveFulfillmentPlacesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponseOrBuilder.java new file mode 100644 index 00000000..d1d81a6e --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveFulfillmentPlacesResponseOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveFulfillmentPlacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadata.java new file mode 100644 index 00000000..9863a71d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadata.java @@ -0,0 +1,468 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the RemoveLocalInventories operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [RemoveLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} + */ +public final class RemoveLocalInventoriesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) + RemoveLocalInventoriesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesMetadata.newBuilder() to construct. + private RemoveLocalInventoriesMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesMetadata( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.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.RemoveLocalInventoriesMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata other = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) 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.RemoveLocalInventoriesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata 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.RemoveLocalInventoriesMetadata 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 related to the progress of the RemoveLocalInventories operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [RemoveLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata build() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata buildPartial() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata result = + new com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata(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.RemoveLocalInventoriesMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata other) { + if (other + == com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata.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.RemoveLocalInventoriesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) + 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.RemoveLocalInventoriesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) + private static final com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata(); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesMetadata(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.RemoveLocalInventoriesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadataOrBuilder.java new file mode 100644 index 00000000..9a1b6d16 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesMetadataOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveLocalInventoriesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequest.java new file mode 100644 index 00000000..95d5864f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequest.java @@ -0,0 +1,1390 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [RemoveLocalInventories][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} + */ +public final class RemoveLocalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) + RemoveLocalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesRequest.newBuilder() to construct. + private RemoveLocalInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesRequest() { + product_ = ""; + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesRequest( + 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(); + + product_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + placeIds_.add(s); + break; + } + case 24: + { + allowMissing_ = input.readBool(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (removeTime_ != null) { + subBuilder = removeTime_.toBuilder(); + } + removeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(removeTime_); + removeTime_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private volatile java.lang.Object product_; + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + @java.lang.Override + public java.lang.String getProduct() { + java.lang.Object ref = product_; + 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(); + product_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList placeIds_; + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_; + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + + public static final int REMOVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp removeTime_; + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + @java.lang.Override + public boolean hasRemoveTime() { + return removeTime_ != null; + } + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRemoveTime() { + return removeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : removeTime_; + } + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + return getRemoveTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the local inventory removal request will still be processed and
+   * retained for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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(product_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, product_); + } + for (int i = 0; i < placeIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, placeIds_.getRaw(i)); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (removeTime_ != null) { + output.writeMessage(5, getRemoveTime()); + } + 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(product_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, product_); + } + { + int dataSize = 0; + for (int i = 0; i < placeIds_.size(); i++) { + dataSize += computeStringSizeNoTag(placeIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPlaceIdsList().size(); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (removeTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRemoveTime()); + } + 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.RemoveLocalInventoriesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest other = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) obj; + + if (!getProduct().equals(other.getProduct())) return false; + if (!getPlaceIdsList().equals(other.getPlaceIdsList())) return false; + if (hasRemoveTime() != other.hasRemoveTime()) return false; + if (hasRemoveTime()) { + if (!getRemoveTime().equals(other.getRemoveTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + if (getPlaceIdsCount() > 0) { + hash = (37 * hash) + PLACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPlaceIdsList().hashCode(); + } + if (hasRemoveTime()) { + hash = (37 * hash) + REMOVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest 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.RemoveLocalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [RemoveLocalInventories][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.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(); + product_ = ""; + + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (removeTimeBuilder_ == null) { + removeTime_ = null; + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest build() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest buildPartial() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest result = + new com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest(this); + int from_bitField0_ = bitField0_; + result.product_ = product_; + if (((bitField0_ & 0x00000001) != 0)) { + placeIds_ = placeIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.placeIds_ = placeIds_; + if (removeTimeBuilder_ == null) { + result.removeTime_ = removeTime_; + } else { + result.removeTime_ = removeTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.RemoveLocalInventoriesRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest other) { + if (other + == com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest.getDefaultInstance()) + return this; + if (!other.getProduct().isEmpty()) { + product_ = other.product_; + onChanged(); + } + if (!other.placeIds_.isEmpty()) { + if (placeIds_.isEmpty()) { + placeIds_ = other.placeIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlaceIdsIsMutable(); + placeIds_.addAll(other.placeIds_); + } + onChanged(); + } + if (other.hasRemoveTime()) { + mergeRemoveTime(other.getRemoveTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.RemoveLocalInventoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object product_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + public java.lang.String getProduct() { + java.lang.Object ref = product_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + product_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + public com.google.protobuf.ByteString getProductBytes() { + java.lang.Object ref = product_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + product_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The product to set. + * @return This builder for chaining. + */ + public Builder setProduct(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + product_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProduct() { + + product_ = getDefaultInstance().getProduct(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Product][google.cloud.retail.v2beta.Product], such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+     * If the caller does not have permission to access the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for product to set. + * @return This builder for chaining. + */ + public Builder setProductBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + product_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList placeIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePlaceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + placeIds_ = new com.google.protobuf.LazyStringArrayList(placeIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + public com.google.protobuf.ProtocolStringList getPlaceIdsList() { + return placeIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + public int getPlaceIdsCount() { + return placeIds_.size(); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + public java.lang.String getPlaceIds(int index) { + return placeIds_.get(index); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + public com.google.protobuf.ByteString getPlaceIdsBytes(int index) { + return placeIds_.getByteString(index); + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The placeIds to set. + * @return This builder for chaining. + */ + public Builder setPlaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The placeIds to add. + * @return This builder for chaining. + */ + public Builder addAllPlaceIds(java.lang.Iterable values) { + ensurePlaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, placeIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlaceIds() { + placeIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A list of place IDs to have their inventory deleted.
+     * At most 3000 place IDs are allowed per request.
+     * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the placeIds to add. + * @return This builder for chaining. + */ + public Builder addPlaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePlaceIdsIsMutable(); + placeIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp removeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + removeTimeBuilder_; + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + public boolean hasRemoveTime() { + return removeTimeBuilder_ != null || removeTime_ != null; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + public com.google.protobuf.Timestamp getRemoveTime() { + if (removeTimeBuilder_ == null) { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } else { + return removeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + removeTime_ = value; + onChanged(); + } else { + removeTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder setRemoveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (removeTimeBuilder_ == null) { + removeTime_ = builderForValue.build(); + onChanged(); + } else { + removeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder mergeRemoveTime(com.google.protobuf.Timestamp value) { + if (removeTimeBuilder_ == null) { + if (removeTime_ != null) { + removeTime_ = + com.google.protobuf.Timestamp.newBuilder(removeTime_).mergeFrom(value).buildPartial(); + } else { + removeTime_ = value; + } + onChanged(); + } else { + removeTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public Builder clearRemoveTime() { + if (removeTimeBuilder_ == null) { + removeTime_ = null; + onChanged(); + } else { + removeTime_ = null; + removeTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getRemoveTimeBuilder() { + + onChanged(); + return getRemoveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder() { + if (removeTimeBuilder_ != null) { + return removeTimeBuilder_.getMessageOrBuilder(); + } else { + return removeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : removeTime_; + } + } + /** + * + * + *
+     * The time when the inventory deletions are issued. Used to prevent
+     * out-of-order updates and deletions on local inventory fields. If not
+     * provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRemoveTimeFieldBuilder() { + if (removeTimeBuilder_ == null) { + removeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRemoveTime(), getParentForChildren(), isClean()); + removeTime_ = null; + } + return removeTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, the local inventory removal request will still be processed and
+     * retained for at most 1 day and processed once the
+     * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+     * a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.RemoveLocalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) + private static final com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest(); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesRequest(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.RemoveLocalInventoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequestOrBuilder.java new file mode 100644 index 00000000..c89f6f16 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesRequestOrBuilder.java @@ -0,0 +1,178 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveLocalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveLocalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The product. + */ + java.lang.String getProduct(); + /** + * + * + *
+   * Required. Full resource name of
+   * [Product][google.cloud.retail.v2beta.Product], such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
+   * If the caller does not have permission to access the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * 
+ * + * + * string product = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for product. + */ + com.google.protobuf.ByteString getProductBytes(); + + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the placeIds. + */ + java.util.List getPlaceIdsList(); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of placeIds. + */ + int getPlaceIdsCount(); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The placeIds at the given index. + */ + java.lang.String getPlaceIds(int index); + /** + * + * + *
+   * Required. A list of place IDs to have their inventory deleted.
+   * At most 3000 place IDs are allowed per request.
+   * 
+ * + * repeated string place_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the placeIds at the given index. + */ + com.google.protobuf.ByteString getPlaceIdsBytes(int index); + + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return Whether the removeTime field is set. + */ + boolean hasRemoveTime(); + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + * + * @return The removeTime. + */ + com.google.protobuf.Timestamp getRemoveTime(); + /** + * + * + *
+   * The time when the inventory deletions are issued. Used to prevent
+   * out-of-order updates and deletions on local inventory fields. If not
+   * provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp remove_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getRemoveTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, the local inventory removal request will still be processed and
+   * retained for at most 1 day and processed once the
+   * [Product][google.cloud.retail.v2beta.Product] is created. If set to false,
+   * a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponse.java new file mode 100644 index 00000000..163d70dc --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponse.java @@ -0,0 +1,468 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the [RemoveLocalInventories][] API.  Currently empty because
+ * there is no meaningful response populated from the [RemoveLocalInventories][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} + */ +public final class RemoveLocalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) + RemoveLocalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RemoveLocalInventoriesResponse.newBuilder() to construct. + private RemoveLocalInventoriesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RemoveLocalInventoriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RemoveLocalInventoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RemoveLocalInventoriesResponse( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.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.RemoveLocalInventoriesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse other = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) 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.RemoveLocalInventoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse 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.RemoveLocalInventoriesResponse 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 [RemoveLocalInventories][] API.  Currently empty because
+   * there is no meaningful response populated from the [RemoveLocalInventories][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.RemoveLocalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.class, + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_RemoveLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse build() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse buildPartial() { + com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse result = + new com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse(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.RemoveLocalInventoriesResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse other) { + if (other + == com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse.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.RemoveLocalInventoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) + 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.RemoveLocalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) + private static final com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse(); + } + + public static com.google.cloud.retail.v2beta.RemoveLocalInventoriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoveLocalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoveLocalInventoriesResponse(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.RemoveLocalInventoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponseOrBuilder.java new file mode 100644 index 00000000..ad9f900c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveLocalInventoriesResponseOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface RemoveLocalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.RemoveLocalInventoriesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequest.java new file mode 100644 index 00000000..2156e515 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequest.java @@ -0,0 +1,1303 @@ +/* + * 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.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} + */ +public final class ReplaceCatalogAttributeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + ReplaceCatalogAttributeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplaceCatalogAttributeRequest.newBuilder() to construct. + private ReplaceCatalogAttributeRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplaceCatalogAttributeRequest() { + attributesConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplaceCatalogAttributeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplaceCatalogAttributeRequest( + 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(); + + attributesConfig_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.CatalogAttribute.Builder subBuilder = null; + if (catalogAttribute_ != null) { + subBuilder = catalogAttribute_.toBuilder(); + } + catalogAttribute_ = + input.readMessage( + com.google.cloud.retail.v2beta.CatalogAttribute.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalogAttribute_); + catalogAttribute_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 CATALOG_ATTRIBUTE_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.CatalogAttribute catalogAttribute_; + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + @java.lang.Override + public boolean hasCatalogAttribute() { + return catalogAttribute_ != null; + } + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute() { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + return getCatalogAttribute(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributesConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributesConfig_); + } + if (catalogAttribute_ != null) { + output.writeMessage(2, getCatalogAttribute()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + 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_); + } + if (catalogAttribute_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCatalogAttribute()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, 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.ReplaceCatalogAttributeRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest other = + (com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (hasCatalogAttribute() != other.hasCatalogAttribute()) return false; + if (hasCatalogAttribute()) { + if (!getCatalogAttribute().equals(other.getCatalogAttribute())) 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(); + hash = (37 * hash) + ATTRIBUTES_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAttributesConfig().hashCode(); + if (hasCatalogAttribute()) { + hash = (37 * hash) + CATALOG_ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getCatalogAttribute().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.ReplaceCatalogAttributeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttributeRequest 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.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.class, + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.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_ = ""; + + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest build() { + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest buildPartial() { + com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest result = + new com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest(this); + result.attributesConfig_ = attributesConfig_; + if (catalogAttributeBuilder_ == null) { + result.catalogAttribute_ = catalogAttribute_; + } else { + result.catalogAttribute_ = catalogAttributeBuilder_.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.ReplaceCatalogAttributeRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest other) { + if (other + == com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest.getDefaultInstance()) + return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (other.hasCatalogAttribute()) { + mergeCatalogAttribute(other.getCatalogAttribute()); + } + 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.ReplaceCatalogAttributeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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.cloud.retail.v2beta.CatalogAttribute catalogAttribute_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder> + catalogAttributeBuilder_; + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + public boolean hasCatalogAttribute() { + return catalogAttributeBuilder_ != null || catalogAttribute_ != null; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + public com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } else { + return catalogAttributeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute(com.google.cloud.retail.v2beta.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalogAttribute_ = value; + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalogAttribute( + com.google.cloud.retail.v2beta.CatalogAttribute.Builder builderForValue) { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = builderForValue.build(); + onChanged(); + } else { + catalogAttributeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalogAttribute(com.google.cloud.retail.v2beta.CatalogAttribute value) { + if (catalogAttributeBuilder_ == null) { + if (catalogAttribute_ != null) { + catalogAttribute_ = + com.google.cloud.retail.v2beta.CatalogAttribute.newBuilder(catalogAttribute_) + .mergeFrom(value) + .buildPartial(); + } else { + catalogAttribute_ = value; + } + onChanged(); + } else { + catalogAttributeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalogAttribute() { + if (catalogAttributeBuilder_ == null) { + catalogAttribute_ = null; + onChanged(); + } else { + catalogAttribute_ = null; + catalogAttributeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CatalogAttribute.Builder getCatalogAttributeBuilder() { + + onChanged(); + return getCatalogAttributeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder() { + if (catalogAttributeBuilder_ != null) { + return catalogAttributeBuilder_.getMessageOrBuilder(); + } else { + return catalogAttribute_ == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.getDefaultInstance() + : catalogAttribute_; + } + } + /** + * + * + *
+     * Required. The updated
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder> + getCatalogAttributeFieldBuilder() { + if (catalogAttributeBuilder_ == null) { + catalogAttributeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CatalogAttribute, + com.google.cloud.retail.v2beta.CatalogAttribute.Builder, + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder>( + getCatalogAttribute(), getParentForChildren(), isClean()); + catalogAttribute_ = null; + } + return catalogAttributeBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+     * The following are NOT supported:
+     * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + 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.ReplaceCatalogAttributeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + private static final com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest(); + } + + public static com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplaceCatalogAttributeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplaceCatalogAttributeRequest(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.ReplaceCatalogAttributeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequestOrBuilder.java new file mode 100644 index 00000000..14e55fb6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ReplaceCatalogAttributeRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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 ReplaceCatalogAttributeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full AttributesConfig resource name. 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. Full AttributesConfig resource name. 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 updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalogAttribute field is set. + */ + boolean hasCatalogAttribute(); + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalogAttribute. + */ + com.google.cloud.retail.v2beta.CatalogAttribute getCatalogAttribute(); + /** + * + * + *
+   * Required. The updated
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute].
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute catalog_attribute = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.CatalogAttributeOrBuilder getCatalogAttributeOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update.
+   * The following are NOT supported:
+   * * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java new file mode 100644 index 00000000..71e44ecb --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java @@ -0,0 +1,11616 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * 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.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule} + */ +public final class Rule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule) + RuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rule.newBuilder() to construct. + private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rule() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rule( + 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.Condition.Builder subBuilder = null; + if (condition_ != null) { + subBuilder = condition_.toBuilder(); + } + condition_ = + input.readMessage( + com.google.cloud.retail.v2beta.Condition.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(condition_); + condition_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder subBuilder = null; + if (actionCase_ == 2) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.BoostAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.BoostAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Rule.BoostAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder subBuilder = null; + if (actionCase_ == 3) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.RedirectAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.RedirectAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Rule.RedirectAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 3; + break; + } + case 50: + { + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder subBuilder = null; + if (actionCase_ == 6) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 6; + break; + } + case 58: + { + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder subBuilder = null; + if (actionCase_ == 7) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 7; + break; + } + case 66: + { + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder subBuilder = null; + if (actionCase_ == 8) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.ReplacementAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 8; + break; + } + case 74: + { + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder subBuilder = null; + if (actionCase_ == 9) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.IgnoreAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 9; + break; + } + case 82: + { + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder subBuilder = null; + if (actionCase_ == 10) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.FilterAction) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.FilterAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Rule.FilterAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 10; + break; + } + case 90: + { + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder subBuilder = null; + if (actionCase_ == 11) { + subBuilder = + ((com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_) + .toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 11; + 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.class, + com.google.cloud.retail.v2beta.Rule.Builder.class); + } + + public interface BoostActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.BoostAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Strength of the condition boost, which must be in [-1, 1]. Negative
+     * boost means demotion. Default is 0.0.
+     * Setting to 1.0 gives the item a big promotion. However, it does not
+     * necessarily mean that the boosted item will be the top result at all
+     * times, nor that other items will be excluded. Results could still be
+     * shown even when none of them matches the condition. And results that
+     * are significantly more relevant to the search query can still trump
+     * your heavily favored but irrelevant items.
+     * Setting to -1.0 gives the item a big demotion. However, results that
+     * are deeply relevant might still be shown. The item will have an
+     * upstream battle to get a fairly high ranking, but it is not blocked out
+     * completely.
+     * Setting to 0.0 means no boost applied. The boosting condition is
+     * ignored.
+     * 
+ * + * float boost = 1; + * + * @return The boost. + */ + float getBoost(); + + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + java.lang.String getProductsFilter(); + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + com.google.protobuf.ByteString getProductsFilterBytes(); + } + /** + * + * + *
+   * A boost action to apply to results matching condition specified above.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.BoostAction} + */ + public static final class BoostAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.BoostAction) + BoostActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostAction.newBuilder() to construct. + private BoostAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostAction() { + productsFilter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoostAction( + 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 13: + { + boost_ = input.readFloat(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + productsFilter_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_BoostAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.BoostAction.class, + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder.class); + } + + public static final int BOOST_FIELD_NUMBER = 1; + private float boost_; + /** + * + * + *
+     * Strength of the condition boost, which must be in [-1, 1]. Negative
+     * boost means demotion. Default is 0.0.
+     * Setting to 1.0 gives the item a big promotion. However, it does not
+     * necessarily mean that the boosted item will be the top result at all
+     * times, nor that other items will be excluded. Results could still be
+     * shown even when none of them matches the condition. And results that
+     * are significantly more relevant to the search query can still trump
+     * your heavily favored but irrelevant items.
+     * Setting to -1.0 gives the item a big demotion. However, results that
+     * are deeply relevant might still be shown. The item will have an
+     * upstream battle to get a fairly high ranking, but it is not blocked out
+     * completely.
+     * Setting to 0.0 means no boost applied. The boosting condition is
+     * ignored.
+     * 
+ * + * float boost = 1; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + public static final int PRODUCTS_FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object productsFilter_; + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + @java.lang.Override + public java.lang.String getProductsFilter() { + java.lang.Object ref = productsFilter_; + 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(); + productsFilter_ = s; + return s; + } + } + /** + * + * + *
+     * The filter can have a max size of 5000 characters.
+     * An expression which specifies which products to apply an action to.
+     * The syntax and supported fields are the same as a filter expression. See
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for detail syntax and limitations.
+     * Examples:
+     * * To boost products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductsFilterBytes() { + java.lang.Object ref = productsFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productsFilter_ = 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 (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(1, boost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productsFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, productsFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, boost_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productsFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, productsFilter_); + } + 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.Rule.BoostAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.BoostAction other = + (com.google.cloud.retail.v2beta.Rule.BoostAction) obj; + + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) return false; + if (!getProductsFilter().equals(other.getProductsFilter())) 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) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (37 * hash) + PRODUCTS_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getProductsFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction 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.Rule.BoostAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction 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.Rule.BoostAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction 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.Rule.BoostAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction 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.Rule.BoostAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction 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.Rule.BoostAction 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.Rule.BoostAction 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.Rule.BoostAction 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; + } + /** + * + * + *
+     * A boost action to apply to results matching condition specified above.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.BoostAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.BoostAction) + com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_BoostAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.BoostAction.class, + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.BoostAction.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(); + boost_ = 0F; + + productsFilter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_BoostAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostAction build() { + com.google.cloud.retail.v2beta.Rule.BoostAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.BoostAction result = + new com.google.cloud.retail.v2beta.Rule.BoostAction(this); + result.boost_ = boost_; + result.productsFilter_ = productsFilter_; + 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.Rule.BoostAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.BoostAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.BoostAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance()) + return this; + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + if (!other.getProductsFilter().isEmpty()) { + productsFilter_ = other.productsFilter_; + 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.Rule.BoostAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.BoostAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float boost_; + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Strength of the condition boost, which must be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 1; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object productsFilter_ = ""; + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return The productsFilter. + */ + public java.lang.String getProductsFilter() { + java.lang.Object ref = productsFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productsFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return The bytes for productsFilter. + */ + public com.google.protobuf.ByteString getProductsFilterBytes() { + java.lang.Object ref = productsFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productsFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @param value The productsFilter to set. + * @return This builder for chaining. + */ + public Builder setProductsFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + productsFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearProductsFilter() { + + productsFilter_ = getDefaultInstance().getProductsFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * The filter can have a max size of 5000 characters.
+       * An expression which specifies which products to apply an action to.
+       * The syntax and supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string products_filter = 2; + * + * @param value The bytes for productsFilter to set. + * @return This builder for chaining. + */ + public Builder setProductsFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + productsFilter_ = 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.Rule.BoostAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.BoostAction) + private static final com.google.cloud.retail.v2beta.Rule.BoostAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.BoostAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.BoostAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoostAction(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.Rule.BoostAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FilterActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.FilterAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + } + /** + * + * + *
+   * * Rule Condition:
+   *   - No [Condition][query_terms] provided is a global match.
+   *   - 1 or more [Condition][query_terms] provided is combined with OR
+   *   operator.
+   * * Action Input: The request query and filter that will be applied to the
+   * retrieved products, in addition to any filters already provided with the
+   * SearchRequest. The AND operator is used to combine the query's existing
+   * filters with the filter rule(s). NOTE: May result in 0 results when
+   * filters conflict.
+   * * Action Result: Filters the returned objects to be ONLY those that passed
+   * the filter.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.FilterAction} + */ + public static final class FilterAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.FilterAction) + FilterActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use FilterAction.newBuilder() to construct. + private FilterAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FilterAction() { + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FilterAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FilterAction( + 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(); + + filter_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_FilterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.FilterAction.class, + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + private volatile java.lang.Object filter_; + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+     * A filter to apply on the matching condition results. Supported features:
+     * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+     * set.
+     * * Filter syntax is identical to
+     * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+     * See more
+     *   details at the Retail Search
+     *   [user guide](/retail/search/docs/filter-and-order#filter).
+     * * To filter products with product ID "product_1" or "product_2", and
+     * color
+     *   "Red" or "Blue":<br>
+     *   *(id: ANY("product_1", "product_2"))<br>*
+     *   *AND<br>*
+     *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + 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(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + 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.Rule.FilterAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.FilterAction other = + (com.google.cloud.retail.v2beta.Rule.FilterAction) obj; + + if (!getFilter().equals(other.getFilter())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction 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.Rule.FilterAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction 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.Rule.FilterAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction 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.Rule.FilterAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction 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.Rule.FilterAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction 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.Rule.FilterAction 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.Rule.FilterAction 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.Rule.FilterAction 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; + } + /** + * + * + *
+     * * Rule Condition:
+     *   - No [Condition][query_terms] provided is a global match.
+     *   - 1 or more [Condition][query_terms] provided is combined with OR
+     *   operator.
+     * * Action Input: The request query and filter that will be applied to the
+     * retrieved products, in addition to any filters already provided with the
+     * SearchRequest. The AND operator is used to combine the query's existing
+     * filters with the filter rule(s). NOTE: May result in 0 results when
+     * filters conflict.
+     * * Action Result: Filters the returned objects to be ONLY those that passed
+     * the filter.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.FilterAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.FilterAction) + com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_FilterAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.FilterAction.class, + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.FilterAction.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(); + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_FilterAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterAction build() { + com.google.cloud.retail.v2beta.Rule.FilterAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.FilterAction result = + new com.google.cloud.retail.v2beta.Rule.FilterAction(this); + result.filter_ = filter_; + 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.Rule.FilterAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.FilterAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.FilterAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.Rule.FilterAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.FilterAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * A filter to apply on the matching condition results. Supported features:
+       * * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
+       * set.
+       * * Filter syntax is identical to
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
+       * See more
+       *   details at the Retail Search
+       *   [user guide](/retail/search/docs/filter-and-order#filter).
+       * * To filter products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":<br>
+       *   *(id: ANY("product_1", "product_2"))<br>*
+       *   *AND<br>*
+       *   *(colorFamilies: ANY("Red", "Blue"))<br>*
+       * 
+ * + * string filter = 1; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + 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.Rule.FilterAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.FilterAction) + private static final com.google.cloud.retail.v2beta.Rule.FilterAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.FilterAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.FilterAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilterAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FilterAction(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.Rule.FilterAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RedirectActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.RedirectAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * * Rule Condition:
+   *   - Must specify [Condition][query_terms].
+   * * Action Input: Request Query
+   * * Action Result: Redirects shopper to provided uri.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.RedirectAction} + */ + public static final class RedirectAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.RedirectAction) + RedirectActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use RedirectAction.newBuilder() to construct. + private RedirectAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RedirectAction() { + redirectUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RedirectAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RedirectAction( + 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(); + + redirectUri_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.RedirectAction.class, + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder.class); + } + + public static final int REDIRECT_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object redirectUri_; + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + 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(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+     * URL must have length equal or less than 2000 characters.
+     * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = 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(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, redirectUri_); + } + 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(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, redirectUri_); + } + 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.Rule.RedirectAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.RedirectAction other = + (com.google.cloud.retail.v2beta.Rule.RedirectAction) obj; + + if (!getRedirectUri().equals(other.getRedirectUri())) 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) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction 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.Rule.RedirectAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction 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.Rule.RedirectAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction 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.Rule.RedirectAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction 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.Rule.RedirectAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction 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.Rule.RedirectAction 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.Rule.RedirectAction 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.Rule.RedirectAction 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; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * * Rule Condition:
+     *   - Must specify [Condition][query_terms].
+     * * Action Input: Request Query
+     * * Action Result: Redirects shopper to provided uri.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.RedirectAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.RedirectAction) + com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.RedirectAction.class, + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.RedirectAction.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(); + redirectUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_RedirectAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectAction build() { + com.google.cloud.retail.v2beta.Rule.RedirectAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.RedirectAction result = + new com.google.cloud.retail.v2beta.Rule.RedirectAction(this); + result.redirectUri_ = redirectUri_; + 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.Rule.RedirectAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.RedirectAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.RedirectAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance()) + return this; + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + 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.Rule.RedirectAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.RedirectAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return The bytes for redirectUri. + */ + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @param value The redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redirectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + + redirectUri_ = getDefaultInstance().getRedirectUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * URL must have length equal or less than 2000 characters.
+       * 
+ * + * string redirect_uri = 1; + * + * @param value The bytes for redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redirectUri_ = 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.Rule.RedirectAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.RedirectAction) + private static final com.google.cloud.retail.v2beta.Rule.RedirectAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.RedirectAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.RedirectAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RedirectAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RedirectAction(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.Rule.RedirectAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TwowaySynonymsActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + java.util.List getSynonymsList(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + int getSynonymsCount(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + java.lang.String getSynonyms(int index); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + com.google.protobuf.ByteString getSynonymsBytes(int index); + } + /** + * + * + *
+   * Creates a set of terms that will be treated as synonyms of each other.
+   * Example: synonyms of "sneakers" and "shoes".
+   *  * "sneakers" will use a synonym of "shoes".
+   *  * "shoes" will use a synonym of "sneakers".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} + */ + public static final class TwowaySynonymsAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) + TwowaySynonymsActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TwowaySynonymsAction.newBuilder() to construct. + private TwowaySynonymsAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TwowaySynonymsAction() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TwowaySynonymsAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TwowaySynonymsAction( + 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)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + synonyms_.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)) { + synonyms_ = synonyms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.class, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder.class); + } + + public static final int SYNONYMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList synonyms_; + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Can specify up to 100 synonyms.
+     * Must specify at least 2 synonyms.
+     * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.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 < synonyms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, synonyms_.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 < synonyms_.size(); i++) { + dataSize += computeStringSizeNoTag(synonyms_.getRaw(i)); + } + size += dataSize; + size += 1 * getSynonymsList().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.Rule.TwowaySynonymsAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction other = + (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) obj; + + if (!getSynonymsList().equals(other.getSynonymsList())) 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 (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction 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.Rule.TwowaySynonymsAction 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; + } + /** + * + * + *
+     * Creates a set of terms that will be treated as synonyms of each other.
+     * Example: synonyms of "sneakers" and "shoes".
+     *  * "sneakers" will use a synonym of "shoes".
+     *  * "shoes" will use a synonym of "sneakers".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.TwowaySynonymsAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.class, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.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(); + synonyms_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_TwowaySynonymsAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction build() { + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction result = + new com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.synonyms_ = synonyms_; + 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.Rule.TwowaySynonymsAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance()) + return this; + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + 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.Rule.TwowaySynonymsAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList synonyms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(synonyms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param index The index to set the value at. + * @param value The synonyms to set. + * @return This builder for chaining. + */ + public Builder setSynonyms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param value The synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonyms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param values The synonyms to add. + * @return This builder for chaining. + */ + public Builder addAllSynonyms(java.lang.Iterable values) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @return This builder for chaining. + */ + public Builder clearSynonyms() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Can specify up to 100 synonyms.
+       * Must specify at least 2 synonyms.
+       * 
+ * + * repeated string synonyms = 1; + * + * @param value The bytes of the synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonymsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSynonymsIsMutable(); + synonyms_.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.Rule.TwowaySynonymsAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) + private static final com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TwowaySynonymsAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TwowaySynonymsAction(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.Rule.TwowaySynonymsAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OnewaySynonymsActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + java.util.List getSynonymsList(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + int getSynonymsCount(); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + java.lang.String getSynonyms(int index); + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + com.google.protobuf.ByteString getSynonymsBytes(int index); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + java.util.List getOnewayTermsList(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + int getOnewayTermsCount(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + java.lang.String getOnewayTerms(int index); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + com.google.protobuf.ByteString getOnewayTermsBytes(int index); + } + /** + * + * + *
+   * Maps a set of terms to a set of synonyms.
+   * Set of synonyms will be treated as synonyms of each query term only.
+   * `query_terms` will not be treated as synonyms of each other.
+   * Example: "sneakers" will use a synonym of "shoes".
+   * "shoes" will not use a synonym of "sneakers".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} + */ + public static final class OnewaySynonymsAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) + OnewaySynonymsActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use OnewaySynonymsAction.newBuilder() to construct. + private OnewaySynonymsAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OnewaySynonymsAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OnewaySynonymsAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OnewaySynonymsAction( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + onewayTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + synonyms_.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_ & 0x00000004) != 0)) { + onewayTerms_ = onewayTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.class, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will treat synonyms as their synonyms.
+     * Not themselves synonyms of the synonyms.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int SYNONYMS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList synonyms_; + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_; + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+     * Defines a set of synonyms.
+     * Cannot contain duplicates.
+     * Can specify up to 100 synonyms.
+     * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + + public static final int ONEWAY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList onewayTerms_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + public com.google.protobuf.ProtocolStringList getOnewayTermsList() { + return onewayTerms_; + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + public int getOnewayTermsCount() { + return onewayTerms_.size(); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + public java.lang.String getOnewayTerms(int index) { + return onewayTerms_.get(index); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + public com.google.protobuf.ByteString getOnewayTermsBytes(int index) { + return onewayTerms_.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 < onewayTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, onewayTerms_.getRaw(i)); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, queryTerms_.getRaw(i)); + } + for (int i = 0; i < synonyms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, synonyms_.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 < onewayTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(onewayTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getOnewayTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < synonyms_.size(); i++) { + dataSize += computeStringSizeNoTag(synonyms_.getRaw(i)); + } + size += dataSize; + size += 1 * getSynonymsList().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.Rule.OnewaySynonymsAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction other = + (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getSynonymsList().equals(other.getSynonymsList())) return false; + if (!getOnewayTermsList().equals(other.getOnewayTermsList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getSynonymsCount() > 0) { + hash = (37 * hash) + SYNONYMS_FIELD_NUMBER; + hash = (53 * hash) + getSynonymsList().hashCode(); + } + if (getOnewayTermsCount() > 0) { + hash = (37 * hash) + ONEWAY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getOnewayTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction 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.Rule.OnewaySynonymsAction 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; + } + /** + * + * + *
+     * Maps a set of terms to a set of synonyms.
+     * Set of synonyms will be treated as synonyms of each query term only.
+     * `query_terms` will not be treated as synonyms of each other.
+     * Example: "sneakers" will use a synonym of "shoes".
+     * "shoes" will not use a synonym of "sneakers".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.OnewaySynonymsAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.class, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_OnewaySynonymsAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction build() { + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction result = + new com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + if (((bitField0_ & 0x00000002) != 0)) { + synonyms_ = synonyms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.synonyms_ = synonyms_; + if (((bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = onewayTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.onewayTerms_ = onewayTerms_; + 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.Rule.OnewaySynonymsAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.synonyms_.isEmpty()) { + if (synonyms_.isEmpty()) { + synonyms_ = other.synonyms_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSynonymsIsMutable(); + synonyms_.addAll(other.synonyms_); + } + onChanged(); + } + if (!other.onewayTerms_.isEmpty()) { + if (onewayTerms_.isEmpty()) { + onewayTerms_ = other.onewayTerms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureOnewayTermsIsMutable(); + onewayTerms_.addAll(other.onewayTerms_); + } + 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.Rule.OnewaySynonymsAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will treat synonyms as their synonyms.
+       * Not themselves synonyms of the synonyms.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 3; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList synonyms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureSynonymsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + synonyms_ = new com.google.protobuf.LazyStringArrayList(synonyms_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return A list containing the synonyms. + */ + public com.google.protobuf.ProtocolStringList getSynonymsList() { + return synonyms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return The count of synonyms. + */ + public int getSynonymsCount() { + return synonyms_.size(); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the element to return. + * @return The synonyms at the given index. + */ + public java.lang.String getSynonyms(int index) { + return synonyms_.get(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index of the value to return. + * @return The bytes of the synonyms at the given index. + */ + public com.google.protobuf.ByteString getSynonymsBytes(int index) { + return synonyms_.getByteString(index); + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param index The index to set the value at. + * @param value The synonyms to set. + * @return This builder for chaining. + */ + public Builder setSynonyms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param value The synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonyms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param values The synonyms to add. + * @return This builder for chaining. + */ + public Builder addAllSynonyms(java.lang.Iterable values) { + ensureSynonymsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, synonyms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @return This builder for chaining. + */ + public Builder clearSynonyms() { + synonyms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines a set of synonyms.
+       * Cannot contain duplicates.
+       * Can specify up to 100 synonyms.
+       * 
+ * + * repeated string synonyms = 4; + * + * @param value The bytes of the synonyms to add. + * @return This builder for chaining. + */ + public Builder addSynonymsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSynonymsIsMutable(); + synonyms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList onewayTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOnewayTermsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + onewayTerms_ = new com.google.protobuf.LazyStringArrayList(onewayTerms_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return A list containing the onewayTerms. + */ + public com.google.protobuf.ProtocolStringList getOnewayTermsList() { + return onewayTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return The count of onewayTerms. + */ + public int getOnewayTermsCount() { + return onewayTerms_.size(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the element to return. + * @return The onewayTerms at the given index. + */ + public java.lang.String getOnewayTerms(int index) { + return onewayTerms_.get(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the onewayTerms at the given index. + */ + public com.google.protobuf.ByteString getOnewayTermsBytes(int index) { + return onewayTerms_.getByteString(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param index The index to set the value at. + * @param value The onewayTerms to set. + * @return This builder for chaining. + */ + public Builder setOnewayTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewayTermsIsMutable(); + onewayTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param value The onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addOnewayTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewayTermsIsMutable(); + onewayTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param values The onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addAllOnewayTerms(java.lang.Iterable values) { + ensureOnewayTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onewayTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearOnewayTerms() { + onewayTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string oneway_terms = 2; + * + * @param value The bytes of the onewayTerms to add. + * @return This builder for chaining. + */ + public Builder addOnewayTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOnewayTermsIsMutable(); + onewayTerms_.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.Rule.OnewaySynonymsAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) + private static final com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OnewaySynonymsAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OnewaySynonymsAction(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.Rule.OnewaySynonymsAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DoNotAssociateActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.DoNotAssociateAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + java.util.List getDoNotAssociateTermsList(); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + int getDoNotAssociateTermsCount(); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + java.lang.String getDoNotAssociateTerms(int index); + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + java.util.List getTermsList(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + int getTermsCount(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + java.lang.String getTerms(int index); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + com.google.protobuf.ByteString getTermsBytes(int index); + } + /** + * + * + *
+   * Prevents `query_term` from being associated with specified terms during
+   * search.
+   * Example: Don't associate "gShoe" and "cheap".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.DoNotAssociateAction} + */ + public static final class DoNotAssociateAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.DoNotAssociateAction) + DoNotAssociateActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoNotAssociateAction.newBuilder() to construct. + private DoNotAssociateAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DoNotAssociateAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DoNotAssociateAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DoNotAssociateAction( + 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_ & 0x00000004) != 0)) { + terms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + terms_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + doNotAssociateTerms_.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_ & 0x00000004) != 0)) { + terms_ = terms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = doNotAssociateTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.class, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will not consider do_not_associate_terms for search if in search query.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int DO_NOT_ASSOCIATE_TERMS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList doNotAssociateTerms_; + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateTermsList() { + return doNotAssociateTerms_; + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + public int getDoNotAssociateTermsCount() { + return doNotAssociateTerms_.size(); + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + public java.lang.String getDoNotAssociateTerms(int index) { + return doNotAssociateTerms_.get(index); + } + /** + * + * + *
+     * Cannot contain duplicates or the query term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index) { + return doNotAssociateTerms_.getByteString(index); + } + + public static final int TERMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList terms_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + public com.google.protobuf.ProtocolStringList getTermsList() { + return terms_; + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + public int getTermsCount() { + return terms_.size(); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + public java.lang.String getTerms(int index) { + return terms_.get(index); + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + public com.google.protobuf.ByteString getTermsBytes(int index) { + return terms_.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 < terms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, terms_.getRaw(i)); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queryTerms_.getRaw(i)); + } + for (int i = 0; i < doNotAssociateTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, doNotAssociateTerms_.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 < terms_.size(); i++) { + dataSize += computeStringSizeNoTag(terms_.getRaw(i)); + } + size += dataSize; + size += 1 * getTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < doNotAssociateTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(doNotAssociateTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getDoNotAssociateTermsList().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.Rule.DoNotAssociateAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction other = + (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getDoNotAssociateTermsList().equals(other.getDoNotAssociateTermsList())) return false; + if (!getTermsList().equals(other.getTermsList())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + if (getDoNotAssociateTermsCount() > 0) { + hash = (37 * hash) + DO_NOT_ASSOCIATE_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateTermsList().hashCode(); + } + if (getTermsCount() > 0) { + hash = (37 * hash) + TERMS_FIELD_NUMBER; + hash = (53 * hash) + getTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction 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.Rule.DoNotAssociateAction 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; + } + /** + * + * + *
+     * Prevents `query_term` from being associated with specified terms during
+     * search.
+     * Example: Don't associate "gShoe" and "cheap".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.DoNotAssociateAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.DoNotAssociateAction) + com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.class, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_DoNotAssociateAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction build() { + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction result = + new com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + if (((bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = doNotAssociateTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.doNotAssociateTerms_ = doNotAssociateTerms_; + if (((bitField0_ & 0x00000004) != 0)) { + terms_ = terms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.terms_ = terms_; + 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.Rule.DoNotAssociateAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.doNotAssociateTerms_.isEmpty()) { + if (doNotAssociateTerms_.isEmpty()) { + doNotAssociateTerms_ = other.doNotAssociateTerms_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.addAll(other.doNotAssociateTerms_); + } + onChanged(); + } + if (!other.terms_.isEmpty()) { + if (terms_.isEmpty()) { + terms_ = other.terms_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTermsIsMutable(); + terms_.addAll(other.terms_); + } + 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.Rule.DoNotAssociateAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will not consider do_not_associate_terms for search if in search query.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList doNotAssociateTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDoNotAssociateTermsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + doNotAssociateTerms_ = new com.google.protobuf.LazyStringArrayList(doNotAssociateTerms_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return A list containing the doNotAssociateTerms. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateTermsList() { + return doNotAssociateTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return The count of doNotAssociateTerms. + */ + public int getDoNotAssociateTermsCount() { + return doNotAssociateTerms_.size(); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the element to return. + * @return The doNotAssociateTerms at the given index. + */ + public java.lang.String getDoNotAssociateTerms(int index) { + return doNotAssociateTerms_.get(index); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateTerms at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateTermsBytes(int index) { + return doNotAssociateTerms_.getByteString(index); + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param index The index to set the value at. + * @param value The doNotAssociateTerms to set. + * @return This builder for chaining. + */ + public Builder setDoNotAssociateTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param value The doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param values The doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addAllDoNotAssociateTerms(java.lang.Iterable values) { + ensureDoNotAssociateTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, doNotAssociateTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @return This builder for chaining. + */ + public Builder clearDoNotAssociateTerms() { + doNotAssociateTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Cannot contain duplicates or the query term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string do_not_associate_terms = 3; + * + * @param value The bytes of the doNotAssociateTerms to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDoNotAssociateTermsIsMutable(); + doNotAssociateTerms_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList terms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTermsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + terms_ = new com.google.protobuf.LazyStringArrayList(terms_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return A list containing the terms. + */ + public com.google.protobuf.ProtocolStringList getTermsList() { + return terms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return The count of terms. + */ + public int getTermsCount() { + return terms_.size(); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index of the element to return. + * @return The terms at the given index. + */ + public java.lang.String getTerms(int index) { + return terms_.get(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the terms at the given index. + */ + public com.google.protobuf.ByteString getTermsBytes(int index) { + return terms_.getByteString(index); + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param index The index to set the value at. + * @param value The terms to set. + * @return This builder for chaining. + */ + public Builder setTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTermsIsMutable(); + terms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param value The terms to add. + * @return This builder for chaining. + */ + public Builder addTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTermsIsMutable(); + terms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param values The terms to add. + * @return This builder for chaining. + */ + public Builder addAllTerms(java.lang.Iterable values) { + ensureTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, terms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @return This builder for chaining. + */ + public Builder clearTerms() { + terms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * repeated string terms = 1; + * + * @param value The bytes of the terms to add. + * @return This builder for chaining. + */ + public Builder addTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTermsIsMutable(); + terms_.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.Rule.DoNotAssociateAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.DoNotAssociateAction) + private static final com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoNotAssociateAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DoNotAssociateAction(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.Rule.DoNotAssociateAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReplacementActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.ReplacementAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + java.util.List getQueryTermsList(); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + int getQueryTermsCount(); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + java.lang.String getQueryTerms(int index); + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + com.google.protobuf.ByteString getQueryTermsBytes(int index); + + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + java.lang.String getReplacementTerm(); + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + com.google.protobuf.ByteString getReplacementTermBytes(); + + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The term. + */ + java.lang.String getTerm(); + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + com.google.protobuf.ByteString getTermBytes(); + } + /** + * + * + *
+   * Replaces a term in the query. Multiple replacement candidates can be
+   * specified. All `query_terms` will be replaced with the replacement term.
+   * Example: Replace "gShoe" with "google shoe".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.ReplacementAction} + */ + public static final class ReplacementAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.ReplacementAction) + ReplacementActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplacementAction.newBuilder() to construct. + private ReplacementAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplacementAction() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + replacementTerm_ = ""; + term_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplacementAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplacementAction( + 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(); + + term_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queryTerms_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + replacementTerm_ = 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)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.ReplacementAction.class, + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder.class); + } + + public static final int QUERY_TERMS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList queryTerms_; + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_; + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+     * Terms from the search query.
+     * Will be replaced by replacement term.
+     * Can specify up to 100 terms.
+     * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + + public static final int REPLACEMENT_TERM_FIELD_NUMBER = 3; + private volatile java.lang.Object replacementTerm_; + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + @java.lang.Override + public java.lang.String getReplacementTerm() { + java.lang.Object ref = replacementTerm_; + 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(); + replacementTerm_ = s; + return s; + } + } + /** + * + * + *
+     * Term that will be used for replacement.
+     * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplacementTermBytes() { + java.lang.Object ref = replacementTerm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementTerm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TERM_FIELD_NUMBER = 1; + private volatile java.lang.Object term_; + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The term. + */ + @java.lang.Override + public java.lang.String getTerm() { + java.lang.Object ref = term_; + 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(); + term_ = s; + return s; + } + } + /** + * + * + *
+     * Will be [deprecated = true] post migration;
+     * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTermBytes() { + java.lang.Object ref = term_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + term_ = 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(term_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, term_); + } + for (int i = 0; i < queryTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, queryTerms_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementTerm_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, replacementTerm_); + } + 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(term_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, term_); + } + { + int dataSize = 0; + for (int i = 0; i < queryTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(queryTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueryTermsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replacementTerm_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, replacementTerm_); + } + 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.Rule.ReplacementAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.ReplacementAction other = + (com.google.cloud.retail.v2beta.Rule.ReplacementAction) obj; + + if (!getQueryTermsList().equals(other.getQueryTermsList())) return false; + if (!getReplacementTerm().equals(other.getReplacementTerm())) return false; + if (!getTerm().equals(other.getTerm())) 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 (getQueryTermsCount() > 0) { + hash = (37 * hash) + QUERY_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryTermsList().hashCode(); + } + hash = (37 * hash) + REPLACEMENT_TERM_FIELD_NUMBER; + hash = (53 * hash) + getReplacementTerm().hashCode(); + hash = (37 * hash) + TERM_FIELD_NUMBER; + hash = (53 * hash) + getTerm().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction 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.Rule.ReplacementAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction 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.Rule.ReplacementAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction 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.Rule.ReplacementAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction 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.Rule.ReplacementAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction 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.Rule.ReplacementAction 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.Rule.ReplacementAction 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.Rule.ReplacementAction 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; + } + /** + * + * + *
+     * Replaces a term in the query. Multiple replacement candidates can be
+     * specified. All `query_terms` will be replaced with the replacement term.
+     * Example: Replace "gShoe" with "google shoe".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.ReplacementAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.ReplacementAction) + com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.ReplacementAction.class, + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.ReplacementAction.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(); + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + replacementTerm_ = ""; + + term_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_ReplacementAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementAction build() { + com.google.cloud.retail.v2beta.Rule.ReplacementAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.ReplacementAction result = + new com.google.cloud.retail.v2beta.Rule.ReplacementAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = queryTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queryTerms_ = queryTerms_; + result.replacementTerm_ = replacementTerm_; + result.term_ = term_; + 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.Rule.ReplacementAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.ReplacementAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.ReplacementAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance()) + return this; + if (!other.queryTerms_.isEmpty()) { + if (queryTerms_.isEmpty()) { + queryTerms_ = other.queryTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueryTermsIsMutable(); + queryTerms_.addAll(other.queryTerms_); + } + onChanged(); + } + if (!other.getReplacementTerm().isEmpty()) { + replacementTerm_ = other.replacementTerm_; + onChanged(); + } + if (!other.getTerm().isEmpty()) { + term_ = other.term_; + 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.Rule.ReplacementAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.ReplacementAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList queryTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueryTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queryTerms_ = new com.google.protobuf.LazyStringArrayList(queryTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return A list containing the queryTerms. + */ + public com.google.protobuf.ProtocolStringList getQueryTermsList() { + return queryTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return The count of queryTerms. + */ + public int getQueryTermsCount() { + return queryTerms_.size(); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the element to return. + * @return The queryTerms at the given index. + */ + public java.lang.String getQueryTerms(int index) { + return queryTerms_.get(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index of the value to return. + * @return The bytes of the queryTerms at the given index. + */ + public com.google.protobuf.ByteString getQueryTermsBytes(int index) { + return queryTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param index The index to set the value at. + * @param value The queryTerms to set. + * @return This builder for chaining. + */ + public Builder setQueryTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param values The queryTerms to add. + * @return This builder for chaining. + */ + public Builder addAllQueryTerms(java.lang.Iterable values) { + ensureQueryTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queryTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryTerms() { + queryTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms from the search query.
+       * Will be replaced by replacement term.
+       * Can specify up to 100 terms.
+       * 
+ * + * repeated string query_terms = 2; + * + * @param value The bytes of the queryTerms to add. + * @return This builder for chaining. + */ + public Builder addQueryTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueryTermsIsMutable(); + queryTerms_.add(value); + onChanged(); + return this; + } + + private java.lang.Object replacementTerm_ = ""; + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return The replacementTerm. + */ + public java.lang.String getReplacementTerm() { + java.lang.Object ref = replacementTerm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replacementTerm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return The bytes for replacementTerm. + */ + public com.google.protobuf.ByteString getReplacementTermBytes() { + java.lang.Object ref = replacementTerm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replacementTerm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @param value The replacementTerm to set. + * @return This builder for chaining. + */ + public Builder setReplacementTerm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replacementTerm_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @return This builder for chaining. + */ + public Builder clearReplacementTerm() { + + replacementTerm_ = getDefaultInstance().getReplacementTerm(); + onChanged(); + return this; + } + /** + * + * + *
+       * Term that will be used for replacement.
+       * 
+ * + * string replacement_term = 3; + * + * @param value The bytes for replacementTerm to set. + * @return This builder for chaining. + */ + public Builder setReplacementTermBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replacementTerm_ = value; + onChanged(); + return this; + } + + private java.lang.Object term_ = ""; + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return The term. + */ + public java.lang.String getTerm() { + java.lang.Object ref = term_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + term_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return The bytes for term. + */ + public com.google.protobuf.ByteString getTermBytes() { + java.lang.Object ref = term_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + term_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @param value The term to set. + * @return This builder for chaining. + */ + public Builder setTerm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + term_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @return This builder for chaining. + */ + public Builder clearTerm() { + + term_ = getDefaultInstance().getTerm(); + onChanged(); + return this; + } + /** + * + * + *
+       * Will be [deprecated = true] post migration;
+       * 
+ * + * string term = 1; + * + * @param value The bytes for term to set. + * @return This builder for chaining. + */ + public Builder setTermBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + term_ = 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.Rule.ReplacementAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.ReplacementAction) + private static final com.google.cloud.retail.v2beta.Rule.ReplacementAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.ReplacementAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.ReplacementAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplacementAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplacementAction(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.Rule.ReplacementAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IgnoreActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule.IgnoreAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + java.util.List getIgnoreTermsList(); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + int getIgnoreTermsCount(); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + java.lang.String getIgnoreTerms(int index); + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + com.google.protobuf.ByteString getIgnoreTermsBytes(int index); + } + /** + * + * + *
+   * Prevents a term in the query from being used in search.
+   * Example: Don't search for "shoddy".
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.IgnoreAction} + */ + public static final class IgnoreAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Rule.IgnoreAction) + IgnoreActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use IgnoreAction.newBuilder() to construct. + private IgnoreAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IgnoreAction() { + ignoreTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IgnoreAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IgnoreAction( + 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)) { + ignoreTerms_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ignoreTerms_.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)) { + ignoreTerms_ = ignoreTerms_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.IgnoreAction.class, + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder.class); + } + + public static final int IGNORE_TERMS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList ignoreTerms_; + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + public com.google.protobuf.ProtocolStringList getIgnoreTermsList() { + return ignoreTerms_; + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + public int getIgnoreTermsCount() { + return ignoreTerms_.size(); + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + public java.lang.String getIgnoreTerms(int index) { + return ignoreTerms_.get(index); + } + /** + * + * + *
+     * Terms to ignore in the search query.
+     * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + public com.google.protobuf.ByteString getIgnoreTermsBytes(int index) { + return ignoreTerms_.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 < ignoreTerms_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ignoreTerms_.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 < ignoreTerms_.size(); i++) { + dataSize += computeStringSizeNoTag(ignoreTerms_.getRaw(i)); + } + size += dataSize; + size += 1 * getIgnoreTermsList().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.Rule.IgnoreAction)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule.IgnoreAction other = + (com.google.cloud.retail.v2beta.Rule.IgnoreAction) obj; + + if (!getIgnoreTermsList().equals(other.getIgnoreTermsList())) 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 (getIgnoreTermsCount() > 0) { + hash = (37 * hash) + IGNORE_TERMS_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreTermsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction 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.Rule.IgnoreAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction 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.Rule.IgnoreAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction 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.Rule.IgnoreAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction 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.Rule.IgnoreAction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction 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.Rule.IgnoreAction 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.Rule.IgnoreAction 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.Rule.IgnoreAction 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; + } + /** + * + * + *
+     * Prevents a term in the query from being used in search.
+     * Example: Don't search for "shoddy".
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule.IgnoreAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule.IgnoreAction) + com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.IgnoreAction.class, + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.IgnoreAction.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(); + ignoreTerms_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_IgnoreAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreAction getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreAction build() { + com.google.cloud.retail.v2beta.Rule.IgnoreAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreAction buildPartial() { + com.google.cloud.retail.v2beta.Rule.IgnoreAction result = + new com.google.cloud.retail.v2beta.Rule.IgnoreAction(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + ignoreTerms_ = ignoreTerms_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ignoreTerms_ = ignoreTerms_; + 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.Rule.IgnoreAction) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule.IgnoreAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule.IgnoreAction other) { + if (other == com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance()) + return this; + if (!other.ignoreTerms_.isEmpty()) { + if (ignoreTerms_.isEmpty()) { + ignoreTerms_ = other.ignoreTerms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIgnoreTermsIsMutable(); + ignoreTerms_.addAll(other.ignoreTerms_); + } + 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.Rule.IgnoreAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Rule.IgnoreAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList ignoreTerms_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIgnoreTermsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ignoreTerms_ = new com.google.protobuf.LazyStringArrayList(ignoreTerms_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return A list containing the ignoreTerms. + */ + public com.google.protobuf.ProtocolStringList getIgnoreTermsList() { + return ignoreTerms_.getUnmodifiableView(); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return The count of ignoreTerms. + */ + public int getIgnoreTermsCount() { + return ignoreTerms_.size(); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the element to return. + * @return The ignoreTerms at the given index. + */ + public java.lang.String getIgnoreTerms(int index) { + return ignoreTerms_.get(index); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreTerms at the given index. + */ + public com.google.protobuf.ByteString getIgnoreTermsBytes(int index) { + return ignoreTerms_.getByteString(index); + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param index The index to set the value at. + * @param value The ignoreTerms to set. + * @return This builder for chaining. + */ + public Builder setIgnoreTerms(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreTermsIsMutable(); + ignoreTerms_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param value The ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addIgnoreTerms(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreTermsIsMutable(); + ignoreTerms_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param values The ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreTerms(java.lang.Iterable values) { + ensureIgnoreTermsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ignoreTerms_); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreTerms() { + ignoreTerms_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Terms to ignore in the search query.
+       * 
+ * + * repeated string ignore_terms = 1; + * + * @param value The bytes of the ignoreTerms to add. + * @return This builder for chaining. + */ + public Builder addIgnoreTermsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIgnoreTermsIsMutable(); + ignoreTerms_.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.Rule.IgnoreAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule.IgnoreAction) + private static final com.google.cloud.retail.v2beta.Rule.IgnoreAction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule.IgnoreAction(); + } + + public static com.google.cloud.retail.v2beta.Rule.IgnoreAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IgnoreAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IgnoreAction(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.Rule.IgnoreAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public enum ActionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BOOST_ACTION(2), + REDIRECT_ACTION(3), + ONEWAY_SYNONYMS_ACTION(6), + DO_NOT_ASSOCIATE_ACTION(7), + REPLACEMENT_ACTION(8), + IGNORE_ACTION(9), + FILTER_ACTION(10), + TWOWAY_SYNONYMS_ACTION(11), + ACTION_NOT_SET(0); + private final int value; + + private ActionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ActionCase valueOf(int value) { + return forNumber(value); + } + + public static ActionCase forNumber(int value) { + switch (value) { + case 2: + return BOOST_ACTION; + case 3: + return REDIRECT_ACTION; + case 6: + return ONEWAY_SYNONYMS_ACTION; + case 7: + return DO_NOT_ASSOCIATE_ACTION; + case 8: + return REPLACEMENT_ACTION; + case 9: + return IGNORE_ACTION; + case 10: + return FILTER_ACTION; + case 11: + return TWOWAY_SYNONYMS_ACTION; + case 0: + return ACTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public static final int BOOST_ACTION_FIELD_NUMBER = 2; + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + @java.lang.Override + public boolean hasBoostAction() { + return actionCase_ == 2; + } + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostAction getBoostAction() { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2beta.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder getBoostActionOrBuilder() { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2beta.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + + public static final int REDIRECT_ACTION_FIELD_NUMBER = 3; + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + @java.lang.Override + public boolean hasRedirectAction() { + return actionCase_ == 3; + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectAction getRedirectAction() { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder getRedirectActionOrBuilder() { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + + public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER = 6; + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return Whether the onewaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasOnewaySynonymsAction() { + return actionCase_ == 6; + } + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return The onewaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction getOnewaySynonymsAction() { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder() { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + + public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER = 7; + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * @return Whether the doNotAssociateAction field is set. + */ + @java.lang.Override + public boolean hasDoNotAssociateAction() { + return actionCase_ == 7; + } + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * @return The doNotAssociateAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction getDoNotAssociateAction() { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder() { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + + public static final int REPLACEMENT_ACTION_FIELD_NUMBER = 8; + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + @java.lang.Override + public boolean hasReplacementAction() { + return actionCase_ == 8; + } + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementAction getReplacementAction() { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder + getReplacementActionOrBuilder() { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + + public static final int IGNORE_ACTION_FIELD_NUMBER = 9; + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + @java.lang.Override + public boolean hasIgnoreAction() { + return actionCase_ == 9; + } + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreAction getIgnoreAction() { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder() { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + + public static final int FILTER_ACTION_FIELD_NUMBER = 10; + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + @java.lang.Override + public boolean hasFilterAction() { + return actionCase_ == 10; + } + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterAction getFilterAction() { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2beta.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder getFilterActionOrBuilder() { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2beta.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + + public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER = 11; + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * @return Whether the twowaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasTwowaySynonymsAction() { + return actionCase_ == 11; + } + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * @return The twowaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction getTwowaySynonymsAction() { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder() { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Condition condition_; + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return condition_ != null; + } + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Condition getCondition() { + return condition_ == null + ? com.google.cloud.retail.v2beta.Condition.getDefaultInstance() + : condition_; + } + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ConditionOrBuilder getConditionOrBuilder() { + return getCondition(); + } + + 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 (condition_ != null) { + output.writeMessage(1, getCondition()); + } + if (actionCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2beta.Rule.BoostAction) action_); + } + if (actionCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_); + } + if (actionCase_ == 6) { + output.writeMessage(6, (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_); + } + if (actionCase_ == 7) { + output.writeMessage(7, (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_); + } + if (actionCase_ == 8) { + output.writeMessage(8, (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_); + } + if (actionCase_ == 9) { + output.writeMessage(9, (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_); + } + if (actionCase_ == 10) { + output.writeMessage(10, (com.google.cloud.retail.v2beta.Rule.FilterAction) action_); + } + if (actionCase_ == 11) { + output.writeMessage(11, (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCondition()); + } + if (actionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2beta.Rule.BoostAction) action_); + } + if (actionCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_); + } + if (actionCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_); + } + if (actionCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_); + } + if (actionCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_); + } + if (actionCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_); + } + if (actionCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.retail.v2beta.Rule.FilterAction) action_); + } + if (actionCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_); + } + 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.Rule)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Rule other = (com.google.cloud.retail.v2beta.Rule) obj; + + if (hasCondition() != other.hasCondition()) return false; + if (hasCondition()) { + if (!getCondition().equals(other.getCondition())) return false; + } + if (!getActionCase().equals(other.getActionCase())) return false; + switch (actionCase_) { + case 2: + if (!getBoostAction().equals(other.getBoostAction())) return false; + break; + case 3: + if (!getRedirectAction().equals(other.getRedirectAction())) return false; + break; + case 6: + if (!getOnewaySynonymsAction().equals(other.getOnewaySynonymsAction())) return false; + break; + case 7: + if (!getDoNotAssociateAction().equals(other.getDoNotAssociateAction())) return false; + break; + case 8: + if (!getReplacementAction().equals(other.getReplacementAction())) return false; + break; + case 9: + if (!getIgnoreAction().equals(other.getIgnoreAction())) return false; + break; + case 10: + if (!getFilterAction().equals(other.getFilterAction())) return false; + break; + case 11: + if (!getTwowaySynonymsAction().equals(other.getTwowaySynonymsAction())) return false; + break; + case 0: + default: + } + 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 (hasCondition()) { + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + } + switch (actionCase_) { + case 2: + hash = (37 * hash) + BOOST_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getBoostAction().hashCode(); + break; + case 3: + hash = (37 * hash) + REDIRECT_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getRedirectAction().hashCode(); + break; + case 6: + hash = (37 * hash) + ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getOnewaySynonymsAction().hashCode(); + break; + case 7: + hash = (37 * hash) + DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateAction().hashCode(); + break; + case 8: + hash = (37 * hash) + REPLACEMENT_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getReplacementAction().hashCode(); + break; + case 9: + hash = (37 * hash) + IGNORE_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreAction().hashCode(); + break; + case 10: + hash = (37 * hash) + FILTER_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getFilterAction().hashCode(); + break; + case 11: + hash = (37 * hash) + TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getTwowaySynonymsAction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Rule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule 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.Rule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule 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.Rule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Rule 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.Rule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule 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.Rule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Rule 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.Rule 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.Rule 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.Rule 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; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Rule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Rule) + com.google.cloud.retail.v2beta.RuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Rule.class, + com.google.cloud.retail.v2beta.Rule.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Rule.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 (conditionBuilder_ == null) { + condition_ = null; + } else { + condition_ = null; + conditionBuilder_ = null; + } + actionCase_ = 0; + action_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_Rule_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Rule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule build() { + com.google.cloud.retail.v2beta.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule buildPartial() { + com.google.cloud.retail.v2beta.Rule result = new com.google.cloud.retail.v2beta.Rule(this); + if (actionCase_ == 2) { + if (boostActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = boostActionBuilder_.build(); + } + } + if (actionCase_ == 3) { + if (redirectActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = redirectActionBuilder_.build(); + } + } + if (actionCase_ == 6) { + if (onewaySynonymsActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = onewaySynonymsActionBuilder_.build(); + } + } + if (actionCase_ == 7) { + if (doNotAssociateActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = doNotAssociateActionBuilder_.build(); + } + } + if (actionCase_ == 8) { + if (replacementActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = replacementActionBuilder_.build(); + } + } + if (actionCase_ == 9) { + if (ignoreActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = ignoreActionBuilder_.build(); + } + } + if (actionCase_ == 10) { + if (filterActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = filterActionBuilder_.build(); + } + } + if (actionCase_ == 11) { + if (twowaySynonymsActionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = twowaySynonymsActionBuilder_.build(); + } + } + if (conditionBuilder_ == null) { + result.condition_ = condition_; + } else { + result.condition_ = conditionBuilder_.build(); + } + result.actionCase_ = actionCase_; + 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.Rule) { + return mergeFrom((com.google.cloud.retail.v2beta.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Rule other) { + if (other == com.google.cloud.retail.v2beta.Rule.getDefaultInstance()) return this; + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + switch (other.getActionCase()) { + case BOOST_ACTION: + { + mergeBoostAction(other.getBoostAction()); + break; + } + case REDIRECT_ACTION: + { + mergeRedirectAction(other.getRedirectAction()); + break; + } + case ONEWAY_SYNONYMS_ACTION: + { + mergeOnewaySynonymsAction(other.getOnewaySynonymsAction()); + break; + } + case DO_NOT_ASSOCIATE_ACTION: + { + mergeDoNotAssociateAction(other.getDoNotAssociateAction()); + break; + } + case REPLACEMENT_ACTION: + { + mergeReplacementAction(other.getReplacementAction()); + break; + } + case IGNORE_ACTION: + { + mergeIgnoreAction(other.getIgnoreAction()); + break; + } + case FILTER_ACTION: + { + mergeFilterAction(other.getFilterAction()); + break; + } + case TWOWAY_SYNONYMS_ACTION: + { + mergeTwowaySynonymsAction(other.getTwowaySynonymsAction()); + break; + } + case ACTION_NOT_SET: + { + break; + } + } + 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.Rule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Rule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public Builder clearAction() { + actionCase_ = 0; + action_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.BoostAction, + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder, + com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder> + boostActionBuilder_; + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + @java.lang.Override + public boolean hasBoostAction() { + return actionCase_ == 2; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostAction getBoostAction() { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2beta.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } else { + if (actionCase_ == 2) { + return boostActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + public Builder setBoostAction(com.google.cloud.retail.v2beta.Rule.BoostAction value) { + if (boostActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + boostActionBuilder_.setMessage(value); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + public Builder setBoostAction( + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder builderForValue) { + if (boostActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + boostActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + public Builder mergeBoostAction(com.google.cloud.retail.v2beta.Rule.BoostAction value) { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2 + && action_ != com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.BoostAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.BoostAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 2) { + boostActionBuilder_.mergeFrom(value); + } else { + boostActionBuilder_.setMessage(value); + } + } + actionCase_ = 2; + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + public Builder clearBoostAction() { + if (boostActionBuilder_ == null) { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 2) { + actionCase_ = 0; + action_ = null; + } + boostActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + public com.google.cloud.retail.v2beta.Rule.BoostAction.Builder getBoostActionBuilder() { + return getBoostActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder getBoostActionOrBuilder() { + if ((actionCase_ == 2) && (boostActionBuilder_ != null)) { + return boostActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 2) { + return (com.google.cloud.retail.v2beta.Rule.BoostAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * A boost action.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.BoostAction, + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder, + com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder> + getBoostActionFieldBuilder() { + if (boostActionBuilder_ == null) { + if (!(actionCase_ == 2)) { + action_ = com.google.cloud.retail.v2beta.Rule.BoostAction.getDefaultInstance(); + } + boostActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.BoostAction, + com.google.cloud.retail.v2beta.Rule.BoostAction.Builder, + com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.BoostAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 2; + onChanged(); + ; + return boostActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.RedirectAction, + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder> + redirectActionBuilder_; + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + @java.lang.Override + public boolean hasRedirectAction() { + return actionCase_ == 3; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectAction getRedirectAction() { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } else { + if (actionCase_ == 3) { + return redirectActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + public Builder setRedirectAction(com.google.cloud.retail.v2beta.Rule.RedirectAction value) { + if (redirectActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + redirectActionBuilder_.setMessage(value); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + public Builder setRedirectAction( + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder builderForValue) { + if (redirectActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + redirectActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + public Builder mergeRedirectAction(com.google.cloud.retail.v2beta.Rule.RedirectAction value) { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3 + && action_ != com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.RedirectAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 3) { + redirectActionBuilder_.mergeFrom(value); + } else { + redirectActionBuilder_.setMessage(value); + } + } + actionCase_ = 3; + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + public Builder clearRedirectAction() { + if (redirectActionBuilder_ == null) { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 3) { + actionCase_ = 0; + action_ = null; + } + redirectActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + public com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder getRedirectActionBuilder() { + return getRedirectActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder + getRedirectActionOrBuilder() { + if ((actionCase_ == 3) && (redirectActionBuilder_ != null)) { + return redirectActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 3) { + return (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Redirects a shopper to a specific page.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.RedirectAction, + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder> + getRedirectActionFieldBuilder() { + if (redirectActionBuilder_ == null) { + if (!(actionCase_ == 3)) { + action_ = com.google.cloud.retail.v2beta.Rule.RedirectAction.getDefaultInstance(); + } + redirectActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.RedirectAction, + com.google.cloud.retail.v2beta.Rule.RedirectAction.Builder, + com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.RedirectAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 3; + onChanged(); + ; + return redirectActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder> + onewaySynonymsActionBuilder_; + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * + * @return Whether the onewaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasOnewaySynonymsAction() { + return actionCase_ == 6; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * + * @return The onewaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction getOnewaySynonymsAction() { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } else { + if (actionCase_ == 6) { + return onewaySynonymsActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder setOnewaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction value) { + if (onewaySynonymsActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + onewaySynonymsActionBuilder_.setMessage(value); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder setOnewaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder builderForValue) { + if (onewaySynonymsActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + onewaySynonymsActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder mergeOnewaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction value) { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6 + && action_ + != com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 6) { + onewaySynonymsActionBuilder_.mergeFrom(value); + } else { + onewaySynonymsActionBuilder_.setMessage(value); + } + } + actionCase_ = 6; + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public Builder clearOnewaySynonymsAction() { + if (onewaySynonymsActionBuilder_ == null) { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 6) { + actionCase_ = 0; + action_ = null; + } + onewaySynonymsActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder + getOnewaySynonymsActionBuilder() { + return getOnewaySynonymsActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder() { + if ((actionCase_ == 6) && (onewaySynonymsActionBuilder_ != null)) { + return onewaySynonymsActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 6) { + return (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats specific term as a synonym with a group of terms.
+     * Group of terms will not be treated as synonyms with the specific term.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder> + getOnewaySynonymsActionFieldBuilder() { + if (onewaySynonymsActionBuilder_ == null) { + if (!(actionCase_ == 6)) { + action_ = com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.getDefaultInstance(); + } + onewaySynonymsActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 6; + onChanged(); + ; + return onewaySynonymsActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder> + doNotAssociateActionBuilder_; + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return Whether the doNotAssociateAction field is set. + */ + @java.lang.Override + public boolean hasDoNotAssociateAction() { + return actionCase_ == 7; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * + * @return The doNotAssociateAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction getDoNotAssociateAction() { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } else { + if (actionCase_ == 7) { + return doNotAssociateActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder setDoNotAssociateAction( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction value) { + if (doNotAssociateActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + doNotAssociateActionBuilder_.setMessage(value); + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder setDoNotAssociateAction( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder builderForValue) { + if (doNotAssociateActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + doNotAssociateActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder mergeDoNotAssociateAction( + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction value) { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7 + && action_ + != com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 7) { + doNotAssociateActionBuilder_.mergeFrom(value); + } else { + doNotAssociateActionBuilder_.setMessage(value); + } + } + actionCase_ = 7; + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public Builder clearDoNotAssociateAction() { + if (doNotAssociateActionBuilder_ == null) { + if (actionCase_ == 7) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 7) { + actionCase_ = 0; + action_ = null; + } + doNotAssociateActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder + getDoNotAssociateActionBuilder() { + return getDoNotAssociateActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder() { + if ((actionCase_ == 7) && (doNotAssociateActionBuilder_ != null)) { + return doNotAssociateActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 7) { + return (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Prevents term from being associated with other terms.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder> + getDoNotAssociateActionFieldBuilder() { + if (doNotAssociateActionBuilder_ == null) { + if (!(actionCase_ == 7)) { + action_ = com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.getDefaultInstance(); + } + doNotAssociateActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction.Builder, + com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 7; + onChanged(); + ; + return doNotAssociateActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.ReplacementAction, + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder> + replacementActionBuilder_; + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + @java.lang.Override + public boolean hasReplacementAction() { + return actionCase_ == 8; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementAction getReplacementAction() { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } else { + if (actionCase_ == 8) { + return replacementActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + public Builder setReplacementAction( + com.google.cloud.retail.v2beta.Rule.ReplacementAction value) { + if (replacementActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + replacementActionBuilder_.setMessage(value); + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + public Builder setReplacementAction( + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder builderForValue) { + if (replacementActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + replacementActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + public Builder mergeReplacementAction( + com.google.cloud.retail.v2beta.Rule.ReplacementAction value) { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8 + && action_ + != com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.ReplacementAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 8) { + replacementActionBuilder_.mergeFrom(value); + } else { + replacementActionBuilder_.setMessage(value); + } + } + actionCase_ = 8; + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + public Builder clearReplacementAction() { + if (replacementActionBuilder_ == null) { + if (actionCase_ == 8) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 8) { + actionCase_ = 0; + action_ = null; + } + replacementActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + public com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder + getReplacementActionBuilder() { + return getReplacementActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder + getReplacementActionOrBuilder() { + if ((actionCase_ == 8) && (replacementActionBuilder_ != null)) { + return replacementActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 8) { + return (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Replaces specific terms in the query.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.ReplacementAction, + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder> + getReplacementActionFieldBuilder() { + if (replacementActionBuilder_ == null) { + if (!(actionCase_ == 8)) { + action_ = com.google.cloud.retail.v2beta.Rule.ReplacementAction.getDefaultInstance(); + } + replacementActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.ReplacementAction, + com.google.cloud.retail.v2beta.Rule.ReplacementAction.Builder, + com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.ReplacementAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 8; + onChanged(); + ; + return replacementActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.IgnoreAction, + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder> + ignoreActionBuilder_; + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + @java.lang.Override + public boolean hasIgnoreAction() { + return actionCase_ == 9; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreAction getIgnoreAction() { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } else { + if (actionCase_ == 9) { + return ignoreActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + public Builder setIgnoreAction(com.google.cloud.retail.v2beta.Rule.IgnoreAction value) { + if (ignoreActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + ignoreActionBuilder_.setMessage(value); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + public Builder setIgnoreAction( + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder builderForValue) { + if (ignoreActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + ignoreActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + public Builder mergeIgnoreAction(com.google.cloud.retail.v2beta.Rule.IgnoreAction value) { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9 + && action_ != com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.IgnoreAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 9) { + ignoreActionBuilder_.mergeFrom(value); + } else { + ignoreActionBuilder_.setMessage(value); + } + } + actionCase_ = 9; + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + public Builder clearIgnoreAction() { + if (ignoreActionBuilder_ == null) { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 9) { + actionCase_ = 0; + action_ = null; + } + ignoreActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + public com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder getIgnoreActionBuilder() { + return getIgnoreActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder() { + if ((actionCase_ == 9) && (ignoreActionBuilder_ != null)) { + return ignoreActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 9) { + return (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ignores specific terms from query during search.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.IgnoreAction, + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder> + getIgnoreActionFieldBuilder() { + if (ignoreActionBuilder_ == null) { + if (!(actionCase_ == 9)) { + action_ = com.google.cloud.retail.v2beta.Rule.IgnoreAction.getDefaultInstance(); + } + ignoreActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.IgnoreAction, + com.google.cloud.retail.v2beta.Rule.IgnoreAction.Builder, + com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.IgnoreAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 9; + onChanged(); + ; + return ignoreActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.FilterAction, + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder, + com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder> + filterActionBuilder_; + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + @java.lang.Override + public boolean hasFilterAction() { + return actionCase_ == 10; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterAction getFilterAction() { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2beta.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } else { + if (actionCase_ == 10) { + return filterActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + public Builder setFilterAction(com.google.cloud.retail.v2beta.Rule.FilterAction value) { + if (filterActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + filterActionBuilder_.setMessage(value); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + public Builder setFilterAction( + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder builderForValue) { + if (filterActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + filterActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + public Builder mergeFilterAction(com.google.cloud.retail.v2beta.Rule.FilterAction value) { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10 + && action_ != com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.FilterAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.FilterAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 10) { + filterActionBuilder_.mergeFrom(value); + } else { + filterActionBuilder_.setMessage(value); + } + } + actionCase_ = 10; + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + public Builder clearFilterAction() { + if (filterActionBuilder_ == null) { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 10) { + actionCase_ = 0; + action_ = null; + } + filterActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + public com.google.cloud.retail.v2beta.Rule.FilterAction.Builder getFilterActionBuilder() { + return getFilterActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder getFilterActionOrBuilder() { + if ((actionCase_ == 10) && (filterActionBuilder_ != null)) { + return filterActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 10) { + return (com.google.cloud.retail.v2beta.Rule.FilterAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filters results.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.FilterAction, + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder, + com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder> + getFilterActionFieldBuilder() { + if (filterActionBuilder_ == null) { + if (!(actionCase_ == 10)) { + action_ = com.google.cloud.retail.v2beta.Rule.FilterAction.getDefaultInstance(); + } + filterActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.FilterAction, + com.google.cloud.retail.v2beta.Rule.FilterAction.Builder, + com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.FilterAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 10; + onChanged(); + ; + return filterActionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder> + twowaySynonymsActionBuilder_; + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return Whether the twowaySynonymsAction field is set. + */ + @java.lang.Override + public boolean hasTwowaySynonymsAction() { + return actionCase_ == 11; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * + * @return The twowaySynonymsAction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction getTwowaySynonymsAction() { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } else { + if (actionCase_ == 11) { + return twowaySynonymsActionBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder setTwowaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction value) { + if (twowaySynonymsActionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + twowaySynonymsActionBuilder_.setMessage(value); + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder setTwowaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder builderForValue) { + if (twowaySynonymsActionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + twowaySynonymsActionBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder mergeTwowaySynonymsAction( + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction value) { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11 + && action_ + != com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance()) { + action_ = + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.newBuilder( + (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 11) { + twowaySynonymsActionBuilder_.mergeFrom(value); + } else { + twowaySynonymsActionBuilder_.setMessage(value); + } + } + actionCase_ = 11; + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public Builder clearTwowaySynonymsAction() { + if (twowaySynonymsActionBuilder_ == null) { + if (actionCase_ == 11) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 11) { + actionCase_ = 0; + action_ = null; + } + twowaySynonymsActionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder + getTwowaySynonymsActionBuilder() { + return getTwowaySynonymsActionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder() { + if ((actionCase_ == 11) && (twowaySynonymsActionBuilder_ != null)) { + return twowaySynonymsActionBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 11) { + return (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_; + } + return com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + } + /** + * + * + *
+     * Treats a set of terms as synonyms of one another.
+     * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder> + getTwowaySynonymsActionFieldBuilder() { + if (twowaySynonymsActionBuilder_ == null) { + if (!(actionCase_ == 11)) { + action_ = com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.getDefaultInstance(); + } + twowaySynonymsActionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.Builder, + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder>( + (com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 11; + onChanged(); + ; + return twowaySynonymsActionBuilder_; + } + + private com.google.cloud.retail.v2beta.Condition condition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition, + com.google.cloud.retail.v2beta.Condition.Builder, + com.google.cloud.retail.v2beta.ConditionOrBuilder> + conditionBuilder_; + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + public boolean hasCondition() { + return conditionBuilder_ != null || condition_ != null; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + public com.google.cloud.retail.v2beta.Condition getCondition() { + if (conditionBuilder_ == null) { + return condition_ == null + ? com.google.cloud.retail.v2beta.Condition.getDefaultInstance() + : condition_; + } else { + return conditionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCondition(com.google.cloud.retail.v2beta.Condition value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + onChanged(); + } else { + conditionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCondition(com.google.cloud.retail.v2beta.Condition.Builder builderForValue) { + if (conditionBuilder_ == null) { + condition_ = builderForValue.build(); + onChanged(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCondition(com.google.cloud.retail.v2beta.Condition value) { + if (conditionBuilder_ == null) { + if (condition_ != null) { + condition_ = + com.google.cloud.retail.v2beta.Condition.newBuilder(condition_) + .mergeFrom(value) + .buildPartial(); + } else { + condition_ = value; + } + onChanged(); + } else { + conditionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCondition() { + if (conditionBuilder_ == null) { + condition_ = null; + onChanged(); + } else { + condition_ = null; + conditionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Condition.Builder getConditionBuilder() { + + onChanged(); + return getConditionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ConditionOrBuilder getConditionOrBuilder() { + if (conditionBuilder_ != null) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + return condition_ == null + ? com.google.cloud.retail.v2beta.Condition.getDefaultInstance() + : condition_; + } + } + /** + * + * + *
+     * Required. The condition that triggers the rule.
+     * If the condition is empty, the rule will always apply.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition, + com.google.cloud.retail.v2beta.Condition.Builder, + com.google.cloud.retail.v2beta.ConditionOrBuilder> + getConditionFieldBuilder() { + if (conditionBuilder_ == null) { + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Condition, + com.google.cloud.retail.v2beta.Condition.Builder, + com.google.cloud.retail.v2beta.ConditionOrBuilder>( + getCondition(), getParentForChildren(), isClean()); + condition_ = null; + } + return conditionBuilder_; + } + + @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.Rule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Rule) + private static final com.google.cloud.retail.v2beta.Rule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Rule(); + } + + public static com.google.cloud.retail.v2beta.Rule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rule(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.Rule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RuleOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RuleOrBuilder.java new file mode 100644 index 00000000..8053736d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RuleOrBuilder.java @@ -0,0 +1,357 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return Whether the boostAction field is set. + */ + boolean hasBoostAction(); + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + * + * @return The boostAction. + */ + com.google.cloud.retail.v2beta.Rule.BoostAction getBoostAction(); + /** + * + * + *
+   * A boost action.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2; + */ + com.google.cloud.retail.v2beta.Rule.BoostActionOrBuilder getBoostActionOrBuilder(); + + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return Whether the redirectAction field is set. + */ + boolean hasRedirectAction(); + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + * + * @return The redirectAction. + */ + com.google.cloud.retail.v2beta.Rule.RedirectAction getRedirectAction(); + /** + * + * + *
+   * Redirects a shopper to a specific page.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3; + */ + com.google.cloud.retail.v2beta.Rule.RedirectActionOrBuilder getRedirectActionOrBuilder(); + + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return Whether the onewaySynonymsAction field is set. + */ + boolean hasOnewaySynonymsAction(); + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + * + * @return The onewaySynonymsAction. + */ + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsAction getOnewaySynonymsAction(); + /** + * + * + *
+   * Treats specific term as a synonym with a group of terms.
+   * Group of terms will not be treated as synonyms with the specific term.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6; + */ + com.google.cloud.retail.v2beta.Rule.OnewaySynonymsActionOrBuilder + getOnewaySynonymsActionOrBuilder(); + + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * @return Whether the doNotAssociateAction field is set. + */ + boolean hasDoNotAssociateAction(); + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + * + * @return The doNotAssociateAction. + */ + com.google.cloud.retail.v2beta.Rule.DoNotAssociateAction getDoNotAssociateAction(); + /** + * + * + *
+   * Prevents term from being associated with other terms.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7; + */ + com.google.cloud.retail.v2beta.Rule.DoNotAssociateActionOrBuilder + getDoNotAssociateActionOrBuilder(); + + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return Whether the replacementAction field is set. + */ + boolean hasReplacementAction(); + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + * + * @return The replacementAction. + */ + com.google.cloud.retail.v2beta.Rule.ReplacementAction getReplacementAction(); + /** + * + * + *
+   * Replaces specific terms in the query.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8; + */ + com.google.cloud.retail.v2beta.Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder(); + + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return Whether the ignoreAction field is set. + */ + boolean hasIgnoreAction(); + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + * + * @return The ignoreAction. + */ + com.google.cloud.retail.v2beta.Rule.IgnoreAction getIgnoreAction(); + /** + * + * + *
+   * Ignores specific terms from query during search.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9; + */ + com.google.cloud.retail.v2beta.Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder(); + + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return Whether the filterAction field is set. + */ + boolean hasFilterAction(); + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + * + * @return The filterAction. + */ + com.google.cloud.retail.v2beta.Rule.FilterAction getFilterAction(); + /** + * + * + *
+   * Filters results.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10; + */ + com.google.cloud.retail.v2beta.Rule.FilterActionOrBuilder getFilterActionOrBuilder(); + + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * @return Whether the twowaySynonymsAction field is set. + */ + boolean hasTwowaySynonymsAction(); + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + * + * @return The twowaySynonymsAction. + */ + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction getTwowaySynonymsAction(); + /** + * + * + *
+   * Treats a set of terms as synonyms of one another.
+   * 
+ * + * .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11; + */ + com.google.cloud.retail.v2beta.Rule.TwowaySynonymsActionOrBuilder + getTwowaySynonymsActionOrBuilder(); + + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The condition. + */ + com.google.cloud.retail.v2beta.Condition getCondition(); + /** + * + * + *
+   * Required. The condition that triggers the rule.
+   * If the condition is empty, the rule will always apply.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ConditionOrBuilder getConditionOrBuilder(); + + public com.google.cloud.retail.v2beta.Rule.ActionCase getActionCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java new file mode 100644 index 00000000..90c55c2d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java @@ -0,0 +1,16665 @@ +/* + * 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/search_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for
+ * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest} + */ +public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest) + SearchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchRequest.newBuilder() to construct. + private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchRequest() { + placement_ = ""; + branch_ = ""; + query_ = ""; + visitorId_ = ""; + pageToken_ = ""; + filter_ = ""; + canonicalFilter_ = ""; + orderBy_ = ""; + facetSpecs_ = java.util.Collections.emptyList(); + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + searchMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchRequest( + 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(); + + placement_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branch_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + case 42: + { + com.google.cloud.retail.v2beta.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + offset_ = input.readInt32(); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec>(); + mutable_bitField0_ |= 0x00000001; + } + facetSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.parser(), + extensionRegistry)); + break; + } + case 106: + { + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder subBuilder = null; + if (boostSpec_ != null) { + subBuilder = boostSpec_.toBuilder(); + } + boostSpec_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boostSpec_); + boostSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder subBuilder = + null; + if (queryExpansionSpec_ != null) { + subBuilder = queryExpansionSpec_.toBuilder(); + } + queryExpansionSpec_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionSpec_); + queryExpansionSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + variantRollupKeys_.add(s); + break; + } + case 170: + { + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder subBuilder = + null; + if (dynamicFacetSpec_ != null) { + subBuilder = dynamicFacetSpec_.toBuilder(); + } + dynamicFacetSpec_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicFacetSpec_); + dynamicFacetSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 186: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + pageCategories_.add(s); + break; + } + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + + canonicalFilter_ = s; + break; + } + case 248: + { + int rawValue = input.readEnum(); + + searchMode_ = rawValue; + break; + } + case 258: + { + 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: + { + 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)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.class, + com.google.cloud.retail.v2beta.SearchRequest.Builder.class); + } + + /** + * + * + *
+   * The search mode of each search request.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SearchRequest.SearchMode} + */ + 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.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + 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
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * or
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
+     * is set.
+     * 
+ * + * PRODUCT_SEARCH_ONLY = 1; + */ + PRODUCT_SEARCH_ONLY(1), + /** + * + * + *
+     * Only faceted search will be performed. The product search will be
+     * disabled.
+     * When in this mode, one or both of [SearchRequest.facet_spec][] 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]
+     * will not be returned.
+     * 
+ * + * FACETED_SEARCH_ONLY = 2; + */ + FACETED_SEARCH_ONLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. In this case both product search and faceted search will
+     * be performed. Both [SearchResponse.SearchResult] and
+     * [SearchResponse.Facet] will be returned.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + public static final int SEARCH_MODE_UNSPECIFIED_VALUE = 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
+     * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
+     * or
+     * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
+     * is set.
+     * 
+ * + * PRODUCT_SEARCH_ONLY = 1; + */ + public static final int PRODUCT_SEARCH_ONLY_VALUE = 1; + /** + * + * + *
+     * Only faceted search will be performed. The product search will be
+     * disabled.
+     * When in this mode, one or both of [SearchRequest.facet_spec][] 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]
+     * will not be returned.
+     * 
+ * + * FACETED_SEARCH_ONLY = 2; + */ + public static final int FACETED_SEARCH_ONLY_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 SearchMode 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 SearchMode forNumber(int value) { + switch (value) { + case 0: + return SEARCH_MODE_UNSPECIFIED; + case 1: + return PRODUCT_SEARCH_ONLY; + case 2: + return FACETED_SEARCH_ONLY; + 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 SearchMode findValueByNumber(int number) { + return SearchMode.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.SearchRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final SearchMode[] VALUES = values(); + + public static SearchMode 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 SearchMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SearchRequest.SearchMode) + } + + public interface FacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.FacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + boolean hasFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey getFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder getFacetKeyOrBuilder(); + + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + int getLimit(); + + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + java.util.List getExcludedFilterKeysList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + int getExcludedFilterKeysCount(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + java.lang.String getExcludedFilterKeys(int index); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index); + + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + boolean getEnableDynamicPosition(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.FacetSpec} + */ + public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.FacetSpec) + FacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetSpec.newBuilder() to construct. + private FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetSpec() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetSpec( + 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: + { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder subBuilder = + null; + if (facetKey_ != null) { + subBuilder = facetKey_.toBuilder(); + } + facetKey_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(facetKey_); + facetKey_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + limit_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + excludedFilterKeys_.add(s); + break; + } + case 32: + { + enableDynamicPosition_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder.class); + } + + public interface FacetKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2beta.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2beta.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + java.util.List getIntervalsList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + com.google.cloud.retail.v2beta.Interval getIntervals(int index); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + int getIntervalsCount(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + java.util.List + getIntervalsOrBuilderList(); + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalsOrBuilder(int index); + + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + java.util.List getRestrictedValuesList(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + int getRestrictedValuesCount(); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + java.lang.String getRestrictedValues(int index); + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + com.google.protobuf.ByteString getRestrictedValuesBytes(int index); + + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + java.util.List getPrefixesList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + int getPrefixesCount(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + java.lang.String getPrefixes(int index); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + com.google.protobuf.ByteString getPrefixesBytes(int index); + + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + java.util.List getContainsList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + int getContainsCount(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + java.lang.String getContains(int index); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + com.google.protobuf.ByteString getContainsBytes(int index); + + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + } + /** + * + * + *
+     * Specifies how a facet is computed.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} + */ + public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + FacetKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetKey.newBuilder() to construct. + private FacetKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetKey() { + key_ = ""; + intervals_ = java.util.Collections.emptyList(); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + orderBy_ = ""; + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetKey(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetKey( + 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(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + intervals_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + intervals_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Interval.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + restrictedValues_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + prefixes_.add(s); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + contains_.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)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2beta.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Product][google.cloud.retail.v2beta.Product] object, over which the
+       * facet values are computed. Facet key is case-sensitive.
+       * Allowed facet keys when
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is not specified:
+       * * textual_field =
+       *     * "brands"
+       *     * "categories"
+       *     * "genders"
+       *     * "ageGroups"
+       *     * "availability"
+       *     * "colorFamilies"
+       *     * "colors"
+       *     * "sizes"
+       *     * "materials"
+       *     * "patterns"
+       *     * "conditions"
+       *     * "attributes.key"
+       *     * "pickupInStore"
+       *     * "shipToStore"
+       *     * "sameDayDelivery"
+       *     * "nextDayDelivery"
+       *     * "customFulfillment1"
+       *     * "customFulfillment2"
+       *     * "customFulfillment3"
+       *     * "customFulfillment4"
+       *     * "customFulfillment5"
+       *     * "inventory(place_id,attributes.key)"
+       * * numerical_field =
+       *     * "price"
+       *     * "discount"
+       *     * "rating"
+       *     * "ratingCount"
+       *     * "attributes.key"
+       *     * "inventory(place_id,price)"
+       *     * "inventory(place_id,original_price)"
+       *     * "inventory(place_id,attributes.key)"
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVALS_FIELD_NUMBER = 2; + private java.util.List intervals_; + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List getIntervalsList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List + getIntervalsOrBuilderList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + @java.lang.Override + public int getIntervalsCount() { + return intervals_.size(); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getIntervals(int index) { + return intervals_.get(index); + } + /** + * + * + *
+       * Set only if values should be bucketized into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalsOrBuilder(int index) { + return intervals_.get(index); + } + + public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList restrictedValues_; + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_; + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+       * Only get facet for the given restricted values. For example, when using
+       * "pickupInStore" as key and set restricted values to
+       * ["store123", "store456"], only facets for "store123" and "store456" are
+       * returned. Only supported on textual fields and fulfillments.
+       * Maximum is 20.
+       * Must be set for the fulfillment facet keys:
+       * * pickupInStore
+       * * shipToStore
+       * * sameDayDelivery
+       * * nextDayDelivery
+       * * customFulfillment1
+       * * customFulfillment2
+       * * customFulfillment3
+       * * customFulfillment4
+       * * customFulfillment5
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + + public static final int PREFIXES_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList prefixes_; + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_; + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+       * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + + public static final int CONTAINS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList contains_; + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_; + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "categories" has three values "Women > Shoe",
+       * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+       * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+       * The order in which [Facet.values][] are returned.
+       * Allowed values are:
+       * * "count desc", which means order by [Facet.FacetValue.count][]
+       * descending.
+       * * "value desc", which means order by [Facet.FacetValue.value][]
+       * descending.
+       *   Only applies to textual facets.
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+       * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+       * are sorted in the order given by
+       * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+       * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 5; + private volatile java.lang.Object query_; + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+       * The query that is used to compute facet for the given facet key.
+       * When provided, it will override the default behavior of facet
+       * computation. The query syntax is the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations. Notice that there is no limitation
+       * on
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * when query is specified.
+       * In the response, [FacetValue.value][] will be always "1" and
+       * [FacetValue.count][] will be the number of results that matches the
+       * query.
+       * For example, you can set a customized facet for "shipToStore",
+       * where
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is "customizedShipToStore", and
+       * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+       * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+       * Then the facet will count the products that are both in stock and ship
+       * to store "123".
+       * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + output.writeMessage(2, intervals_.get(i)); + } + for (int i = 0; i < restrictedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, restrictedValues_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, query_); + } + for (int i = 0; i < prefixes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, prefixes_.getRaw(i)); + } + for (int i = 0; i < contains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, contains_.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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, intervals_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedValuesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, query_); + } + { + int dataSize = 0; + for (int i = 0; i < prefixes_.size(); i++) { + dataSize += computeStringSizeNoTag(prefixes_.getRaw(i)); + } + size += dataSize; + size += 1 * getPrefixesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < contains_.size(); i++) { + dataSize += computeStringSizeNoTag(contains_.getRaw(i)); + } + size += dataSize; + size += 1 * getContainsList().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.SearchRequest.FacetSpec.FacetKey)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey other = + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getIntervalsList().equals(other.getIntervalsList())) return false; + if (!getRestrictedValuesList().equals(other.getRestrictedValuesList())) return false; + if (!getPrefixesList().equals(other.getPrefixesList())) return false; + if (!getContainsList().equals(other.getContainsList())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getQuery().equals(other.getQuery())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getIntervalsCount() > 0) { + hash = (37 * hash) + INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getIntervalsList().hashCode(); + } + if (getRestrictedValuesCount() > 0) { + hash = (37 * hash) + RESTRICTED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedValuesList().hashCode(); + } + if (getPrefixesCount() > 0) { + hash = (37 * hash) + PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getPrefixesList().hashCode(); + } + if (getContainsCount() > 0) { + hash = (37 * hash) + CONTAINS_FIELD_NUMBER; + hash = (53 * hash) + getContainsList().hashCode(); + } + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + 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.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey 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.SearchRequest.FacetSpec.FacetKey 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; + } + /** + * + * + *
+       * Specifies how a facet is computed.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntervalsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + intervalsBuilder_.clear(); + } + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + orderBy_ = ""; + + query_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey build() { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey result = + new com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (intervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.intervals_ = intervals_; + } else { + result.intervals_ = intervalsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = restrictedValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.restrictedValues_ = restrictedValues_; + if (((bitField0_ & 0x00000004) != 0)) { + prefixes_ = prefixes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.prefixes_ = prefixes_; + if (((bitField0_ & 0x00000008) != 0)) { + contains_ = contains_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.contains_ = contains_; + result.orderBy_ = orderBy_; + result.query_ = query_; + 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.SearchRequest.FacetSpec.FacetKey) { + return mergeFrom( + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey other) { + if (other + == com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (intervalsBuilder_ == null) { + if (!other.intervals_.isEmpty()) { + if (intervals_.isEmpty()) { + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIntervalsIsMutable(); + intervals_.addAll(other.intervals_); + } + onChanged(); + } + } else { + if (!other.intervals_.isEmpty()) { + if (intervalsBuilder_.isEmpty()) { + intervalsBuilder_.dispose(); + intervalsBuilder_ = null; + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000001); + intervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntervalsFieldBuilder() + : null; + } else { + intervalsBuilder_.addAllMessages(other.intervals_); + } + } + } + if (!other.restrictedValues_.isEmpty()) { + if (restrictedValues_.isEmpty()) { + restrictedValues_ = other.restrictedValues_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRestrictedValuesIsMutable(); + restrictedValues_.addAll(other.restrictedValues_); + } + onChanged(); + } + if (!other.prefixes_.isEmpty()) { + if (prefixes_.isEmpty()) { + prefixes_ = other.prefixes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePrefixesIsMutable(); + prefixes_.addAll(other.prefixes_); + } + onChanged(); + } + if (!other.contains_.isEmpty()) { + if (contains_.isEmpty()) { + contains_ = other.contains_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureContainsIsMutable(); + contains_.addAll(other.contains_); + } + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + 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.SearchRequest.FacetSpec.FacetKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2beta.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2beta.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2beta.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2beta.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Product][google.cloud.retail.v2beta.Product] object, over which the
+         * facet values are computed. Facet key is case-sensitive.
+         * Allowed facet keys when
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is not specified:
+         * * textual_field =
+         *     * "brands"
+         *     * "categories"
+         *     * "genders"
+         *     * "ageGroups"
+         *     * "availability"
+         *     * "colorFamilies"
+         *     * "colors"
+         *     * "sizes"
+         *     * "materials"
+         *     * "patterns"
+         *     * "conditions"
+         *     * "attributes.key"
+         *     * "pickupInStore"
+         *     * "shipToStore"
+         *     * "sameDayDelivery"
+         *     * "nextDayDelivery"
+         *     * "customFulfillment1"
+         *     * "customFulfillment2"
+         *     * "customFulfillment3"
+         *     * "customFulfillment4"
+         *     * "customFulfillment5"
+         *     * "inventory(place_id,attributes.key)"
+         * * numerical_field =
+         *     * "price"
+         *     * "discount"
+         *     * "rating"
+         *     * "ratingCount"
+         *     * "attributes.key"
+         *     * "inventory(place_id,price)"
+         *     * "inventory(place_id,original_price)"
+         *     * "inventory(place_id,attributes.key)"
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List intervals_ = + java.util.Collections.emptyList(); + + private void ensureIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + intervals_ = + new java.util.ArrayList(intervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + intervalsBuilder_; + + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public java.util.List getIntervalsList() { + if (intervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(intervals_); + } else { + return intervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public int getIntervalsCount() { + if (intervalsBuilder_ == null) { + return intervals_.size(); + } else { + return intervalsBuilder_.getCount(); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public com.google.cloud.retail.v2beta.Interval getIntervals(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder setIntervals(int index, com.google.cloud.retail.v2beta.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.set(index, value); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.set(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder addIntervals(com.google.cloud.retail.v2beta.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(value); + onChanged(); + } else { + intervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder addIntervals(int index, com.google.cloud.retail.v2beta.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(index, value); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder addIntervals( + com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder addAllIntervals( + java.lang.Iterable values) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_); + onChanged(); + } else { + intervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder clearIntervals() { + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + intervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public Builder removeIntervals(int index) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.remove(index); + onChanged(); + } else { + intervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public com.google.cloud.retail.v2beta.Interval.Builder getIntervalsBuilder(int index) { + return getIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalsOrBuilder(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public java.util.List + getIntervalsOrBuilderList() { + if (intervalsBuilder_ != null) { + return intervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intervals_); + } + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public com.google.cloud.retail.v2beta.Interval.Builder addIntervalsBuilder() { + return getIntervalsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public com.google.cloud.retail.v2beta.Interval.Builder addIntervalsBuilder(int index) { + return getIntervalsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketized into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.retail.v2beta.Interval intervals = 2; + */ + public java.util.List + getIntervalsBuilderList() { + return getIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + getIntervalsFieldBuilder() { + if (intervalsBuilder_ == null) { + intervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder>( + intervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + intervals_ = null; + } + return intervalsBuilder_; + } + + private com.google.protobuf.LazyStringList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRestrictedValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index to set the value at. + * @param value The restrictedValues to set. + * @return This builder for chaining. + */ + public Builder setRestrictedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param values The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedValues(java.lang.Iterable values) { + ensureRestrictedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedValues() { + restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. For example, when using
+         * "pickupInStore" as key and set restricted values to
+         * ["store123", "store456"], only facets for "store123" and "store456" are
+         * returned. Only supported on textual fields and fulfillments.
+         * Maximum is 20.
+         * Must be set for the fulfillment facet keys:
+         * * pickupInStore
+         * * shipToStore
+         * * sameDayDelivery
+         * * nextDayDelivery
+         * * customFulfillment1
+         * * customFulfillment2
+         * * customFulfillment3
+         * * customFulfillment4
+         * * customFulfillment5
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The bytes of the restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList prefixes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePrefixesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param index The index to set the value at. + * @param value The prefixes to set. + * @return This builder for chaining. + */ + public Builder setPrefixes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param values The prefixes to add. + * @return This builder for chaining. + */ + public Builder addAllPrefixes(java.lang.Iterable values) { + ensurePrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @return This builder for chaining. + */ + public Builder clearPrefixes() { + prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
+         * "categories" facet will give only "Women > Shoe" and "Women > Dress".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 8; + * + * @param value The bytes of the prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePrefixesIsMutable(); + prefixes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList contains_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureContainsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + contains_ = new com.google.protobuf.LazyStringArrayList(contains_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_.getUnmodifiableView(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param index The index to set the value at. + * @param value The contains to set. + * @return This builder for chaining. + */ + public Builder setContains(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The contains to add. + * @return This builder for chaining. + */ + public Builder addContains(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param values The contains to add. + * @return This builder for chaining. + */ + public Builder addAllContains(java.lang.Iterable values) { + ensureContainsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @return This builder for chaining. + */ + public Builder clearContains() { + contains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "categories" has three values "Women > Shoe",
+         * "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
+         * "categories" facet will give only "Women > Shoe" and "Men > Shoe".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 9; + * + * @param value The bytes of the contains to add. + * @return This builder for chaining. + */ + public Builder addContainsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContainsIsMutable(); + contains_.add(value); + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which [Facet.values][] are returned.
+         * Allowed values are:
+         * * "count desc", which means order by [Facet.FacetValue.count][]
+         * descending.
+         * * "value desc", which means order by [Facet.FacetValue.value][]
+         * descending.
+         *   Only applies to textual facets.
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals];
+         * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+         * are sorted in the order given by
+         * [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values].
+         * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+         * The query that is used to compute facet for the given facet key.
+         * When provided, it will override the default behavior of facet
+         * computation. The query syntax is the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations. Notice that there is no limitation
+         * on
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * when query is specified.
+         * In the response, [FacetValue.value][] will be always "1" and
+         * [FacetValue.count][] will be the number of results that matches the
+         * query.
+         * For example, you can set a customized facet for "shipToStore",
+         * where
+         * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+         * is "customizedShipToStore", and
+         * [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query]
+         * is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
+         * Then the facet will count the products that are both in stock and ship
+         * to store "123".
+         * 
+ * + * string query = 5; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = 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.SearchRequest.FacetSpec.FacetKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey) + private static final com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetKey(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.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FACET_KEY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facetKey_; + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + @java.lang.Override + public boolean hasFacetKey() { + return facetKey_ != null; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey getFacetKey() { + return facetKey_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + return getFacetKey(); + } + + public static final int LIMIT_FIELD_NUMBER = 2; + private int limit_; + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 will be coerced to 300.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int EXCLUDED_FILTER_KEYS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList excludedFilterKeys_; + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_; + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     * By default,
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     * For example, suppose there are 100 products with color facet "Red" and
+     * 200 products with color facet "Blue". A query containing the filter
+     * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+     * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+     * will by default return the "Red" with count 100.
+     * If this field contains "colorFamilies", then the query returns both the
+     * "Red" with count 100 and "Blue" with count 200, because the
+     * "colorFamilies" key is now excluded from the filter.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + + public static final int ENABLE_DYNAMIC_POSITION_FIELD_NUMBER = 4; + private boolean enableDynamicPosition_; + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined by Google
+     * Retail Search. It will be ordered together with dynamic facets if dynamic
+     * facets is enabled. If set to false, the position of this facet in the
+     * response will be the same as in the request, and it will be ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response will be determined by
+     * Google Retail Search.
+     * Another example, assuming you have the following facets in the request:
+     * * "rating", enable_dynamic_position = true
+     * * "price", enable_dynamic_position = false
+     * * "brands", enable_dynamic_position = false
+     * And also you have a dynamic facets enable, which will generate a facet
+     * 'gender'. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how Google Retail Search orders "gender" and
+     * "rating" facets. However, notice that "price" and "brands" will always be
+     * ranked at 1st and 2nd position since their enable_dynamic_position are
+     * false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + + 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 (facetKey_ != null) { + output.writeMessage(1, getFacetKey()); + } + if (limit_ != 0) { + output.writeInt32(2, limit_); + } + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, excludedFilterKeys_.getRaw(i)); + } + if (enableDynamicPosition_ != false) { + output.writeBool(4, enableDynamicPosition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFacetKey()); + } + if (limit_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, limit_); + } + { + int dataSize = 0; + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(excludedFilterKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getExcludedFilterKeysList().size(); + } + if (enableDynamicPosition_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enableDynamicPosition_); + } + 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.SearchRequest.FacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) obj; + + if (hasFacetKey() != other.hasFacetKey()) return false; + if (hasFacetKey()) { + if (!getFacetKey().equals(other.getFacetKey())) return false; + } + if (getLimit() != other.getLimit()) return false; + if (!getExcludedFilterKeysList().equals(other.getExcludedFilterKeysList())) return false; + if (getEnableDynamicPosition() != other.getEnableDynamicPosition()) 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 (hasFacetKey()) { + hash = (37 * hash) + FACET_KEY_FIELD_NUMBER; + hash = (53 * hash) + getFacetKey().hashCode(); + } + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + if (getExcludedFilterKeysCount() > 0) { + hash = (37 * hash) + EXCLUDED_FILTER_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedFilterKeysList().hashCode(); + } + hash = (37 * hash) + ENABLE_DYNAMIC_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPosition()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec 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.SearchRequest.FacetSpec 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; + } + /** + * + * + *
+     * A facet specification to perform faceted search.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.FacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.FacetSpec) + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.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 (facetKeyBuilder_ == null) { + facetKey_ = null; + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + limit_ = 0; + + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + enableDynamicPosition_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.FacetSpec(this); + int from_bitField0_ = bitField0_; + if (facetKeyBuilder_ == null) { + result.facetKey_ = facetKey_; + } else { + result.facetKey_ = facetKeyBuilder_.build(); + } + result.limit_ = limit_; + if (((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.excludedFilterKeys_ = excludedFilterKeys_; + result.enableDynamicPosition_ = enableDynamicPosition_; + 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.SearchRequest.FacetSpec) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec other) { + if (other == com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance()) + return this; + if (other.hasFacetKey()) { + mergeFacetKey(other.getFacetKey()); + } + if (other.getLimit() != 0) { + setLimit(other.getLimit()); + } + if (!other.excludedFilterKeys_.isEmpty()) { + if (excludedFilterKeys_.isEmpty()) { + excludedFilterKeys_ = other.excludedFilterKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.addAll(other.excludedFilterKeys_); + } + onChanged(); + } + if (other.getEnableDynamicPosition() != false) { + setEnableDynamicPosition(other.getEnableDynamicPosition()); + } + 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.SearchRequest.FacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facetKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder> + facetKeyBuilder_; + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + public boolean hasFacetKey() { + return facetKeyBuilder_ != null || facetKey_ != null; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey getFacetKey() { + if (facetKeyBuilder_ == null) { + return facetKey_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } else { + return facetKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetKey_ = value; + onChanged(); + } else { + facetKeyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder builderForValue) { + if (facetKeyBuilder_ == null) { + facetKey_ = builderForValue.build(); + onChanged(); + } else { + facetKeyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFacetKey( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (facetKey_ != null) { + facetKey_ = + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.newBuilder( + facetKey_) + .mergeFrom(value) + .buildPartial(); + } else { + facetKey_ = value; + } + onChanged(); + } else { + facetKeyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFacetKey() { + if (facetKeyBuilder_ == null) { + facetKey_ = null; + onChanged(); + } else { + facetKey_ = null; + facetKeyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder + getFacetKeyBuilder() { + + onChanged(); + return getFacetKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + if (facetKeyBuilder_ != null) { + return facetKeyBuilder_.getMessageOrBuilder(); + } else { + return facetKey_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.getDefaultInstance() + : facetKey_; + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder> + getFacetKeyFieldBuilder() { + if (facetKeyBuilder_ == null) { + facetKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKeyOrBuilder>( + getFacetKey(), getParentForChildren(), isClean()); + facetKey_ = null; + } + return facetKeyBuilder_; + } + + private int limit_; + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 will be coerced to 300.
+       * If this field is negative, an INVALID_ARGUMENT is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimit() { + + limit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExcludedFilterKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_.getUnmodifiableView(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index to set the value at. + * @param value The excludedFilterKeys to set. + * @return This builder for chaining. + */ + public Builder setExcludedFilterKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param values The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addAllExcludedFilterKeys(java.lang.Iterable values) { + ensureExcludedFilterKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return This builder for chaining. + */ + public Builder clearExcludedFilterKeys() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       * By default,
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       * For example, suppose there are 100 products with color facet "Red" and
+       * 200 products with color facet "Blue". A query containing the filter
+       * "colorFamilies:ANY("Red")" and have "colorFamilies" as
+       * [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key]
+       * will by default return the "Red" with count 100.
+       * If this field contains "colorFamilies", then the query returns both the
+       * "Red" with count 100 and "Blue" with count 200, because the
+       * "colorFamilies" key is now excluded from the filter.
+       * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+       * is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The bytes of the excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + onChanged(); + return this; + } + + private boolean enableDynamicPosition_; + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @param value The enableDynamicPosition to set. + * @return This builder for chaining. + */ + public Builder setEnableDynamicPosition(boolean value) { + + enableDynamicPosition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined by Google
+       * Retail Search. It will be ordered together with dynamic facets if dynamic
+       * facets is enabled. If set to false, the position of this facet in the
+       * response will be the same as in the request, and it will be ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response will be determined by
+       * Google Retail Search.
+       * Another example, assuming you have the following facets in the request:
+       * * "rating", enable_dynamic_position = true
+       * * "price", enable_dynamic_position = false
+       * * "brands", enable_dynamic_position = false
+       * And also you have a dynamic facets enable, which will generate a facet
+       * 'gender'. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how Google Retail Search orders "gender" and
+       * "rating" facets. However, notice that "price" and "brands" will always be
+       * ranked at 1st and 2nd position since their enable_dynamic_position are
+       * false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnableDynamicPosition() { + + enableDynamicPosition_ = 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.SearchRequest.FacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.FacetSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.FacetSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.FacetSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetSpec(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.SearchRequest.FacetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DynamicFacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode getMode(); + } + /** + * + * + *
+   * The specifications of dynamically generated facets.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} + */ + public static final class DynamicFacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + DynamicFacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DynamicFacetSpec.newBuilder() to construct. + private DynamicFacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DynamicFacetSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DynamicFacetSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DynamicFacetSpec( + 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 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder.class); + } + + /** + * + * + *
+     * Enum to control DynamicFacet mode
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + ENABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value.
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disable Dynamic Facet.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic mode built by Google Retail Search.
+       * 
+ * + * ENABLED = 2; + */ + public static final int 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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return 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 Mode findValueByNumber(int number) { + return Mode.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.SearchRequest.DynamicFacetSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Mode of the DynamicFacet feature.
+     * Defaults to
+     * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+     * if it's unset.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + + 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 (mode_ + != com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + 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.SearchRequest.DynamicFacetSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) obj; + + if (mode_ != other.mode_) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec 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.SearchRequest.DynamicFacetSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The specifications of dynamically generated facets.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.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(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec(this); + result.mode_ = mode_; + 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.SearchRequest.DynamicFacetSpec) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec other) { + if (other + == com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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.SearchRequest.DynamicFacetSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode result = + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Mode of the DynamicFacet feature.
+       * Defaults to
+       * [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED]
+       * if it's unset.
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 0; + 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.SearchRequest.DynamicFacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DynamicFacetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicFacetSpec(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.SearchRequest.DynamicFacetSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.BoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List + getConditionBoostSpecsList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + int getConditionBoostSpecsCount(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index); + + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + boolean hasSkipBoostSpecValidation(); + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + boolean getSkipBoostSpecValidation(); + } + /** + * + * + *
+   * Boost specification to boost certain items.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.BoostSpec} + */ + public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.BoostSpec) + BoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostSpec.newBuilder() to construct. + private BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostSpec() { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoostSpec( + 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)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec + .ConditionBoostSpec>(); + mutable_bitField0_ |= 0x00000001; + } + conditionBoostSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .parser(), + extensionRegistry)); + break; + } + case 16: + { + bitField0_ |= 0x00000001; + skipBoostSpecValidation_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder.class); + } + + public interface ConditionBoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + float getBoost(); + } + /** + * + * + *
+     * Boost applies to products which match a condition.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + ConditionBoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConditionBoostSpec.newBuilder() to construct. + private ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConditionBoostSpec() { + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConditionBoostSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConditionBoostSpec( + 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(); + + condition_ = s; + break; + } + case 21: + { + boost_ = input.readFloat(); + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private volatile java.lang.Object condition_; + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+       * for detail syntax and limitations.
+       * Examples:
+       * * To boost products with product ID "product_1" or "product_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+       *     ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_; + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       * Setting to 1.0 gives the item a big promotion. However, it does not
+       * necessarily mean that the boosted item will be the top result at all
+       * times, nor that other items will be excluded. Results could still be
+       * shown even when none of them matches the condition. And results that
+       * are significantly more relevant to the search query can still trump
+       * your heavily favored but irrelevant items.
+       * Setting to -1.0 gives the item a big demotion. However, results that
+       * are deeply relevant might still be shown. The item will have an
+       * upstream battle to get a fairly high ranking, but it is not blocked out
+       * completely.
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + 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(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(2, boost_); + } + 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(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); + } + 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.SearchRequest.BoostSpec.ConditionBoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec + 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.SearchRequest.BoostSpec.ConditionBoostSpec 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; + } + /** + * + * + *
+       * Boost applies to products which match a condition.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.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(); + condition_ = ""; + + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(this); + result.condition_ = condition_; + result.boost_ = boost_; + 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.SearchRequest.BoostSpec.ConditionBoostSpec) { + return mergeFrom( + (com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec other) { + if (other + == com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + 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.SearchRequest.BoostSpec.ConditionBoostSpec parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = getDefaultInstance().getCondition(); + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+         * for detail syntax and limitations.
+         * Examples:
+         * * To boost products with product ID "product_1" or "product_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("product_1", "product_2")) AND (colorFamilies:
+         *     ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + condition_ = value; + onChanged(); + return this; + } + + private float boost_; + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         * Setting to 1.0 gives the item a big promotion. However, it does not
+         * necessarily mean that the boosted item will be the top result at all
+         * times, nor that other items will be excluded. Results could still be
+         * shown even when none of them matches the condition. And results that
+         * are significantly more relevant to the search query can still trump
+         * your heavily favored but irrelevant items.
+         * Setting to -1.0 gives the item a big demotion. However, results that
+         * are deeply relevant might still be shown. The item will have an
+         * upstream battle to get a fairly high ranking, but it is not blocked out
+         * completely.
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + 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.SearchRequest.BoostSpec.ConditionBoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConditionBoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConditionBoostSpec(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.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_; + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List + getConditionBoostSpecsList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public int getConditionBoostSpecsCount() { + return conditionBoostSpecs_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + return conditionBoostSpecs_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 10.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + return conditionBoostSpecs_.get(index); + } + + public static final int SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER = 2; + private boolean skipBoostSpecValidation_; + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + @java.lang.Override + public boolean hasSkipBoostSpecValidation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Whether to skip boostspec validation. If this field is set to true,
+     * invalid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will be ignored and valid
+     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * will still be applied.
+     * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + @java.lang.Override + public boolean getSkipBoostSpecValidation() { + return skipBoostSpecValidation_; + } + + 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 < conditionBoostSpecs_.size(); i++) { + output.writeMessage(1, conditionBoostSpecs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(2, skipBoostSpecValidation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, conditionBoostSpecs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, skipBoostSpecValidation_); + } + 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.SearchRequest.BoostSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.BoostSpec) obj; + + if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) return false; + if (hasSkipBoostSpecValidation() != other.hasSkipBoostSpecValidation()) return false; + if (hasSkipBoostSpecValidation()) { + if (getSkipBoostSpecValidation() != other.getSkipBoostSpecValidation()) 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 (getConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getConditionBoostSpecsList().hashCode(); + } + if (hasSkipBoostSpecValidation()) { + hash = (37 * hash) + SKIP_BOOST_SPEC_VALIDATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipBoostSpecValidation()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec 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.SearchRequest.BoostSpec 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; + } + /** + * + * + *
+     * Boost specification to boost certain items.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.BoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.BoostSpec) + com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConditionBoostSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conditionBoostSpecsBuilder_.clear(); + } + skipBoostSpecValidation_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.BoostSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (conditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionBoostSpecs_ = conditionBoostSpecs_; + } else { + result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.skipBoostSpecValidation_ = skipBoostSpecValidation_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + 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.SearchRequest.BoostSpec) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchRequest.BoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchRequest.BoostSpec other) { + if (other == com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.getDefaultInstance()) + return this; + if (conditionBoostSpecsBuilder_ == null) { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecs_.isEmpty()) { + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.addAll(other.conditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecsBuilder_.isEmpty()) { + conditionBoostSpecsBuilder_.dispose(); + conditionBoostSpecsBuilder_ = null; + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionBoostSpecsFieldBuilder() + : null; + } else { + conditionBoostSpecsBuilder_.addAllMessages(other.conditionBoostSpecs_); + } + } + } + if (other.hasSkipBoostSpecValidation()) { + setSkipBoostSpecValidation(other.getSkipBoostSpecValidation()); + } + 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.SearchRequest.BoostSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.BoostSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec>( + conditionBoostSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + conditionBoostSpecsBuilder_; + + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + if (conditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } else { + return conditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public int getConditionBoostSpecsCount() { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.size(); + } else { + return conditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addAllConditionBoostSpecs( + java.lang.Iterable< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + values) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder clearConditionBoostSpecs() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder removeConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.remove(index); + onChanged(); + } else { + conditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + if (conditionBoostSpecsBuilder_ != null) { + return conditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder() { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a product matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 10.
+       * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> + getConditionBoostSpecsBuilderList() { + return getConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getConditionBoostSpecsFieldBuilder() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder>( + conditionBoostSpecs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionBoostSpecs_ = null; + } + return conditionBoostSpecsBuilder_; + } + + private boolean skipBoostSpecValidation_; + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return Whether the skipBoostSpecValidation field is set. + */ + @java.lang.Override + public boolean hasSkipBoostSpecValidation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return The skipBoostSpecValidation. + */ + @java.lang.Override + public boolean getSkipBoostSpecValidation() { + return skipBoostSpecValidation_; + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @param value The skipBoostSpecValidation to set. + * @return This builder for chaining. + */ + public Builder setSkipBoostSpecValidation(boolean value) { + bitField0_ |= 0x00000002; + skipBoostSpecValidation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to skip boostspec validation. If this field is set to true,
+       * invalid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will be ignored and valid
+       * [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+       * will still be applied.
+       * 
+ * + * optional bool skip_boost_spec_validation = 2; + * + * @return This builder for chaining. + */ + public Builder clearSkipBoostSpecValidation() { + bitField0_ = (bitField0_ & ~0x00000002); + skipBoostSpecValidation_ = 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.SearchRequest.BoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.BoostSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.BoostSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.BoostSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.BoostSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoostSpec(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.SearchRequest.BoostSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + int getConditionValue(); + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition getCondition(); + + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + boolean getPinUnexpandedResults(); + } + /** + * + * + *
+   * Specification to determine under which conditions query expansion should
+   * occur.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} + */ + public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + QueryExpansionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionSpec.newBuilder() to construct. + private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionSpec() { + condition_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionSpec( + 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 8: + { + int rawValue = input.readEnum(); + + condition_ = rawValue; + break; + } + case 16: + { + pinUnexpandedResults_ = 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder.class); + } + + /** + * + * + *
+     * Enum describing under which condition query expansion should occur.
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition} + */ + public enum Condition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED(0), + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2beta.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + AUTO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified query expansion condition. This defaults to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + public static final int CONDITION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.retail.v2beta.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic query expansion built by Google Retail Search.
+       * 
+ * + * AUTO = 3; + */ + public static final int AUTO_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 Condition 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 Condition forNumber(int value) { + switch (value) { + case 0: + return CONDITION_UNSPECIFIED; + case 1: + return DISABLED; + case 3: + return AUTO; + 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 Condition findValueByNumber(int number) { + return Condition.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.SearchRequest.QueryExpansionSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Condition[] VALUES = values(); + + public static Condition 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 Condition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition) + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private int condition_; + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.valueOf( + condition_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED + : result; + } + + public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2; + private boolean pinUnexpandedResults_; + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + + 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 (condition_ + != com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, condition_); + } + if (pinUnexpandedResults_ != false) { + output.writeBool(2, pinUnexpandedResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ + != com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); + } + if (pinUnexpandedResults_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, pinUnexpandedResults_); + } + 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.SearchRequest.QueryExpansionSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) obj; + + if (condition_ != other.condition_) return false; + if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + condition_; + hash = (37 * hash) + PIN_UNEXPANDED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPinUnexpandedResults()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + 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.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec 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.SearchRequest.QueryExpansionSpec 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; + } + /** + * + * + *
+     * Specification to determine under which conditions query expansion should
+     * occur.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.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(); + condition_ = 0; + + pinUnexpandedResults_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec(this); + result.condition_ = condition_; + result.pinUnexpandedResults_ = pinUnexpandedResults_; + 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.SearchRequest.QueryExpansionSpec) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec other) { + if (other + == com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.getDefaultInstance()) + return this; + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + if (other.getPinUnexpandedResults() != false) { + setPinUnexpandedResults(other.getPinUnexpandedResults()); + } + 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.SearchRequest.QueryExpansionSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int condition_ = 0; + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The enum numeric value on the wire for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionValue(int value) { + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.valueOf( + condition_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = 0; + onChanged(); + return this; + } + + private boolean pinUnexpandedResults_; + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @param value The pinUnexpandedResults to set. + * @return This builder for chaining. + */ + public Builder setPinUnexpandedResults(boolean value) { + + pinUnexpandedResults_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinUnexpandedResults() { + + pinUnexpandedResults_ = 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.SearchRequest.QueryExpansionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionSpec(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.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PersonalizationSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode getMode(); + } + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} + */ + public static final class PersonalizationSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + PersonalizationSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersonalizationSpec.newBuilder() to construct. + private PersonalizationSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersonalizationSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersonalizationSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PersonalizationSpec( + 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 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder.class); + } + + /** + * + * + *
+     * The personalization mode of each search request.
+     * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Let CRS decide whether to use personalization.
+       * 
+ * + * AUTO = 1; + */ + AUTO(1), + /** + * + * + *
+       * Disable personalization.
+       * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Let CRS decide whether to use personalization.
+       * 
+ * + * AUTO = 1; + */ + public static final int AUTO_VALUE = 1; + /** + * + * + *
+       * Disable personalization.
+       * 
+ * + * DISABLED = 2; + */ + public static final int 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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return AUTO; + case 2: + return 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 Mode findValueByNumber(int number) { + return Mode.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.SearchRequest.PersonalizationSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Defaults to
+     * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode result = + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED + : result; + } + + 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 (mode_ + != com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + 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.SearchRequest.PersonalizationSpec)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec other = + (com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) obj; + + if (mode_ != other.mode_) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + 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.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec 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.SearchRequest.PersonalizationSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.class, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.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(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec build() { + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec result = + new com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec(this); + result.mode_ = mode_; + 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.SearchRequest.PersonalizationSpec) { + return mergeFrom( + (com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec other) { + if (other + == com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + .getDefaultInstance()) return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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.SearchRequest.PersonalizationSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode result = + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.valueOf(mode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Defaults to
+       * [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 0; + 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.SearchRequest.PersonalizationSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec) + private static final com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersonalizationSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PersonalizationSpec(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.SearchRequest.PersonalizationSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PLACEMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object placement_; + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + @java.lang.Override + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + 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(); + placement_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_FIELD_NUMBER = 2; + private volatile java.lang.Object branch_; + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + 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(); + branch_ = s; + return s; + } + } + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_INFO_FIELD_NUMBER = 5; + private com.google.cloud.retail.v2beta.UserInfo userInfo_; + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+   * If unspecified, defaults to a reasonable value. The maximum allowed value
+   * is 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @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; + } + } + + public static final int OFFSET_FIELD_NUMBER = 9; + private int offset_; + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the [Product][google.cloud.retail.v2beta.Product]s
+   * deemed by the API as relevant) in search results. This field is only
+   * considered if
+   * [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int FILTER_FIELD_NUMBER = 10; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANONICAL_FILTER_FIELD_NUMBER = 28; + private volatile java.lang.Object canonicalFilter_; + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + @java.lang.Override + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + 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(); + canonicalFilter_ = s; + return s; + } + } + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 11; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FACET_SPECS_FIELD_NUMBER = 12; + private java.util.List facetSpecs_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List + getFacetSpecsList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public java.util.List + getFacetSpecsOrBuilderList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public int getFacetSpecsCount() { + return facetSpecs_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpecs(int index) { + return facetSpecs_.get(index); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + return facetSpecs_.get(index); + } + + public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 21; + private com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpec_ != null; + } + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return The dynamicFacetSpec. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + return getDynamicFacetSpec(); + } + + public static final int BOOST_SPEC_FIELD_NUMBER = 13; + private com.google.cloud.retail.v2beta.SearchRequest.BoostSpec boostSpec_; + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + @java.lang.Override + public boolean hasBoostSpec() { + return boostSpec_ != null; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec getBoostSpec() { + return boostSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() { + return getBoostSpec(); + } + + public static final int QUERY_EXPANSION_SPEC_FIELD_NUMBER = 14; + private com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionSpec() { + return queryExpansionSpec_ != null; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + return getQueryExpansionSpec(); + } + + public static final int VARIANT_ROLLUP_KEYS_FIELD_NUMBER = 17; + private com.google.protobuf.LazyStringList variantRollupKeys_; + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_; + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 23; + private com.google.protobuf.LazyStringList pageCategories_; + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + + public static final int SEARCH_MODE_FIELD_NUMBER = 31; + private int searchMode_; + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.SearchMode getSearchMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.SearchMode result = + com.google.cloud.retail.v2beta.SearchRequest.SearchMode.valueOf(searchMode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.SearchMode.UNRECOGNIZED + : result; + } + + public static final int PERSONALIZATION_SPEC_FIELD_NUMBER = 32; + private com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalizationSpec_; + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + @java.lang.Override + public boolean hasPersonalizationSpec() { + return personalizationSpec_ != null; + } + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @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.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder() { + return getPersonalizationSpec(); + } + + 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(placement_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, placement_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, visitorId_); + } + if (userInfo_ != null) { + output.writeMessage(5, getUserInfo()); + } + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (offset_ != 0) { + output.writeInt32(9, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + output.writeMessage(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + output.writeMessage(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + output.writeMessage(14, getQueryExpansionSpec()); + } + for (int i = 0; i < variantRollupKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, variantRollupKeys_.getRaw(i)); + } + if (dynamicFacetSpec_ != null) { + output.writeMessage(21, getDynamicFacetSpec()); + } + for (int i = 0; i < pageCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 23, pageCategories_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, canonicalFilter_); + } + if (searchMode_ + != com.google.cloud.retail.v2beta.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(31, searchMode_); + } + if (personalizationSpec_ != null) { + output.writeMessage(32, getPersonalizationSpec()); + } + 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(placement_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, placement_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, visitorId_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUserInfo()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getBoostSpec()); + } + if (queryExpansionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < variantRollupKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(variantRollupKeys_.getRaw(i)); + } + size += dataSize; + size += 2 * getVariantRollupKeysList().size(); + } + if (dynamicFacetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getDynamicFacetSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < pageCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); + } + size += dataSize; + size += 2 * getPageCategoriesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalFilter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(28, canonicalFilter_); + } + if (searchMode_ + != com.google.cloud.retail.v2beta.SearchRequest.SearchMode.SEARCH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(31, searchMode_); + } + if (personalizationSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(32, getPersonalizationSpec()); + } + 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.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchRequest other = + (com.google.cloud.retail.v2beta.SearchRequest) obj; + + if (!getPlacement().equals(other.getPlacement())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getCanonicalFilter().equals(other.getCanonicalFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false; + if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false; + if (hasDynamicFacetSpec()) { + if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false; + } + if (hasBoostSpec() != other.hasBoostSpec()) return false; + if (hasBoostSpec()) { + if (!getBoostSpec().equals(other.getBoostSpec())) return false; + } + if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; + if (hasQueryExpansionSpec()) { + if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + } + if (!getVariantRollupKeysList().equals(other.getVariantRollupKeysList())) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (searchMode_ != other.searchMode_) return false; + if (hasPersonalizationSpec() != other.hasPersonalizationSpec()) return false; + if (hasPersonalizationSpec()) { + if (!getPersonalizationSpec().equals(other.getPersonalizationSpec())) 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) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().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 = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + CANONICAL_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (getFacetSpecsCount() > 0) { + hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpecsList().hashCode(); + } + if (hasDynamicFacetSpec()) { + hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getDynamicFacetSpec().hashCode(); + } + if (hasBoostSpec()) { + hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getBoostSpec().hashCode(); + } + if (hasQueryExpansionSpec()) { + hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + } + if (getVariantRollupKeysCount() > 0) { + hash = (37 * hash) + VARIANT_ROLLUP_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getVariantRollupKeysList().hashCode(); + } + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + hash = (37 * hash) + SEARCH_MODE_FIELD_NUMBER; + hash = (53 * hash) + searchMode_; + if (hasPersonalizationSpec()) { + hash = (37 * hash) + PERSONALIZATION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getPersonalizationSpec().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest 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.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest 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.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchRequest 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.SearchRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest 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.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchRequest 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.SearchRequest 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.SearchRequest 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.SearchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchRequest) + com.google.cloud.retail.v2beta.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchRequest.class, + com.google.cloud.retail.v2beta.SearchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFacetSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + placement_ = ""; + + branch_ = ""; + + query_ = ""; + + visitorId_ = ""; + + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + offset_ = 0; + + filter_ = ""; + + canonicalFilter_ = ""; + + orderBy_ = ""; + + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + facetSpecsBuilder_.clear(); + } + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + searchMode_ = 0; + + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest build() { + com.google.cloud.retail.v2beta.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest buildPartial() { + com.google.cloud.retail.v2beta.SearchRequest result = + new com.google.cloud.retail.v2beta.SearchRequest(this); + int from_bitField0_ = bitField0_; + result.placement_ = placement_; + result.branch_ = branch_; + result.query_ = query_; + result.visitorId_ = visitorId_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.offset_ = offset_; + result.filter_ = filter_; + result.canonicalFilter_ = canonicalFilter_; + result.orderBy_ = orderBy_; + if (facetSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.facetSpecs_ = facetSpecs_; + } else { + result.facetSpecs_ = facetSpecsBuilder_.build(); + } + if (dynamicFacetSpecBuilder_ == null) { + result.dynamicFacetSpec_ = dynamicFacetSpec_; + } else { + result.dynamicFacetSpec_ = dynamicFacetSpecBuilder_.build(); + } + if (boostSpecBuilder_ == null) { + result.boostSpec_ = boostSpec_; + } else { + result.boostSpec_ = boostSpecBuilder_.build(); + } + if (queryExpansionSpecBuilder_ == null) { + result.queryExpansionSpec_ = queryExpansionSpec_; + } else { + result.queryExpansionSpec_ = queryExpansionSpecBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = variantRollupKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.variantRollupKeys_ = variantRollupKeys_; + if (((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pageCategories_ = pageCategories_; + result.searchMode_ = searchMode_; + if (personalizationSpecBuilder_ == null) { + result.personalizationSpec_ = personalizationSpec_; + } else { + result.personalizationSpec_ = personalizationSpecBuilder_.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.SearchRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchRequest other) { + if (other == com.google.cloud.retail.v2beta.SearchRequest.getDefaultInstance()) return this; + if (!other.getPlacement().isEmpty()) { + placement_ = other.placement_; + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getCanonicalFilter().isEmpty()) { + canonicalFilter_ = other.canonicalFilter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (facetSpecsBuilder_ == null) { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecs_.isEmpty()) { + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFacetSpecsIsMutable(); + facetSpecs_.addAll(other.facetSpecs_); + } + onChanged(); + } + } else { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecsBuilder_.isEmpty()) { + facetSpecsBuilder_.dispose(); + facetSpecsBuilder_ = null; + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + facetSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetSpecsFieldBuilder() + : null; + } else { + facetSpecsBuilder_.addAllMessages(other.facetSpecs_); + } + } + } + if (other.hasDynamicFacetSpec()) { + mergeDynamicFacetSpec(other.getDynamicFacetSpec()); + } + if (other.hasBoostSpec()) { + mergeBoostSpec(other.getBoostSpec()); + } + if (other.hasQueryExpansionSpec()) { + mergeQueryExpansionSpec(other.getQueryExpansionSpec()); + } + if (!other.variantRollupKeys_.isEmpty()) { + if (variantRollupKeys_.isEmpty()) { + variantRollupKeys_ = other.variantRollupKeys_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.addAll(other.variantRollupKeys_); + } + onChanged(); + } + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + if (other.searchMode_ != 0) { + setSearchModeValue(other.getSearchModeValue()); + } + if (other.hasPersonalizationSpec()) { + mergePersonalizationSpec(other.getPersonalizationSpec()); + } + 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.SearchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.SearchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object placement_ = ""; + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + public java.lang.String getPlacement() { + java.lang.Object ref = placement_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + placement_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + public com.google.protobuf.ByteString getPlacementBytes() { + java.lang.Object ref = placement_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + placement_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The placement to set. + * @return This builder for chaining. + */ + public Builder setPlacement(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + placement_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPlacement() { + + placement_ = getDefaultInstance().getPlacement(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the search engine placement, such as
+     * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+     * This field is used to identify the serving configuration name and the set
+     * of models that will be used to make the search.
+     * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for placement to set. + * @return This builder for chaining. + */ + public Builder setPlacementBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + placement_ = value; + onChanged(); + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+     * Use "default_branch" as the branch ID or leave this field empty, to search
+     * products under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors. For example, this
+     * could be implemented with an HTTP cookie, which should be able to uniquely
+     * identify a visitor on a single device. This unique identifier should not
+     * change if the visitor logs in or out of the website.
+     * This should be the same identifier as
+     * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return The userInfo. + */ + public com.google.cloud.retail.v2beta.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2beta.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public Builder setUserInfo(com.google.cloud.retail.v2beta.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public Builder mergeUserInfo(com.google.cloud.retail.v2beta.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.retail.v2beta.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2beta.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + public com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to a reasonable value. The maximum allowed value
+     * is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to a reasonable value. The maximum allowed value
+     * is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+     * If unspecified, defaults to a reasonable value. The maximum allowed value
+     * is 120. Values above 120 will be coerced to 120.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 page_size = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+     * received from a previous
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * string page_token = 8; + * + * @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; + } + + private int offset_; + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2beta.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if
+     * [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2beta.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if
+     * [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the [Product][google.cloud.retail.v2beta.Product]s
+     * deemed by the API as relevant) in search results. This field is only
+     * considered if
+     * [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * 
+ * + * int32 offset = 9; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered. Filter
+     * expression is case-sensitive. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string filter = 10; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object canonicalFilter_ = ""; + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + public java.lang.String getCanonicalFilter() { + java.lang.Object ref = canonicalFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + canonicalFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + public com.google.protobuf.ByteString getCanonicalFilterBytes() { + java.lang.Object ref = canonicalFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + canonicalFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + canonicalFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @return This builder for chaining. + */ + public Builder clearCanonicalFilter() { + + canonicalFilter_ = getDefaultInstance().getCanonicalFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The default filter that is applied when a user performs a search without
+     * checking any filters on the search page.
+     * The filter applied to every search request when quality improvement such as
+     * query expansion is needed. For example, if a query does not have enough
+     * results, an expanded query with
+     * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+     * will be returned as a supplement of the original query. This field is
+     * strongly recommended to achieve high search quality.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for more details about filter syntax.
+     * 
+ * + * string canonical_filter = 28; + * + * @param value The bytes for canonicalFilter to set. + * @return This builder for chaining. + */ + public Builder setCanonicalFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + canonicalFilter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned. Products can be ordered by
+     * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+     * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+     * more details at this [user
+     * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+     * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+     * 
+ * + * string order_by = 11; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.util.List facetSpecs_ = + java.util.Collections.emptyList(); + + private void ensureFacetSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + facetSpecs_ = + new java.util.ArrayList( + facetSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder> + facetSpecsBuilder_; + + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsList() { + if (facetSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facetSpecs_); + } else { + return facetSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public int getFacetSpecsCount() { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.size(); + } else { + return facetSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, value); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder setFacetSpecs( + int index, com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addFacetSpecs( + int index, com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder addAllFacetSpecs( + java.lang.Iterable + values) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_); + onChanged(); + } else { + facetSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder clearFacetSpecs() { + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + facetSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public Builder removeFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.remove(index); + onChanged(); + } else { + facetSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder getFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsOrBuilderList() { + if (facetSpecsBuilder_ != null) { + return facetSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facetSpecs_); + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder() { + return getFacetSpecsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + public java.util.List + getFacetSpecsBuilderList() { + return getFacetSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsFieldBuilder() { + if (facetSpecsBuilder_ == null) { + facetSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder>( + facetSpecs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + facetSpecs_ = null; + } + return facetSpecsBuilder_; + } + + private com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder> + dynamicFacetSpecBuilder_; + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Deprecated + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpecBuilder_ != null || dynamicFacetSpec_ != null; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return The dynamicFacetSpec. + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } else { + return dynamicFacetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicFacetSpec_ = value; + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder builderForValue) { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = builderForValue.build(); + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (dynamicFacetSpec_ != null) { + dynamicFacetSpec_ = + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.newBuilder( + dynamicFacetSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + dynamicFacetSpec_ = value; + } + onChanged(); + } else { + dynamicFacetSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + onChanged(); + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder + getDynamicFacetSpecBuilder() { + + onChanged(); + return getDynamicFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + if (dynamicFacetSpecBuilder_ != null) { + return dynamicFacetSpecBuilder_.getMessageOrBuilder(); + } else { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + } + /** + * + * + *
+     * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+     * to enable dynamic facets. Do not set this field.
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder> + getDynamicFacetSpecFieldBuilder() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder>( + getDynamicFacetSpec(), getParentForChildren(), isClean()); + dynamicFacetSpec_ = null; + } + return dynamicFacetSpecBuilder_; + } + + private com.google.cloud.retail.v2beta.SearchRequest.BoostSpec boostSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder> + boostSpecBuilder_; + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + public boolean hasBoostSpec() { + return boostSpecBuilder_ != null || boostSpec_ != null; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec getBoostSpec() { + if (boostSpecBuilder_ == null) { + return boostSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } else { + return boostSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec(com.google.cloud.retail.v2beta.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boostSpec_ = value; + onChanged(); + } else { + boostSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder setBoostSpec( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder builderForValue) { + if (boostSpecBuilder_ == null) { + boostSpec_ = builderForValue.build(); + onChanged(); + } else { + boostSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder mergeBoostSpec(com.google.cloud.retail.v2beta.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (boostSpec_ != null) { + boostSpec_ = + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.newBuilder(boostSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + boostSpec_ = value; + } + onChanged(); + } else { + boostSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public Builder clearBoostSpec() { + if (boostSpecBuilder_ == null) { + boostSpec_ = null; + onChanged(); + } else { + boostSpec_ = null; + boostSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder getBoostSpecBuilder() { + + onChanged(); + return getBoostSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder() { + if (boostSpecBuilder_ != null) { + return boostSpecBuilder_.getMessageOrBuilder(); + } else { + return boostSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + } + /** + * + * + *
+     * Boost specification to boost certain products. See more details at this
+     * [user guide](https://cloud.google.com/retail/docs/boosting).
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder> + getBoostSpecFieldBuilder() { + if (boostSpecBuilder_ == null) { + boostSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder>( + getBoostSpec(), getParentForChildren(), isClean()); + boostSpec_ = null; + } + return boostSpecBuilder_; + } + + private com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec queryExpansionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder> + queryExpansionSpecBuilder_; + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + public boolean hasQueryExpansionSpec() { + return queryExpansionSpecBuilder_ != null || queryExpansionSpec_ != null; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec getQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } else { + return queryExpansionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionSpec_ = value; + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder builderForValue) { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder mergeQueryExpansionSpec( + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (queryExpansionSpec_ != null) { + queryExpansionSpec_ = + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.newBuilder( + queryExpansionSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionSpec_ = value; + } + onChanged(); + } else { + queryExpansionSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public Builder clearQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = null; + onChanged(); + } else { + queryExpansionSpec_ = null; + queryExpansionSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder + getQueryExpansionSpecBuilder() { + + onChanged(); + return getQueryExpansionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + if (queryExpansionSpecBuilder_ != null) { + return queryExpansionSpecBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion will occur. See more details at this [user
+     * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder> + getQueryExpansionSpecFieldBuilder() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder>( + getQueryExpansionSpec(), getParentForChildren(), isClean()); + queryExpansionSpec_ = null; + } + return queryExpansionSpecBuilder_; + } + + private com.google.protobuf.LazyStringList variantRollupKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVariantRollupKeysIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + variantRollupKeys_ = new com.google.protobuf.LazyStringArrayList(variantRollupKeys_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + public com.google.protobuf.ProtocolStringList getVariantRollupKeysList() { + return variantRollupKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + public int getVariantRollupKeysCount() { + return variantRollupKeys_.size(); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + public java.lang.String getVariantRollupKeys(int index) { + return variantRollupKeys_.get(index); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { + return variantRollupKeys_.getByteString(index); + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index to set the value at. + * @param value The variantRollupKeys to set. + * @return This builder for chaining. + */ + public Builder setVariantRollupKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param values The variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addAllVariantRollupKeys(java.lang.Iterable values) { + ensureVariantRollupKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, variantRollupKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return This builder for chaining. + */ + public Builder clearVariantRollupKeys() { + variantRollupKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The keys to fetch and rollup the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s attributes,
+     * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+     * The attributes from all the matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s or
+     * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+     * de-duplicated. Notice that rollup attributes will lead to extra query
+     * latency. Maximum number of keys is 30.
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+     * fulfillment type and a fulfillment ID must be provided in the format of
+     * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+     * "pickupInStore" is fulfillment type and "store123" is the store ID.
+     * Supported keys are:
+     * * colorFamilies
+     * * price
+     * * originalPrice
+     * * discount
+     * * variantId
+     * * inventory(place_id,price)
+     * * inventory(place_id,original_price)
+     * * inventory(place_id,attributes.key), where key is any key in the
+     *   [Product.inventories.attributes][] map.
+     * * attributes.key, where key is any key in the
+     *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+     * * pickupInStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "pickup-in-store".
+     * * shipToStore.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "ship-to-store".
+     * * sameDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "same-day-delivery".
+     * * nextDayDelivery.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "next-day-delivery".
+     * * customFulfillment1.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-1".
+     * * customFulfillment2.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-2".
+     * * customFulfillment3.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-3".
+     * * customFulfillment4.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-4".
+     * * customFulfillment5.id, where id is any
+     * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+     * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+     *   "custom-type-5".
+     * If this field is set to an invalid value other than these, an
+     * INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param value The bytes of the variantRollupKeys to add. + * @return This builder for chaining. + */ + public Builder addVariantRollupKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVariantRollupKeysIsMutable(); + variantRollupKeys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pageCategories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_.getUnmodifiableView(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param index The index to set the value at. + * @param value The pageCategories to set. + * @return This builder for chaining. + */ + public Builder setPageCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param values The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addAllPageCategories(java.lang.Iterable values) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @return This builder for chaining. + */ + public Builder clearPageCategories() { + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The categories associated with a category page. Required for category
+     * navigation queries to achieve good search quality. The format should be
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * 
+ * + * repeated string page_categories = 23; + * + * @param value The bytes of the pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + + private int searchMode_ = 0; + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @param value The enum numeric value on the wire for searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchModeValue(int value) { + + searchMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.SearchMode getSearchMode() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchRequest.SearchMode result = + com.google.cloud.retail.v2beta.SearchRequest.SearchMode.valueOf(searchMode_); + return result == null + ? com.google.cloud.retail.v2beta.SearchRequest.SearchMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @param value The searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchMode(com.google.cloud.retail.v2beta.SearchRequest.SearchMode value) { + if (value == null) { + throw new NullPointerException(); + } + + searchMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The search mode of the search request. If not specified, a single search
+     * request triggers both product search and faceted search.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return This builder for chaining. + */ + public Builder clearSearchMode() { + + searchMode_ = 0; + onChanged(); + 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + public boolean hasPersonalizationSpec() { + return personalizationSpecBuilder_ != null || personalizationSpec_ != null; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public Builder clearPersonalizationSpec() { + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + onChanged(); + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder + getPersonalizationSpecBuilder() { + + onChanged(); + return getPersonalizationSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for personalization.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + 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.
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + 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_; + } + + @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.SearchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchRequest) + private static final com.google.cloud.retail.v2beta.SearchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchRequest(); + } + + public static com.google.cloud.retail.v2beta.SearchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchRequest(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.SearchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java new file mode 100644 index 00000000..287ecb19 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java @@ -0,0 +1,1053 @@ +/* + * 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/search_service.proto + +package com.google.cloud.retail.v2beta; + +public interface SearchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The placement. + */ + java.lang.String getPlacement(); + /** + * + * + *
+   * Required. The resource name of the search engine placement, such as
+   * `projects/*/locations/global/catalogs/default_catalog/placements/default_search`
+   * This field is used to identify the serving configuration name and the set
+   * of models that will be used to make the search.
+   * 
+ * + * string placement = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for placement. + */ + com.google.protobuf.ByteString getPlacementBytes(); + + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + java.lang.String getBranch(); + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/catalogs/default_catalog/branches/0`.
+   * Use "default_branch" as the branch ID or leave this field empty, to search
+   * products under the default branch.
+   * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Raw search query.
+   * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required. A unique identifier for tracking visitors. For example, this
+   * could be implemented with an HTTP cookie, which should be able to uniquely
+   * identify a visitor on a single device. This unique identifier should not
+   * change if the visitor logs in or out of the website.
+   * This should be the same identifier as
+   * [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id].
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string visitor_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + * + * @return The userInfo. + */ + com.google.cloud.retail.v2beta.UserInfo getUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 5; + */ + com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return.
+   * If unspecified, defaults to a reasonable value. The maximum allowed value
+   * is 120. Values above 120 will be coerced to 120.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token
+   * [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token],
+   * received from a previous
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the [Product][google.cloud.retail.v2beta.Product]s
+   * deemed by the API as relevant) in search results. This field is only
+   * considered if
+   * [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * 
+ * + * int32 offset = 9; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered. Filter
+   * expression is case-sensitive. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string filter = 10; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The canonicalFilter. + */ + java.lang.String getCanonicalFilter(); + /** + * + * + *
+   * The default filter that is applied when a user performs a search without
+   * checking any filters on the search page.
+   * The filter applied to every search request when quality improvement such as
+   * query expansion is needed. For example, if a query does not have enough
+   * results, an expanded query with
+   * [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter]
+   * will be returned as a supplement of the original query. This field is
+   * strongly recommended to achieve high search quality.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for more details about filter syntax.
+   * 
+ * + * string canonical_filter = 28; + * + * @return The bytes for canonicalFilter. + */ + com.google.protobuf.ByteString getCanonicalFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned. Products can be ordered by
+   * a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave
+   * it unset if ordered by relevance. OrderBy expression is case-sensitive. See
+   * more details at this [user
+   * guide](https://cloud.google.com/retail/docs/filter-and-order#order).
+   * If this field is unrecognizable, an INVALID_ARGUMENT is returned.
+   * 
+ * + * string order_by = 11; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List getFacetSpecsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpecs(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + int getFacetSpecsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + java.util.List + getFacetSpecsOrBuilderList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_specs = 12; + */ + com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder(int index); + + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Deprecated + boolean hasDynamicFacetSpec(); + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + * + * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See + * google/cloud/retail/v2beta/search_service.proto;l=513 + * @return The dynamicFacetSpec. + */ + @java.lang.Deprecated + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec(); + /** + * + * + *
+   * Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic
+   * to enable dynamic facets. Do not set this field.
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder(); + + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return Whether the boostSpec field is set. + */ + boolean hasBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + * + * @return The boostSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec getBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain products. See more details at this
+   * [user guide](https://cloud.google.com/retail/docs/boosting).
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.BoostSpec boost_spec = 13; + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder(); + + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + boolean hasQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + * + * @return The queryExpansionSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec getQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion will occur. See more details at this [user
+   * guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 14; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder(); + + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return A list containing the variantRollupKeys. + */ + java.util.List getVariantRollupKeysList(); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @return The count of variantRollupKeys. + */ + int getVariantRollupKeysCount(); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the element to return. + * @return The variantRollupKeys at the given index. + */ + java.lang.String getVariantRollupKeys(int index); + /** + * + * + *
+   * The keys to fetch and rollup the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s attributes,
+   * [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes.
+   * The attributes from all the matching
+   * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+   * [Product][google.cloud.retail.v2beta.Product]s or
+   * [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and
+   * de-duplicated. Notice that rollup attributes will lead to extra query
+   * latency. Maximum number of keys is 30.
+   * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a
+   * fulfillment type and a fulfillment ID must be provided in the format of
+   * "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123",
+   * "pickupInStore" is fulfillment type and "store123" is the store ID.
+   * Supported keys are:
+   * * colorFamilies
+   * * price
+   * * originalPrice
+   * * discount
+   * * variantId
+   * * inventory(place_id,price)
+   * * inventory(place_id,original_price)
+   * * inventory(place_id,attributes.key), where key is any key in the
+   *   [Product.inventories.attributes][] map.
+   * * attributes.key, where key is any key in the
+   *   [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map.
+   * * pickupInStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "pickup-in-store".
+   * * shipToStore.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "ship-to-store".
+   * * sameDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "same-day-delivery".
+   * * nextDayDelivery.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "next-day-delivery".
+   * * customFulfillment1.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-1".
+   * * customFulfillment2.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-2".
+   * * customFulfillment3.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-3".
+   * * customFulfillment4.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-4".
+   * * customFulfillment5.id, where id is any
+   * [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
+   * for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]
+   *   "custom-type-5".
+   * If this field is set to an invalid value other than these, an
+   * INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string variant_rollup_keys = 17; + * + * @param index The index of the value to return. + * @return The bytes of the variantRollupKeys at the given index. + */ + com.google.protobuf.ByteString getVariantRollupKeysBytes(int index); + + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return A list containing the pageCategories. + */ + java.util.List getPageCategoriesList(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @return The count of pageCategories. + */ + int getPageCategoriesCount(); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + java.lang.String getPageCategories(int index); + /** + * + * + *
+   * The categories associated with a category page. Required for category
+   * navigation queries to achieve good search quality. The format should be
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * 
+ * + * repeated string page_categories = 23; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + com.google.protobuf.ByteString getPageCategoriesBytes(int index); + + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The enum numeric value on the wire for searchMode. + */ + int getSearchModeValue(); + /** + * + * + *
+   * The search mode of the search request. If not specified, a single search
+   * request triggers both product search and faceted search.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.SearchMode search_mode = 31; + * + * @return The searchMode. + */ + com.google.cloud.retail.v2beta.SearchRequest.SearchMode getSearchMode(); + + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return Whether the personalizationSpec field is set. + */ + boolean hasPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + * + * @return The personalizationSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec getPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java new file mode 100644 index 00000000..e522c7de --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java @@ -0,0 +1,9522 @@ +/* + * 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/search_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response message for
+ * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse} + */ +public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchResponse) + SearchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResponse.newBuilder() to construct. + private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResponse() { + results_ = java.util.Collections.emptyList(); + facets_ = java.util.Collections.emptyList(); + correctedQuery_ = ""; + attributionToken_ = ""; + nextPageToken_ = ""; + redirectUri_ = ""; + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResponse( + 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)) { + results_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchResponse.SearchResult>(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + facets_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchResponse.Facet.parser(), + extensionRegistry)); + break; + } + case 24: + { + totalSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + correctedQuery_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 58: + { + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder subBuilder = + null; + if (queryExpansionInfo_ != null) { + subBuilder = queryExpansionInfo_.toBuilder(); + } + queryExpansionInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(queryExpansionInfo_); + queryExpansionInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + redirectUri_ = s; + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + appliedControls_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + appliedControls_.add(s); + break; + } + case 114: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec + .ConditionBoostSpec>(); + mutable_bitField0_ |= 0x00000008; + } + invalidConditionBoostSpecs_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .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)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + appliedControls_ = appliedControls_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.class, + com.google.cloud.retail.v2beta.SearchResponse.Builder.class); + } + + public interface SearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchResponse.SearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+     * [Product][google.cloud.retail.v2beta.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+     * [Product][google.cloud.retail.v2beta.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return The product. + */ + com.google.cloud.retail.v2beta.Product getProduct(); + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + int getMatchingVariantCount(); + + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + int getMatchingVariantFieldsCount(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + boolean containsMatchingVariantFields(java.lang.String key); + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMatchingVariantFields(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + java.util.Map getMatchingVariantFieldsMap(); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + + /* nullable */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.FieldMask defaultValue); + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key); + + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + int getVariantRollupValuesCount(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + boolean containsVariantRollupValues(java.lang.String key); + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getVariantRollupValues(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + java.util.Map getVariantRollupValuesMap(); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + + /* nullable */ + com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents the search results.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.SearchResult} + */ + public static final class SearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchResponse.SearchResult) + SearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResult.newBuilder() to construct. + private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchResult( + 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(); + + id_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + matchingVariantCount_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + matchingVariantFields__ = + input.readMessage( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + matchingVariantFields_ + .getMutableMap() + .put(matchingVariantFields__.getKey(), matchingVariantFields__.getValue()); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + variantRollupValues__ = + input.readMessage( + VariantRollupValuesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + variantRollupValues_ + .getMutableMap() + .put(variantRollupValues__.getKey(), variantRollupValues__.getValue()); + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+     * [Product][google.cloud.retail.v2beta.Product].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+     * [Product][google.cloud.retail.v2beta.Product].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.Product product_; + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+     * The product data snippet in the search response. Only
+     * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+     * be populated.
+     * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+     * the product variants that match the search query. If there are multiple
+     * product variants matching the query, top 5 most relevant product variants
+     * are returned and ordered by relevancy.
+     * If relevancy can be deternmined, use
+     * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+     * to look up matched product variants fields. If relevancy cannot be
+     * determined, e.g. when searching "shoe" all products in a shoe product can
+     * be a match, 5 product variants are returned but order is meaningless.
+     * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int MATCHING_VARIANT_COUNT_FIELD_NUMBER = 3; + private int matchingVariantCount_; + /** + * + * + *
+     * The count of matched
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product]s.
+     * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + + public static final int MATCHING_VARIANT_FIELDS_FIELD_NUMBER = 4; + + private static final class MatchingVariantFieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.FieldMask.getDefaultInstance()); + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+     * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+     * fields are matched. The key is the
+     * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+     * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+     * fields. If matched attributes cannot be determined, this map will be
+     * empty.
+     * For example, a key "sku1" with field mask
+     * "products.color_info" indicates there is a match between
+     * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+     * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int VARIANT_ROLLUP_VALUES_FIELD_NUMBER = 5; + + private static final class VariantRollupValuesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The rollup matching
+     * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+     * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+     * of the
+     * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+     * The values are the merged and de-duplicated
+     * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+     * rollup values are respect filter. For example, when filtering by
+     * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+     * returned.
+     * For textual and numerical attributes, the rollup values is a list of
+     * string or double values with type
+     * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+     * there are two variants with colors "red" and "blue", the rollup values
+     * are
+     *     { key: "colorFamilies"
+     *       value {
+     *         list_value {
+     *           values { string_value: "red" }
+     *           values { string_value: "blue" }
+     *          }
+     *       }
+     *     }
+     * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+     * rollup values is a double value with type
+     * [google.protobuf.Value][google.protobuf.Value]. For example,
+     * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+     * are 10 variants in this product are available in the store "store1".
+     * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (product_ != null) { + output.writeMessage(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + output.writeInt32(3, matchingVariantCount_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetMatchingVariantFields(), + MatchingVariantFieldsDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetVariantRollupValues(), + VariantRollupValuesDefaultEntryHolder.defaultEntry, + 5); + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); + } + if (matchingVariantCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, matchingVariantCount_); + } + for (java.util.Map.Entry entry : + internalGetMatchingVariantFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + matchingVariantFields__ = + MatchingVariantFieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, matchingVariantFields__); + } + for (java.util.Map.Entry entry : + internalGetVariantRollupValues().getMap().entrySet()) { + com.google.protobuf.MapEntry + variantRollupValues__ = + VariantRollupValuesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, variantRollupValues__); + } + 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.SearchResponse.SearchResult)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchResponse.SearchResult other = + (com.google.cloud.retail.v2beta.SearchResponse.SearchResult) obj; + + if (!getId().equals(other.getId())) return false; + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (getMatchingVariantCount() != other.getMatchingVariantCount()) return false; + if (!internalGetMatchingVariantFields().equals(other.internalGetMatchingVariantFields())) + return false; + if (!internalGetVariantRollupValues().equals(other.internalGetVariantRollupValues())) + 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + hash = (37 * hash) + MATCHING_VARIANT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMatchingVariantCount(); + if (!internalGetMatchingVariantFields().getMap().isEmpty()) { + hash = (37 * hash) + MATCHING_VARIANT_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMatchingVariantFields().hashCode(); + } + if (!internalGetVariantRollupValues().getMap().isEmpty()) { + hash = (37 * hash) + VARIANT_ROLLUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + internalGetVariantRollupValues().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult 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.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult 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.SearchResponse.SearchResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult 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.SearchResponse.SearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult 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.SearchResponse.SearchResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult 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.SearchResponse.SearchResult 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.SearchResponse.SearchResult 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.SearchResponse.SearchResult 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 the search results.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.SearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchResponse.SearchResult) + com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMatchingVariantFields(); + case 5: + return internalGetVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableMatchingVariantFields(); + case 5: + return internalGetMutableVariantRollupValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.class, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchResponse.SearchResult.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(); + id_ = ""; + + if (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + matchingVariantCount_ = 0; + + internalGetMutableMatchingVariantFields().clear(); + internalGetMutableVariantRollupValues().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchResponse.SearchResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult build() { + com.google.cloud.retail.v2beta.SearchResponse.SearchResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult buildPartial() { + com.google.cloud.retail.v2beta.SearchResponse.SearchResult result = + new com.google.cloud.retail.v2beta.SearchResponse.SearchResult(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + result.matchingVariantCount_ = matchingVariantCount_; + result.matchingVariantFields_ = internalGetMatchingVariantFields(); + result.matchingVariantFields_.makeImmutable(); + result.variantRollupValues_ = internalGetVariantRollupValues(); + result.variantRollupValues_.makeImmutable(); + 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.SearchResponse.SearchResult) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchResponse.SearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchResponse.SearchResult other) { + if (other + == com.google.cloud.retail.v2beta.SearchResponse.SearchResult.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.getMatchingVariantCount() != 0) { + setMatchingVariantCount(other.getMatchingVariantCount()); + } + internalGetMutableMatchingVariantFields() + .mergeFrom(other.internalGetMatchingVariantFields()); + internalGetMutableVariantRollupValues().mergeFrom(other.internalGetVariantRollupValues()); + 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.SearchResponse.SearchResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchResponse.SearchResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+       * [Product][google.cloud.retail.v2beta.Product].
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+       * [Product][google.cloud.retail.v2beta.Product].
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+       * [Product][google.cloud.retail.v2beta.Product].
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+       * [Product][google.cloud.retail.v2beta.Product].
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+       * [Product.id][google.cloud.retail.v2beta.Product.id] of the searched
+       * [Product][google.cloud.retail.v2beta.Product].
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + * + * @return The product. + */ + public com.google.cloud.retail.v2beta.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public Builder mergeProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2beta.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+       * The product data snippet in the search response. Only
+       * [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to
+       * be populated.
+       * [Product.variants][google.cloud.retail.v2beta.Product.variants] contains
+       * the product variants that match the search query. If there are multiple
+       * product variants matching the query, top 5 most relevant product variants
+       * are returned and ordered by relevancy.
+       * If relevancy can be deternmined, use
+       * [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields]
+       * to look up matched product variants fields. If relevancy cannot be
+       * determined, e.g. when searching "shoe" all products in a shoe product can
+       * be a match, 5 product variants are returned but order is meaningless.
+       * 
+ * + * .google.cloud.retail.v2beta.Product product = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private int matchingVariantCount_; + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return The matchingVariantCount. + */ + @java.lang.Override + public int getMatchingVariantCount() { + return matchingVariantCount_; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @param value The matchingVariantCount to set. + * @return This builder for chaining. + */ + public Builder setMatchingVariantCount(int value) { + + matchingVariantCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The count of matched
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product]s.
+       * 
+ * + * int32 matching_variant_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMatchingVariantCount() { + + matchingVariantCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + matchingVariantFields_; + + private com.google.protobuf.MapField + internalGetMatchingVariantFields() { + if (matchingVariantFields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + return matchingVariantFields_; + } + + private com.google.protobuf.MapField + internalGetMutableMatchingVariantFields() { + onChanged(); + ; + if (matchingVariantFields_ == null) { + matchingVariantFields_ = + com.google.protobuf.MapField.newMapField( + MatchingVariantFieldsDefaultEntryHolder.defaultEntry); + } + if (!matchingVariantFields_.isMutable()) { + matchingVariantFields_ = matchingVariantFields_.copy(); + } + return matchingVariantFields_; + } + + public int getMatchingVariantFieldsCount() { + return internalGetMatchingVariantFields().getMap().size(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public boolean containsMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMatchingVariantFields().getMap().containsKey(key); + } + /** Use {@link #getMatchingVariantFieldsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getMatchingVariantFields() { + return getMatchingVariantFieldsMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public java.util.Map + getMatchingVariantFieldsMap() { + return internalGetMatchingVariantFields().getMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( + java.lang.String key, com.google.protobuf.FieldMask defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + @java.lang.Override + public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMatchingVariantFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMatchingVariantFields() { + internalGetMutableMatchingVariantFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder removeMatchingVariantFields(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMatchingVariantFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableMatchingVariantFields() { + return internalGetMutableMatchingVariantFields().getMutableMap(); + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putMatchingVariantFields( + java.lang.String key, com.google.protobuf.FieldMask value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableMatchingVariantFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] matches the search query,
+       * this map indicates which [Product][google.cloud.retail.v2beta.Product]
+       * fields are matched. The key is the
+       * [Product.name][google.cloud.retail.v2beta.Product.name], the value is a
+       * field mask of the matched [Product][google.cloud.retail.v2beta.Product]
+       * fields. If matched attributes cannot be determined, this map will be
+       * empty.
+       * For example, a key "sku1" with field mask
+       * "products.color_info" indicates there is a match between
+       * "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query.
+       * 
+ * + * map<string, .google.protobuf.FieldMask> matching_variant_fields = 4; + */ + public Builder putAllMatchingVariantFields( + java.util.Map values) { + internalGetMutableMatchingVariantFields().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField + variantRollupValues_; + + private com.google.protobuf.MapField + internalGetVariantRollupValues() { + if (variantRollupValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + return variantRollupValues_; + } + + private com.google.protobuf.MapField + internalGetMutableVariantRollupValues() { + onChanged(); + ; + if (variantRollupValues_ == null) { + variantRollupValues_ = + com.google.protobuf.MapField.newMapField( + VariantRollupValuesDefaultEntryHolder.defaultEntry); + } + if (!variantRollupValues_.isMutable()) { + variantRollupValues_ = variantRollupValues_.copy(); + } + return variantRollupValues_; + } + + public int getVariantRollupValuesCount() { + return internalGetVariantRollupValues().getMap().size(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public boolean containsVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariantRollupValues().getMap().containsKey(key); + } + /** Use {@link #getVariantRollupValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariantRollupValues() { + return getVariantRollupValuesMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public java.util.Map + getVariantRollupValuesMap() { + return internalGetVariantRollupValues().getMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + @java.lang.Override + public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetVariantRollupValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearVariantRollupValues() { + internalGetMutableVariantRollupValues().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder removeVariantRollupValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableVariantRollupValues().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableVariantRollupValues() { + return internalGetMutableVariantRollupValues().getMutableMap(); + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putVariantRollupValues(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableVariantRollupValues().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * The rollup matching
+       * [variant][google.cloud.retail.v2beta.Product.Type.VARIANT]
+       * [Product][google.cloud.retail.v2beta.Product] attributes. The key is one
+       * of the
+       * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys].
+       * The values are the merged and de-duplicated
+       * [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the
+       * rollup values are respect filter. For example, when filtering by
+       * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
+       * returned.
+       * For textual and numerical attributes, the rollup values is a list of
+       * string or double values with type
+       * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
+       * there are two variants with colors "red" and "blue", the rollup values
+       * are
+       *     { key: "colorFamilies"
+       *       value {
+       *         list_value {
+       *           values { string_value: "red" }
+       *           values { string_value: "blue" }
+       *          }
+       *       }
+       *     }
+       * For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the
+       * rollup values is a double value with type
+       * [google.protobuf.Value][google.protobuf.Value]. For example,
+       * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
+       * are 10 variants in this product are available in the store "store1".
+       * 
+ * + * map<string, .google.protobuf.Value> variant_rollup_values = 5; + */ + public Builder putAllVariantRollupValues( + java.util.Map values) { + internalGetMutableVariantRollupValues().getMutableMap().putAll(values); + 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.SearchResponse.SearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchResponse.SearchResult) + private static final com.google.cloud.retail.v2beta.SearchResponse.SearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchResponse.SearchResult(); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.SearchResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResult(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.SearchResponse.SearchResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FacetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchResponse.Facet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + java.util.List getValuesList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue getValues(int index); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + int getValuesCount(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + java.util.List< + ? extends com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index); + + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + boolean getDynamicFacet(); + } + /** + * + * + *
+   * A facet result.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.Facet} + */ + public static final class Facet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchResponse.Facet) + FacetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Facet.newBuilder() to construct. + private Facet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Facet() { + key_ = ""; + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Facet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Facet( + 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(); + + key_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue>(); + mutable_bitField0_ |= 0x00000001; + } + values_.add( + input.readMessage( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.parser(), + extensionRegistry)); + break; + } + case 24: + { + dynamicFacet_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.Facet.class, + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder.class); + } + + public interface FacetValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return The interval. + */ + com.google.cloud.retail.v2beta.Interval getInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + long getCount(); + + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.FacetValueCase + getFacetValueCase(); + } + /** + * + * + *
+     * A facet value which contains value names and their count.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} + */ + public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + FacetValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetValue.newBuilder() to construct. + private FacetValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FacetValue( + 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(); + facetValueCase_ = 1; + facetValue_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.Interval.Builder subBuilder = null; + if (facetValueCase_ == 2) { + subBuilder = + ((com.google.cloud.retail.v2beta.Interval) facetValue_).toBuilder(); + } + facetValue_ = + input.readMessage( + com.google.cloud.retail.v2beta.Interval.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.Interval) facetValue_); + facetValue_ = subBuilder.buildPartial(); + } + facetValueCase_ = 2; + break; + } + case 24: + { + count_ = input.readInt64(); + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder.class); + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public enum FacetValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALUE(1), + INTERVAL(2), + FACETVALUE_NOT_SET(0); + private final int value; + + private FacetValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FacetValueCase valueOf(int value) { + return forNumber(value); + } + + public static FacetValueCase forNumber(int value) { + switch (value) { + case 1: + return VALUE; + case 2: + return INTERVAL; + case 0: + return FACETVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public static final int VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + 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(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colorFamilies".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 2; + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getInterval() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2beta.Interval) facetValue_; + } + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price".
+       * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalOrBuilder() { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2beta.Interval) facetValue_; + } + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + + public static final int COUNT_FIELD_NUMBER = 3; + private long count_; + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + 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 (facetValueCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetValue_); + } + if (facetValueCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2beta.Interval) facetValue_); + } + if (count_ != 0L) { + output.writeInt64(3, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetValueCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetValue_); + } + if (facetValueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2beta.Interval) facetValue_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); + } + 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.SearchResponse.Facet.FacetValue)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue other = + (com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) obj; + + if (getCount() != other.getCount()) return false; + if (!getFacetValueCase().equals(other.getFacetValueCase())) return false; + switch (facetValueCase_) { + case 1: + if (!getValue().equals(other.getValue())) return false; + break; + case 2: + if (!getInterval().equals(other.getInterval())) return false; + break; + case 0: + default: + } + 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + switch (facetValueCase_) { + case 1: + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + break; + case 2: + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + 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.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue 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.SearchResponse.Facet.FacetValue 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; + } + /** + * + * + *
+       * A facet value which contains value names and their count.
+       * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.class, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.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(); + count_ = 0L; + + facetValueCase_ = 0; + facetValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue build() { + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue buildPartial() { + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue result = + new com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue(this); + if (facetValueCase_ == 1) { + result.facetValue_ = facetValue_; + } + if (facetValueCase_ == 2) { + if (intervalBuilder_ == null) { + result.facetValue_ = facetValue_; + } else { + result.facetValue_ = intervalBuilder_.build(); + } + } + result.count_ = count_; + result.facetValueCase_ = facetValueCase_; + 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.SearchResponse.Facet.FacetValue) { + return mergeFrom( + (com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue other) { + if (other + == com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + .getDefaultInstance()) return this; + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + switch (other.getFacetValueCase()) { + case VALUE: + { + facetValueCase_ = 1; + facetValue_ = other.facetValue_; + onChanged(); + break; + } + case INTERVAL: + { + mergeInterval(other.getInterval()); + break; + } + case FACETVALUE_NOT_SET: + { + break; + } + } + 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.SearchResponse.Facet.FacetValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public Builder clearFacetValue() { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + if (facetValueCase_ == 1) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colorFamilies".
+         * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Interval getInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2beta.Interval) facetValue_; + } + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } else { + if (facetValueCase_ == 2) { + return intervalBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.retail.v2beta.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetValue_ = value; + onChanged(); + } else { + intervalBuilder_.setMessage(value); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + public Builder setInterval( + com.google.cloud.retail.v2beta.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + facetValue_ = builderForValue.build(); + onChanged(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + public Builder mergeInterval(com.google.cloud.retail.v2beta.Interval value) { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2 + && facetValue_ != com.google.cloud.retail.v2beta.Interval.getDefaultInstance()) { + facetValue_ = + com.google.cloud.retail.v2beta.Interval.newBuilder( + (com.google.cloud.retail.v2beta.Interval) facetValue_) + .mergeFrom(value) + .buildPartial(); + } else { + facetValue_ = value; + } + onChanged(); + } else { + if (facetValueCase_ == 2) { + intervalBuilder_.mergeFrom(value); + } else { + intervalBuilder_.setMessage(value); + } + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + public Builder clearInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + } else { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + } + intervalBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + public com.google.cloud.retail.v2beta.Interval.Builder getIntervalBuilder() { + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.IntervalOrBuilder getIntervalOrBuilder() { + if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + if (facetValueCase_ == 2) { + return (com.google.cloud.retail.v2beta.Interval) facetValue_; + } + return com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price".
+         * 
+ * + * .google.cloud.retail.v2beta.Interval interval = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + if (!(facetValueCase_ == 2)) { + facetValue_ = com.google.cloud.retail.v2beta.Interval.getDefaultInstance(); + } + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Interval, + com.google.cloud.retail.v2beta.Interval.Builder, + com.google.cloud.retail.v2beta.IntervalOrBuilder>( + (com.google.cloud.retail.v2beta.Interval) facetValue_, + getParentForChildren(), + isClean()); + facetValue_ = null; + } + facetValueCase_ = 2; + onChanged(); + ; + return intervalBuilder_; + } + + private long count_; + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + 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.SearchResponse.Facet.FacetValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue) + private static final com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue(); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FacetValue(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.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+     * The key for this facet. E.g., "colorFamilies" or "price" or
+     * "attributes.attr1".
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 2; + private java.util.List values_; + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public java.util.List + getValuesList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + return values_.get(index); + } + + public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; + private boolean dynamicFacet_; + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + + 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + output.writeBool(3, dynamicFacet_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dynamicFacet_); + } + 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.SearchResponse.Facet)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchResponse.Facet other = + (com.google.cloud.retail.v2beta.SearchResponse.Facet) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (getDynamicFacet() != other.getDynamicFacet()) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (37 * hash) + DYNAMIC_FACET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDynamicFacet()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet 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.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet 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.SearchResponse.Facet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet 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.SearchResponse.Facet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet 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.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet 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.SearchResponse.Facet 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.SearchResponse.Facet 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.SearchResponse.Facet 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; + } + /** + * + * + *
+     * A facet result.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.Facet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchResponse.Facet) + com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.Facet.class, + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchResponse.Facet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + valuesBuilder_.clear(); + } + dynamicFacet_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchResponse.Facet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet build() { + com.google.cloud.retail.v2beta.SearchResponse.Facet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet buildPartial() { + com.google.cloud.retail.v2beta.SearchResponse.Facet result = + new com.google.cloud.retail.v2beta.SearchResponse.Facet(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + result.dynamicFacet_ = dynamicFacet_; + 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.SearchResponse.Facet) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchResponse.Facet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchResponse.Facet other) { + if (other == com.google.cloud.retail.v2beta.SearchResponse.Facet.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getDynamicFacet() != false) { + setDynamicFacet(other.getDynamicFacet()); + } + 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.SearchResponse.Facet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchResponse.Facet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colorFamilies" or "price" or
+       * "attributes.attr1".
+       * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.util.List + values_ = java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue>(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List + getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addAllValues( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue> + values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder + getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.retail.v2beta.SearchResponse.Facet.FacetValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + private boolean dynamicFacet_; + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @param value The dynamicFacet to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacet(boolean value) { + + dynamicFacet_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacet() { + + dynamicFacet_ = 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.SearchResponse.Facet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchResponse.Facet) + private static final com.google.cloud.retail.v2beta.SearchResponse.Facet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchResponse.Facet(); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.Facet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Facet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Facet(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.SearchResponse.Facet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + boolean getExpandedQuery(); + + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + long getPinnedResultCount(); + } + /** + * + * + *
+   * Information describing query expansion including whether expansion has
+   * occurred.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + QueryExpansionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionInfo.newBuilder() to construct. + private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryExpansionInfo( + 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 8: + { + expandedQuery_ = input.readBool(); + break; + } + case 16: + { + pinnedResultCount_ = input.readInt64(); + 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.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder.class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_; + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + + public static final int PINNED_RESULT_COUNT_FIELD_NUMBER = 2; + private long pinnedResultCount_; + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + + 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 (expandedQuery_ != false) { + output.writeBool(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + output.writeInt64(2, pinnedResultCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expandedQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pinnedResultCount_); + } + 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.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (getPinnedResultCount() != other.getPinnedResultCount()) 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) + EXPANDED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); + hash = (37 * hash) + PINNED_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPinnedResultCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + 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.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo 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.SearchResponse.QueryExpansionInfo 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; + } + /** + * + * + *
+     * Information describing query expansion including whether expansion has
+     * occurred.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.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(); + expandedQuery_ = false; + + pinnedResultCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo buildPartial() { + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo(this); + result.expandedQuery_ = expandedQuery_; + result.pinnedResultCount_ = pinnedResultCount_; + 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.SearchResponse.QueryExpansionInfo) { + return mergeFrom( + (com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); + } + if (other.getPinnedResultCount() != 0L) { + setPinnedResultCount(other.getPinnedResultCount()); + } + 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.SearchResponse.QueryExpansionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean expandedQuery_; + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @param value The expandedQuery to set. + * @return This builder for chaining. + */ + public Builder setExpandedQuery(boolean value) { + + expandedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearExpandedQuery() { + + expandedQuery_ = false; + onChanged(); + return this; + } + + private long pinnedResultCount_; + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @param value The pinnedResultCount to set. + * @return This builder for chaining. + */ + public Builder setPinnedResultCount(long value) { + + pinnedResultCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinnedResultCount() { + + pinnedResultCount_ = 0L; + 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.SearchResponse.QueryExpansionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo(); + } + + public static com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryExpansionInfo(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.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + private java.util.List results_; + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 2; + private java.util.List facets_; + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List getFacetsList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List + getFacetsOrBuilderList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public int getFacetsCount() { + return facets_.size(); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.Facet getFacets(int index) { + return facets_.get(index); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + return facets_.get(index); + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_; + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2beta.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + public static final int CORRECTED_QUERY_FIELD_NUMBER = 4; + private volatile java.lang.Object correctedQuery_; + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + @java.lang.Override + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + 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(); + correctedQuery_ = s; + return s; + } + } + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 7; + private com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionInfo() { + return queryExpansionInfo_ != null; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return getQueryExpansionInfo(); + } + + public static final int REDIRECT_URI_FIELD_NUMBER = 10; + private volatile java.lang.Object redirectUri_; + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + 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(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLIED_CONTROLS_FIELD_NUMBER = 12; + private com.google.protobuf.LazyStringList appliedControls_; + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + return appliedControls_; + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + public java.lang.String getAppliedControls(int index) { + return appliedControls_.get(index); + } + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { + return appliedControls_.getByteString(index); + } + + public static final int INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER = 14; + private java.util.List + invalidConditionBoostSpecs_; + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public java.util.List + getInvalidConditionBoostSpecsList() { + return invalidConditionBoostSpecs_; + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList() { + return invalidConditionBoostSpecs_; + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public int getInvalidConditionBoostSpecsCount() { + return invalidConditionBoostSpecs_.size(); + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index) { + return invalidConditionBoostSpecs_.get(index); + } + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index) { + return invalidConditionBoostSpecs_.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 { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + output.writeMessage(2, facets_.get(i)); + } + if (totalSize_ != 0) { + output.writeInt32(3, totalSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, correctedQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + output.writeMessage(7, getQueryExpansionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectUri_); + } + for (int i = 0; i < appliedControls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, appliedControls_.getRaw(i)); + } + for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { + output.writeMessage(14, invalidConditionBoostSpecs_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, facets_.get(i)); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, correctedQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, nextPageToken_); + } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getQueryExpansionInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, redirectUri_); + } + { + int dataSize = 0; + for (int i = 0; i < appliedControls_.size(); i++) { + dataSize += computeStringSizeNoTag(appliedControls_.getRaw(i)); + } + size += dataSize; + size += 1 * getAppliedControlsList().size(); + } + for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, invalidConditionBoostSpecs_.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.SearchResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SearchResponse other = + (com.google.cloud.retail.v2beta.SearchResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getFacetsList().equals(other.getFacetsList())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } + if (!getRedirectUri().equals(other.getRedirectUri())) return false; + if (!getAppliedControlsList().equals(other.getAppliedControlsList())) return false; + if (!getInvalidConditionBoostSpecsList().equals(other.getInvalidConditionBoostSpecsList())) + 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 (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (getFacetsCount() > 0) { + hash = (37 * hash) + FACETS_FIELD_NUMBER; + hash = (53 * hash) + getFacetsList().hashCode(); + } + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedQuery().hashCode(); + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } + hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + if (getAppliedControlsCount() > 0) { + hash = (37 * hash) + APPLIED_CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getAppliedControlsList().hashCode(); + } + if (getInvalidConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getInvalidConditionBoostSpecsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SearchResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse 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.SearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse 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.SearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SearchResponse 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.SearchResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse 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.SearchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SearchResponse 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.SearchResponse 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.SearchResponse 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.SearchResponse 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 message for
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SearchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SearchResponse) + com.google.cloud.retail.v2beta.SearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SearchResponse.class, + com.google.cloud.retail.v2beta.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SearchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + getFacetsFieldBuilder(); + getInvalidConditionBoostSpecsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + facetsBuilder_.clear(); + } + totalSize_ = 0; + + correctedQuery_ = ""; + + attributionToken_ = ""; + + nextPageToken_ = ""; + + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + redirectUri_ = ""; + + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + invalidConditionBoostSpecsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.SearchServiceProto + .internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse build() { + com.google.cloud.retail.v2beta.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchResponse buildPartial() { + com.google.cloud.retail.v2beta.SearchResponse result = + new com.google.cloud.retail.v2beta.SearchResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (facetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.facets_ = facets_; + } else { + result.facets_ = facetsBuilder_.build(); + } + result.totalSize_ = totalSize_; + result.correctedQuery_ = correctedQuery_; + result.attributionToken_ = attributionToken_; + result.nextPageToken_ = nextPageToken_; + if (queryExpansionInfoBuilder_ == null) { + result.queryExpansionInfo_ = queryExpansionInfo_; + } else { + result.queryExpansionInfo_ = queryExpansionInfoBuilder_.build(); + } + result.redirectUri_ = redirectUri_; + if (((bitField0_ & 0x00000004) != 0)) { + appliedControls_ = appliedControls_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.appliedControls_ = appliedControls_; + if (invalidConditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecs_; + } else { + result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecsBuilder_.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.SearchResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchResponse other) { + if (other == com.google.cloud.retail.v2beta.SearchResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (facetsBuilder_ == null) { + if (!other.facets_.isEmpty()) { + if (facets_.isEmpty()) { + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFacetsIsMutable(); + facets_.addAll(other.facets_); + } + onChanged(); + } + } else { + if (!other.facets_.isEmpty()) { + if (facetsBuilder_.isEmpty()) { + facetsBuilder_.dispose(); + facetsBuilder_ = null; + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + facetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetsFieldBuilder() + : null; + } else { + facetsBuilder_.addAllMessages(other.facets_); + } + } + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (!other.getCorrectedQuery().isEmpty()) { + correctedQuery_ = other.correctedQuery_; + onChanged(); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + onChanged(); + } + if (!other.appliedControls_.isEmpty()) { + if (appliedControls_.isEmpty()) { + appliedControls_ = other.appliedControls_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAppliedControlsIsMutable(); + appliedControls_.addAll(other.appliedControls_); + } + onChanged(); + } + if (invalidConditionBoostSpecsBuilder_ == null) { + if (!other.invalidConditionBoostSpecs_.isEmpty()) { + if (invalidConditionBoostSpecs_.isEmpty()) { + invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.addAll(other.invalidConditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.invalidConditionBoostSpecs_.isEmpty()) { + if (invalidConditionBoostSpecsBuilder_.isEmpty()) { + invalidConditionBoostSpecsBuilder_.dispose(); + invalidConditionBoostSpecsBuilder_ = null; + invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + invalidConditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInvalidConditionBoostSpecsFieldBuilder() + : null; + } else { + invalidConditionBoostSpecsBuilder_.addAllMessages(other.invalidConditionBoostSpecs_); + } + } + } + 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.SearchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.SearchResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList( + results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.SearchResult, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, com.google.cloud.retail.v2beta.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder setResults( + int index, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder addResults(com.google.cloud.retail.v2beta.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, com.google.cloud.retail.v2beta.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder addResults( + int index, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder addAllResults( + java.lang.Iterable + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public java.util.List< + ? extends com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched items. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.SearchResult, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.SearchResult, + com.google.cloud.retail.v2beta.SearchResponse.SearchResult.Builder, + com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.util.List facets_ = + java.util.Collections.emptyList(); + + private void ensureFacetsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList(facets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet, + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder> + facetsBuilder_; + + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public java.util.List getFacetsList() { + if (facetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facets_); + } else { + return facetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public int getFacetsCount() { + if (facetsBuilder_ == null) { + return facets_.size(); + } else { + return facetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet getFacets(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder setFacets(int index, com.google.cloud.retail.v2beta.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.set(index, value); + onChanged(); + } else { + facetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.set(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(com.google.cloud.retail.v2beta.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(value); + onChanged(); + } else { + facetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(int index, com.google.cloud.retail.v2beta.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(index, value); + onChanged(); + } else { + facetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder addAllFacets( + java.lang.Iterable values) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facets_); + onChanged(); + } else { + facetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder clearFacets() { + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + facetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public Builder removeFacets(int index) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.remove(index); + onChanged(); + } else { + facetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder getFacetsBuilder(int index) { + return getFacetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facets_); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder addFacetsBuilder() { + return getFacetsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder addFacetsBuilder(int index) { + return getFacetsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet, + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.Facet, + com.google.cloud.retail.v2beta.SearchResponse.Facet.Builder, + com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder>( + facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + facets_ = null; + } + return facetsBuilder_; + } + + private int totalSize_; + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2beta.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2beta.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of [results][google.cloud.retail.v2beta.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that
+     * matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object correctedQuery_ = ""; + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + public java.lang.String getCorrectedQuery() { + java.lang.Object ref = correctedQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + correctedQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + public com.google.protobuf.ByteString getCorrectedQueryBytes() { + java.lang.Object ref = correctedQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + correctedQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + correctedQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedQuery() { + + correctedQuery_ = getDefaultInstance().getCorrectedQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * If spell correction applies, the corrected query. Otherwise, empty.
+     * 
+ * + * string corrected_query = 4; + * + * @param value The bytes for correctedQuery to set. + * @return This builder for chaining. + */ + public Builder setCorrectedQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + correctedQuery_ = value; + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+     * search, which enables accurate attribution of search model performance.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 6; + * + * @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; + } + + private com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return queryExpansionInfoBuilder_ != null || queryExpansionInfo_ != null; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + onChanged(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (queryExpansionInfo_ != null) { + queryExpansionInfo_ = + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.newBuilder( + queryExpansionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + queryExpansionInfo_ = value; + } + onChanged(); + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public Builder clearQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = null; + onChanged(); + } else { + queryExpansionInfo_ = null; + queryExpansionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + public com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redirectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + + redirectUri_ = getDefaultInstance().getRedirectUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search will be performed, and only
+     * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+     * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * will be set in the response.
+     * 
+ * + * string redirect_uri = 10; + * + * @param value The bytes for redirectUri to set. + * @return This builder for chaining. + */ + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redirectUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList appliedControls_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAppliedControlsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + appliedControls_ = new com.google.protobuf.LazyStringArrayList(appliedControls_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + return appliedControls_.getUnmodifiableView(); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + public java.lang.String getAppliedControls(int index) { + return appliedControls_.get(index); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { + return appliedControls_.getByteString(index); + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index to set the value at. + * @param value The appliedControls to set. + * @return This builder for chaining. + */ + public Builder setAppliedControls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliedControlsIsMutable(); + appliedControls_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param value The appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAppliedControls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppliedControlsIsMutable(); + appliedControls_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param values The appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAllAppliedControls(java.lang.Iterable values) { + ensureAppliedControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appliedControls_); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @return This builder for chaining. + */ + public Builder clearAppliedControls() { + appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The fully qualified resource name of applied
+     * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+     * 
+ * + * repeated string applied_controls = 12; + * + * @param value The bytes of the appliedControls to add. + * @return This builder for chaining. + */ + public Builder addAppliedControlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAppliedControlsIsMutable(); + appliedControls_.add(value); + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureInvalidConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + invalidConditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec>( + invalidConditionBoostSpecs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + invalidConditionBoostSpecsBuilder_; + + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List + getInvalidConditionBoostSpecsList() { + if (invalidConditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } else { + return invalidConditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public int getInvalidConditionBoostSpecsCount() { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.size(); + } else { + return invalidConditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.get(index); + } else { + return invalidConditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder setInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.set(index, value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder setInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (invalidConditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(index, value); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addInvalidConditionBoostSpecs( + int index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder addAllInvalidConditionBoostSpecs( + java.lang.Iterable< + ? extends com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec> + values) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidConditionBoostSpecs_); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder clearInvalidConditionBoostSpecs() { + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public Builder removeInvalidConditionBoostSpecs(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + ensureInvalidConditionBoostSpecsIsMutable(); + invalidConditionBoostSpecs_.remove(index); + onChanged(); + } else { + invalidConditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getInvalidConditionBoostSpecsBuilder(int index) { + return getInvalidConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index) { + if (invalidConditionBoostSpecsBuilder_ == null) { + return invalidConditionBoostSpecs_.get(index); + } else { + return invalidConditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList() { + if (invalidConditionBoostSpecsBuilder_ != null) { + return invalidConditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); + } + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addInvalidConditionBoostSpecsBuilder() { + return getInvalidConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addInvalidConditionBoostSpecsBuilder(int index) { + return getInvalidConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+     * The invalid
+     * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+     * that are not applied during serving.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + public java.util.List< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> + getInvalidConditionBoostSpecsBuilderList() { + return getInvalidConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsFieldBuilder() { + if (invalidConditionBoostSpecsBuilder_ == null) { + invalidConditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>( + invalidConditionBoostSpecs_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + invalidConditionBoostSpecs_ = null; + } + return invalidConditionBoostSpecsBuilder_; + } + + @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.SearchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SearchResponse) + private static final com.google.cloud.retail.v2beta.SearchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SearchResponse(); + } + + public static com.google.cloud.retail.v2beta.SearchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchResponse(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.SearchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponseOrBuilder.java new file mode 100644 index 00000000..d18f2712 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponseOrBuilder.java @@ -0,0 +1,436 @@ +/* + * 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/search_service.proto + +package com.google.cloud.retail.v2beta; + +public interface SearchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + java.util.List getResultsList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2beta.SearchResponse.SearchResult getResults(int index); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + int getResultsCount(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + java.util.List + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of matched items. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.SearchResult results = 1; + */ + com.google.cloud.retail.v2beta.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + java.util.List getFacetsList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2beta.SearchResponse.Facet getFacets(int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + int getFacetsCount(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + java.util.List + getFacetsOrBuilderList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchResponse.Facet facets = 2; + */ + com.google.cloud.retail.v2beta.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index); + + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of [results][google.cloud.retail.v2beta.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that
+   * matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); + + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The correctedQuery. + */ + java.lang.String getCorrectedQuery(); + /** + * + * + *
+   * If spell correction applies, the corrected query. Otherwise, empty.
+   * 
+ * + * string corrected_query = 4; + * + * @return The bytes for correctedQuery. + */ + com.google.protobuf.ByteString getCorrectedQueryBytes(); + + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this
+   * search, which enables accurate attribution of search model performance.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 6; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * .google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfo query_expansion_info = 7; + * + */ + com.google.cloud.retail.v2beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); + + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search will be performed, and only
+   * [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and
+   * [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * will be set in the response.
+   * 
+ * + * string redirect_uri = 10; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return A list containing the appliedControls. + */ + java.util.List getAppliedControlsList(); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @return The count of appliedControls. + */ + int getAppliedControlsCount(); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + java.lang.String getAppliedControls(int index); + /** + * + * + *
+   * The fully qualified resource name of applied
+   * [controls](https://cloud.google.com/retail/docs/serving-control-rules).
+   * 
+ * + * repeated string applied_controls = 12; + * + * @param index The index of the value to return. + * @return The bytes of the appliedControls at the given index. + */ + com.google.protobuf.ByteString getAppliedControlsBytes(int index); + + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + java.util.List + getInvalidConditionBoostSpecsList(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec + getInvalidConditionBoostSpecs(int index); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + int getInvalidConditionBoostSpecsCount(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + java.util.List< + ? extends + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> + getInvalidConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+   * The invalid
+   * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs]
+   * that are not applied during serving.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getInvalidConditionBoostSpecsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java new file mode 100644 index 00000000..3c6d4e8b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java @@ -0,0 +1,407 @@ +/* + * 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/search_service.proto + +package com.google.cloud.retail.v2beta; + +public final class SearchServiceProto { + private SearchServiceProto() {} + + 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_SearchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_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/search_serv" + + "ice.proto\022\032google.cloud.retail.v2beta\032\034g" + + "oogle/api/annotations.proto\032\027google/api/" + + "client.proto\032\037google/api/field_behavior." + + "proto\032\031google/api/resource.proto\032\'google" + + "/cloud/retail/v2beta/common.proto\032(googl" + + "e/cloud/retail/v2beta/product.proto\032 goo" + + "gle/protobuf/field_mask.proto\032\034google/pr" + + "otobuf/struct.proto\"\242\020\n\rSearchRequest\022\026\n" + + "\tplacement\030\001 \001(\tB\003\340A\002\0221\n\006branch\030\002 \001(\tB!\372" + + "A\036\n\034retail.googleapis.com/Branch\022\r\n\005quer" + + "y\030\003 \001(\t\022\027\n\nvisitor_id\030\004 \001(\tB\003\340A\002\0227\n\tuser" + + "_info\030\005 \001(\0132$.google.cloud.retail.v2beta" + + ".UserInfo\022\021\n\tpage_size\030\007 \001(\005\022\022\n\npage_tok" + + "en\030\010 \001(\t\022\016\n\006offset\030\t \001(\005\022\016\n\006filter\030\n \001(\t" + + "\022\030\n\020canonical_filter\030\034 \001(\t\022\020\n\010order_by\030\013" + + " \001(\t\022H\n\013facet_specs\030\014 \003(\01323.google.cloud" + + ".retail.v2beta.SearchRequest.FacetSpec\022Z" + + "\n\022dynamic_facet_spec\030\025 \001(\0132:.google.clou" + + "d.retail.v2beta.SearchRequest.DynamicFac" + + "etSpecB\002\030\001\022G\n\nboost_spec\030\r \001(\01323.google." + + "cloud.retail.v2beta.SearchRequest.BoostS" + + "pec\022Z\n\024query_expansion_spec\030\016 \001(\0132<.goog" + + "le.cloud.retail.v2beta.SearchRequest.Que" + + "ryExpansionSpec\022\033\n\023variant_rollup_keys\030\021" + + " \003(\t\022\027\n\017page_categories\030\027 \003(\t\022I\n\013search_" + + "mode\030\037 \001(\01624.google.cloud.retail.v2beta." + + "SearchRequest.SearchMode\022[\n\024personalizat" + + "ion_spec\030 \001(\0132=.google.cloud.retail.v2b" + + "eta.SearchRequest.PersonalizationSpec\032\347\002" + + "\n\tFacetSpec\022T\n\tfacet_key\030\001 \001(\0132<.google." + + "cloud.retail.v2beta.SearchRequest.FacetS" + + "pec.FacetKeyB\003\340A\002\022\r\n\005limit\030\002 \001(\005\022\034\n\024excl" + + "uded_filter_keys\030\003 \003(\t\022\037\n\027enable_dynamic" + + "_position\030\004 \001(\010\032\265\001\n\010FacetKey\022\020\n\003key\030\001 \001(" + + "\tB\003\340A\002\0227\n\tintervals\030\002 \003(\0132$.google.cloud" + + ".retail.v2beta.Interval\022\031\n\021restricted_va" + + "lues\030\003 \003(\t\022\020\n\010prefixes\030\010 \003(\t\022\020\n\010contains" + + "\030\t \003(\t\022\020\n\010order_by\030\004 \001(\t\022\r\n\005query\030\005 \001(\t\032" + + "\232\001\n\020DynamicFacetSpec\022M\n\004mode\030\001 \001(\0162?.goo" + + "gle.cloud.retail.v2beta.SearchRequest.Dy" + + "namicFacetSpec.Mode\"7\n\004Mode\022\024\n\020MODE_UNSP" + + "ECIFIED\020\000\022\014\n\010DISABLED\020\001\022\013\n\007ENABLED\020\002\032\362\001\n" + + "\tBoostSpec\022e\n\025condition_boost_specs\030\001 \003(" + + "\0132F.google.cloud.retail.v2beta.SearchReq" + + "uest.BoostSpec.ConditionBoostSpec\022\'\n\032ski" + + "p_boost_spec_validation\030\002 \001(\010H\000\210\001\001\0326\n\022Co" + + "nditionBoostSpec\022\021\n\tcondition\030\001 \001(\t\022\r\n\005b" + + "oost\030\002 \001(\002B\035\n\033_skip_boost_spec_validatio" + + "n\032\317\001\n\022QueryExpansionSpec\022Y\n\tcondition\030\001 " + + "\001(\0162F.google.cloud.retail.v2beta.SearchR" + + "equest.QueryExpansionSpec.Condition\022\036\n\026p" + + "in_unexpanded_results\030\002 \001(\010\">\n\tCondition" + + "\022\031\n\025CONDITION_UNSPECIFIED\020\000\022\014\n\010DISABLED\020" + + "\001\022\010\n\004AUTO\020\003\032\235\001\n\023PersonalizationSpec\022P\n\004m" + + "ode\030\001 \001(\0162B.google.cloud.retail.v2beta.S" + + "earchRequest.PersonalizationSpec.Mode\"4\n" + + "\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\010\n\004AUTO\020\001\022\014\n" + + "\010DISABLED\020\002\"[\n\nSearchMode\022\033\n\027SEARCH_MODE" + + "_UNSPECIFIED\020\000\022\027\n\023PRODUCT_SEARCH_ONLY\020\001\022" + + "\027\n\023FACETED_SEARCH_ONLY\020\002\"\275\n\n\016SearchRespo" + + "nse\022H\n\007results\030\001 \003(\01327.google.cloud.reta" + + "il.v2beta.SearchResponse.SearchResult\022@\n" + + "\006facets\030\002 \003(\01320.google.cloud.retail.v2be" + + "ta.SearchResponse.Facet\022\022\n\ntotal_size\030\003 " + + "\001(\005\022\027\n\017corrected_query\030\004 \001(\t\022\031\n\021attribut" + + "ion_token\030\005 \001(\t\022\027\n\017next_page_token\030\006 \001(\t" + + "\022[\n\024query_expansion_info\030\007 \001(\0132=.google." + + "cloud.retail.v2beta.SearchResponse.Query" + + "ExpansionInfo\022\024\n\014redirect_uri\030\n \001(\t\022\030\n\020a" + + "pplied_controls\030\014 \003(\t\022m\n\035invalid_conditi" + + "on_boost_specs\030\016 \003(\0132F.google.cloud.reta" + + "il.v2beta.SearchRequest.BoostSpec.Condit" + + "ionBoostSpec\032\204\004\n\014SearchResult\022\n\n\002id\030\001 \001(" + + "\t\0224\n\007product\030\002 \001(\0132#.google.cloud.retail" + + ".v2beta.Product\022\036\n\026matching_variant_coun" + + "t\030\003 \001(\005\022s\n\027matching_variant_fields\030\004 \003(\013" + + "2R.google.cloud.retail.v2beta.SearchResp" + + "onse.SearchResult.MatchingVariantFieldsE" + + "ntry\022o\n\025variant_rollup_values\030\005 \003(\0132P.go" + + "ogle.cloud.retail.v2beta.SearchResponse." + + "SearchResult.VariantRollupValuesEntry\032X\n" + + "\032MatchingVariantFieldsEntry\022\013\n\003key\030\001 \001(\t" + + "\022)\n\005value\030\002 \001(\0132\032.google.protobuf.FieldM" + + "ask:\0028\001\032R\n\030VariantRollupValuesEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobu" + + "f.Value:\0028\001\032\357\001\n\005Facet\022\013\n\003key\030\001 \001(\t\022K\n\006va" + + "lues\030\002 \003(\0132;.google.cloud.retail.v2beta." + + "SearchResponse.Facet.FacetValue\022\025\n\rdynam" + + "ic_facet\030\003 \001(\010\032u\n\nFacetValue\022\017\n\005value\030\001 " + + "\001(\tH\000\0228\n\010interval\030\002 \001(\0132$.google.cloud.r" + + "etail.v2beta.IntervalH\000\022\r\n\005count\030\003 \001(\003B\r" + + "\n\013facet_value\032I\n\022QueryExpansionInfo\022\026\n\016e" + + "xpanded_query\030\001 \001(\010\022\033\n\023pinned_result_cou" + + "nt\030\002 \001(\0032\222\002\n\rSearchService\022\265\001\n\006Search\022)." + + "google.cloud.retail.v2beta.SearchRequest" + + "\032*.google.cloud.retail.v2beta.SearchResp" + + "onse\"T\202\323\344\223\002N\"I/v2beta/{placement=project" + + "s/*/locations/*/catalogs/*/placements/*}" + + ":search:\001*\032I\312A\025retail.googleapis.com\322A.h" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tformB\333\001\n\036com.google.cloud.retail.v2beta" + + "B\022SearchServiceProtoP\001Z@google.golang.or" + + "g/genproto/googleapis/cloud/retail/v2bet" + + "a;retail\242\002\006RETAIL\252\002\032Google.Cloud.Retail." + + "V2Beta\312\002\032Google\\Cloud\\Retail\\V2beta\352\002\035Go" + + "ogle::Cloud::Retail::V2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_SearchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor, + new java.lang.String[] { + "Placement", + "Branch", + "Query", + "VisitorId", + "UserInfo", + "PageSize", + "PageToken", + "Offset", + "Filter", + "CanonicalFilter", + "OrderBy", + "FacetSpecs", + "DynamicFacetSpec", + "BoostSpec", + "QueryExpansionSpec", + "VariantRollupKeys", + "PageCategories", + "SearchMode", + "PersonalizationSpec", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor, + new java.lang.String[] { + "FacetKey", "Limit", "ExcludedFilterKeys", "EnableDynamicPosition", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_FacetSpec_FacetKey_descriptor, + new java.lang.String[] { + "Key", "Intervals", "RestrictedValues", "Prefixes", "Contains", "OrderBy", "Query", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_DynamicFacetSpec_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor, + new java.lang.String[] { + "ConditionBoostSpecs", "SkipBoostSpecValidation", "SkipBoostSpecValidation", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor, + new java.lang.String[] { + "Condition", "Boost", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_QueryExpansionSpec_descriptor, + new java.lang.String[] { + "Condition", "PinUnexpandedResults", + }); + internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor = + internal_static_google_cloud_retail_v2beta_SearchRequest_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchRequest_PersonalizationSpec_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_SearchResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor, + new java.lang.String[] { + "Results", + "Facets", + "TotalSize", + "CorrectedQuery", + "AttributionToken", + "NextPageToken", + "QueryExpansionInfo", + "RedirectUri", + "AppliedControls", + "InvalidConditionBoostSpecs", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor, + new java.lang.String[] { + "Id", + "Product", + "MatchingVariantCount", + "MatchingVariantFields", + "VariantRollupValues", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor, + new java.lang.String[] { + "Key", "Values", "DynamicFacet", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_Facet_FacetValue_descriptor, + new java.lang.String[] { + "Value", "Interval", "Count", "FacetValue", + }); + internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor = + internal_static_google_cloud_retail_v2beta_SearchResponse_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_SearchResponse_QueryExpansionInfo_descriptor, + new java.lang.String[] { + "ExpandedQuery", "PinnedResultCount", + }); + 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.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + 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.CommonProto.getDescriptor(); + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java new file mode 100644 index 00000000..cbe344e8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java @@ -0,0 +1,185 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The use case of Cloud Retail Search.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SearchSolutionUseCase} + */ +public enum SearchSolutionUseCase implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The value when it's unspecified. Defaults to
+   * [SEARCH][].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + */ + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED(0), + /** + * + * + *
+   * Search use case. Expects the traffic has a non-empty
+   * [query][google.cloud.retail.v2beta.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + */ + SEARCH_SOLUTION_USE_CASE_SEARCH(1), + /** + * + * + *
+   * Browse use case. Expects the traffic has an empty
+   * [query][google.cloud.retail.v2beta.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + */ + SEARCH_SOLUTION_USE_CASE_BROWSE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The value when it's unspecified. Defaults to
+   * [SEARCH][].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + */ + public static final int SEARCH_SOLUTION_USE_CASE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Search use case. Expects the traffic has a non-empty
+   * [query][google.cloud.retail.v2beta.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + */ + public static final int SEARCH_SOLUTION_USE_CASE_SEARCH_VALUE = 1; + /** + * + * + *
+   * Browse use case. Expects the traffic has an empty
+   * [query][google.cloud.retail.v2beta.SearchRequest.query].
+   * 
+ * + * SEARCH_SOLUTION_USE_CASE_BROWSE = 2; + */ + public static final int SEARCH_SOLUTION_USE_CASE_BROWSE_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 SearchSolutionUseCase 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 SearchSolutionUseCase forNumber(int value) { + switch (value) { + case 0: + return SEARCH_SOLUTION_USE_CASE_UNSPECIFIED; + case 1: + return SEARCH_SOLUTION_USE_CASE_SEARCH; + case 2: + return SEARCH_SOLUTION_USE_CASE_BROWSE; + 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 SearchSolutionUseCase findValueByNumber(int number) { + return SearchSolutionUseCase.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.CommonProto.getDescriptor().getEnumTypes().get(2); + } + + private static final SearchSolutionUseCase[] VALUES = values(); + + public static SearchSolutionUseCase 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 SearchSolutionUseCase(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SearchSolutionUseCase) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java new file mode 100644 index 00000000..727160db --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java @@ -0,0 +1,6140 @@ +/* + * 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/serving_config.proto + +package com.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.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ServingConfig} + */ +public final class ServingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ServingConfig) + ServingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServingConfig.newBuilder() to construct. + private ServingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServingConfig() { + name_ = ""; + displayName_ = ""; + modelId_ = ""; + priceRerankingLevel_ = ""; + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + diversityLevel_ = ""; + enableCategoryFilterLevel_ = ""; + solutionTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServingConfig( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + modelId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + priceRerankingLevel_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + facetControlIds_.add(s); + break; + } + case 50: + { + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder subBuilder = + null; + if (dynamicFacetSpec_ != null) { + subBuilder = dynamicFacetSpec_.toBuilder(); + } + dynamicFacetSpec_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dynamicFacetSpec_); + dynamicFacetSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + boostControlIds_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + diversityLevel_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + filterControlIds_.add(s); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + redirectControlIds_.add(s); + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + onewaySynonymsControlIds_.add(s); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000040; + } + doNotAssociateControlIds_.add(s); + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000080; + } + replacementControlIds_.add(s); + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + ignoreControlIds_.add(s); + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + enableCategoryFilterLevel_ = s; + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + twowaySynonymsControlIds_.add(s); + break; + } + case 152: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + solutionTypes_.add(rawValue); + break; + } + case 154: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + solutionTypes_.add(rawValue); + } + input.popLimit(oldLimit); + 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)) { + facetControlIds_ = facetControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = boostControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = filterControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = redirectControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = onewaySynonymsControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = doNotAssociateControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = replacementControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = ignoreControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = twowaySynonymsControlIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigProto + .internal_static_google_cloud_retail_v2beta_ServingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigProto + .internal_static_google_cloud_retail_v2beta_ServingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ServingConfig.class, + com.google.cloud.retail.v2beta.ServingConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * 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 human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * 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 MODEL_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object modelId_; + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + @java.lang.Override + public java.lang.String getModelId() { + java.lang.Object ref = modelId_; + 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(); + modelId_ = s; + return s; + } + } + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelIdBytes() { + java.lang.Object ref = modelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_RERANKING_LEVEL_FIELD_NUMBER = 4; + private volatile java.lang.Object priceRerankingLevel_; + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + @java.lang.Override + public java.lang.String getPriceRerankingLevel() { + java.lang.Object ref = priceRerankingLevel_; + 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(); + priceRerankingLevel_ = s; + return s; + } + } + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPriceRerankingLevelBytes() { + java.lang.Object ref = priceRerankingLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + priceRerankingLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FACET_CONTROL_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList facetControlIds_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + public com.google.protobuf.ProtocolStringList getFacetControlIdsList() { + return facetControlIds_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + public int getFacetControlIdsCount() { + return facetControlIds_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + public java.lang.String getFacetControlIds(int index) { + return facetControlIds_.get(index); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + public com.google.protobuf.ByteString getFacetControlIdsBytes(int index) { + return facetControlIds_.getByteString(index); + } + + public static final int DYNAMIC_FACET_SPEC_FIELD_NUMBER = 6; + private com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * @return Whether the dynamicFacetSpec field is set. + */ + @java.lang.Override + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpec_ != null; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * @return The dynamicFacetSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + return getDynamicFacetSpec(); + } + + public static final int BOOST_CONTROL_IDS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList boostControlIds_; + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + public com.google.protobuf.ProtocolStringList getBoostControlIdsList() { + return boostControlIds_; + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + public int getBoostControlIdsCount() { + return boostControlIds_.size(); + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + public java.lang.String getBoostControlIds(int index) { + return boostControlIds_.get(index); + } + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + public com.google.protobuf.ByteString getBoostControlIdsBytes(int index) { + return boostControlIds_.getByteString(index); + } + + public static final int FILTER_CONTROL_IDS_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList filterControlIds_; + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + public com.google.protobuf.ProtocolStringList getFilterControlIdsList() { + return filterControlIds_; + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + public int getFilterControlIdsCount() { + return filterControlIds_.size(); + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + public java.lang.String getFilterControlIds(int index) { + return filterControlIds_.get(index); + } + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + public com.google.protobuf.ByteString getFilterControlIdsBytes(int index) { + return filterControlIds_.getByteString(index); + } + + public static final int REDIRECT_CONTROL_IDS_FIELD_NUMBER = 10; + private com.google.protobuf.LazyStringList redirectControlIds_; + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + public com.google.protobuf.ProtocolStringList getRedirectControlIdsList() { + return redirectControlIds_; + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + public int getRedirectControlIdsCount() { + return redirectControlIds_.size(); + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + public java.lang.String getRedirectControlIds(int index) { + return redirectControlIds_.get(index); + } + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + public com.google.protobuf.ByteString getRedirectControlIdsBytes(int index) { + return redirectControlIds_.getByteString(index); + } + + public static final int TWOWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER = 18; + private com.google.protobuf.LazyStringList twowaySynonymsControlIds_; + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getTwowaySynonymsControlIdsList() { + return twowaySynonymsControlIds_; + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + public int getTwowaySynonymsControlIdsCount() { + return twowaySynonymsControlIds_.size(); + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + public java.lang.String getTwowaySynonymsControlIds(int index) { + return twowaySynonymsControlIds_.get(index); + } + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index) { + return twowaySynonymsControlIds_.getByteString(index); + } + + public static final int ONEWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER = 12; + private com.google.protobuf.LazyStringList onewaySynonymsControlIds_; + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getOnewaySynonymsControlIdsList() { + return onewaySynonymsControlIds_; + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + public int getOnewaySynonymsControlIdsCount() { + return onewaySynonymsControlIds_.size(); + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + public java.lang.String getOnewaySynonymsControlIds(int index) { + return onewaySynonymsControlIds_.get(index); + } + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index) { + return onewaySynonymsControlIds_.getByteString(index); + } + + public static final int DO_NOT_ASSOCIATE_CONTROL_IDS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList doNotAssociateControlIds_; + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateControlIdsList() { + return doNotAssociateControlIds_; + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + public int getDoNotAssociateControlIdsCount() { + return doNotAssociateControlIds_.size(); + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + public java.lang.String getDoNotAssociateControlIds(int index) { + return doNotAssociateControlIds_.get(index); + } + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index) { + return doNotAssociateControlIds_.getByteString(index); + } + + public static final int REPLACEMENT_CONTROL_IDS_FIELD_NUMBER = 14; + private com.google.protobuf.LazyStringList replacementControlIds_; + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + public com.google.protobuf.ProtocolStringList getReplacementControlIdsList() { + return replacementControlIds_; + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + public int getReplacementControlIdsCount() { + return replacementControlIds_.size(); + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + public java.lang.String getReplacementControlIds(int index) { + return replacementControlIds_.get(index); + } + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + public com.google.protobuf.ByteString getReplacementControlIdsBytes(int index) { + return replacementControlIds_.getByteString(index); + } + + public static final int IGNORE_CONTROL_IDS_FIELD_NUMBER = 15; + private com.google.protobuf.LazyStringList ignoreControlIds_; + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + public com.google.protobuf.ProtocolStringList getIgnoreControlIdsList() { + return ignoreControlIds_; + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + public int getIgnoreControlIdsCount() { + return ignoreControlIds_.size(); + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + public java.lang.String getIgnoreControlIds(int index) { + return ignoreControlIds_.get(index); + } + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + public com.google.protobuf.ByteString getIgnoreControlIdsBytes(int index) { + return ignoreControlIds_.getByteString(index); + } + + public static final int DIVERSITY_LEVEL_FIELD_NUMBER = 8; + private volatile java.lang.Object diversityLevel_; + /** + * + * + *
+   * 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + @java.lang.Override + public java.lang.String getDiversityLevel() { + java.lang.Object ref = diversityLevel_; + 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(); + diversityLevel_ = s; + return s; + } + } + /** + * + * + *
+   * 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiversityLevelBytes() { + java.lang.Object ref = diversityLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diversityLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.
+   * If not specified, we enable it by default.
+   *  Allowed values are:
+   * * '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
+   *   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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + @java.lang.Override + public java.lang.String getEnableCategoryFilterLevel() { + java.lang.Object ref = enableCategoryFilterLevel_; + 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(); + enableCategoryFilterLevel_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enableCategoryFilterLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOLUTION_TYPES_FIELD_NUMBER = 19; + private java.util.List solutionTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType> + solutionTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>() { + public com.google.cloud.retail.v2beta.SolutionType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SolutionType result = + com.google.cloud.retail.v2beta.SolutionType.valueOf(from); + return result == null + ? com.google.cloud.retail.v2beta.SolutionType.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + @java.lang.Override + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(index)); + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + @java.lang.Override + public java.util.List getSolutionTypesValueList() { + return solutionTypes_; + } + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + @java.lang.Override + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(index); + } + + private int solutionTypesMemoizedSerializedSize; + + 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 { + getSerializedSize(); + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, modelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(priceRerankingLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, priceRerankingLevel_); + } + for (int i = 0; i < facetControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, facetControlIds_.getRaw(i)); + } + if (dynamicFacetSpec_ != null) { + output.writeMessage(6, getDynamicFacetSpec()); + } + for (int i = 0; i < boostControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, boostControlIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diversityLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, diversityLevel_); + } + for (int i = 0; i < filterControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, filterControlIds_.getRaw(i)); + } + for (int i = 0; i < redirectControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectControlIds_.getRaw(i)); + } + for (int i = 0; i < onewaySynonymsControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 12, onewaySynonymsControlIds_.getRaw(i)); + } + for (int i = 0; i < doNotAssociateControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 13, doNotAssociateControlIds_.getRaw(i)); + } + for (int i = 0; i < replacementControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 14, replacementControlIds_.getRaw(i)); + } + for (int i = 0; i < ignoreControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, ignoreControlIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enableCategoryFilterLevel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, enableCategoryFilterLevel_); + } + for (int i = 0; i < twowaySynonymsControlIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 18, twowaySynonymsControlIds_.getRaw(i)); + } + if (getSolutionTypesList().size() > 0) { + output.writeUInt32NoTag(154); + output.writeUInt32NoTag(solutionTypesMemoizedSerializedSize); + } + for (int i = 0; i < solutionTypes_.size(); i++) { + output.writeEnumNoTag(solutionTypes_.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, modelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(priceRerankingLevel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, priceRerankingLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < facetControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(facetControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getFacetControlIdsList().size(); + } + if (dynamicFacetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDynamicFacetSpec()); + } + { + int dataSize = 0; + for (int i = 0; i < boostControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(boostControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getBoostControlIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diversityLevel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, diversityLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < filterControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(filterControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getFilterControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < redirectControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(redirectControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getRedirectControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < onewaySynonymsControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(onewaySynonymsControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getOnewaySynonymsControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < doNotAssociateControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(doNotAssociateControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getDoNotAssociateControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < replacementControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(replacementControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getReplacementControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(ignoreControlIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getIgnoreControlIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enableCategoryFilterLevel_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(16, enableCategoryFilterLevel_); + } + { + int dataSize = 0; + for (int i = 0; i < twowaySynonymsControlIds_.size(); i++) { + dataSize += computeStringSizeNoTag(twowaySynonymsControlIds_.getRaw(i)); + } + size += dataSize; + size += 2 * getTwowaySynonymsControlIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < solutionTypes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(solutionTypes_.get(i)); + } + size += dataSize; + if (!getSolutionTypesList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + solutionTypesMemoizedSerializedSize = dataSize; + } + 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.ServingConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ServingConfig other = + (com.google.cloud.retail.v2beta.ServingConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getModelId().equals(other.getModelId())) return false; + if (!getPriceRerankingLevel().equals(other.getPriceRerankingLevel())) return false; + if (!getFacetControlIdsList().equals(other.getFacetControlIdsList())) return false; + if (hasDynamicFacetSpec() != other.hasDynamicFacetSpec()) return false; + if (hasDynamicFacetSpec()) { + if (!getDynamicFacetSpec().equals(other.getDynamicFacetSpec())) return false; + } + if (!getBoostControlIdsList().equals(other.getBoostControlIdsList())) return false; + if (!getFilterControlIdsList().equals(other.getFilterControlIdsList())) return false; + if (!getRedirectControlIdsList().equals(other.getRedirectControlIdsList())) return false; + if (!getTwowaySynonymsControlIdsList().equals(other.getTwowaySynonymsControlIdsList())) + return false; + if (!getOnewaySynonymsControlIdsList().equals(other.getOnewaySynonymsControlIdsList())) + return false; + if (!getDoNotAssociateControlIdsList().equals(other.getDoNotAssociateControlIdsList())) + return false; + if (!getReplacementControlIdsList().equals(other.getReplacementControlIdsList())) return false; + if (!getIgnoreControlIdsList().equals(other.getIgnoreControlIdsList())) return false; + if (!getDiversityLevel().equals(other.getDiversityLevel())) return false; + if (!getEnableCategoryFilterLevel().equals(other.getEnableCategoryFilterLevel())) return false; + if (!solutionTypes_.equals(other.solutionTypes_)) 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) + MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getModelId().hashCode(); + hash = (37 * hash) + PRICE_RERANKING_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getPriceRerankingLevel().hashCode(); + if (getFacetControlIdsCount() > 0) { + hash = (37 * hash) + FACET_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getFacetControlIdsList().hashCode(); + } + if (hasDynamicFacetSpec()) { + hash = (37 * hash) + DYNAMIC_FACET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getDynamicFacetSpec().hashCode(); + } + if (getBoostControlIdsCount() > 0) { + hash = (37 * hash) + BOOST_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getBoostControlIdsList().hashCode(); + } + if (getFilterControlIdsCount() > 0) { + hash = (37 * hash) + FILTER_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getFilterControlIdsList().hashCode(); + } + if (getRedirectControlIdsCount() > 0) { + hash = (37 * hash) + REDIRECT_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getRedirectControlIdsList().hashCode(); + } + if (getTwowaySynonymsControlIdsCount() > 0) { + hash = (37 * hash) + TWOWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTwowaySynonymsControlIdsList().hashCode(); + } + if (getOnewaySynonymsControlIdsCount() > 0) { + hash = (37 * hash) + ONEWAY_SYNONYMS_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getOnewaySynonymsControlIdsList().hashCode(); + } + if (getDoNotAssociateControlIdsCount() > 0) { + hash = (37 * hash) + DO_NOT_ASSOCIATE_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDoNotAssociateControlIdsList().hashCode(); + } + if (getReplacementControlIdsCount() > 0) { + hash = (37 * hash) + REPLACEMENT_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getReplacementControlIdsList().hashCode(); + } + if (getIgnoreControlIdsCount() > 0) { + hash = (37 * hash) + IGNORE_CONTROL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getIgnoreControlIdsList().hashCode(); + } + hash = (37 * hash) + DIVERSITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getDiversityLevel().hashCode(); + hash = (37 * hash) + ENABLE_CATEGORY_FILTER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getEnableCategoryFilterLevel().hashCode(); + if (getSolutionTypesCount() > 0) { + hash = (37 * hash) + SOLUTION_TYPES_FIELD_NUMBER; + hash = (53 * hash) + solutionTypes_.hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ServingConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ServingConfig 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.ServingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ServingConfig 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.ServingConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ServingConfig 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.ServingConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ServingConfig 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.ServingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ServingConfig 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.ServingConfig 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.ServingConfig 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.ServingConfig 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; + } + /** + * + * + *
+   * 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} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ServingConfig) + com.google.cloud.retail.v2beta.ServingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigProto + .internal_static_google_cloud_retail_v2beta_ServingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigProto + .internal_static_google_cloud_retail_v2beta_ServingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ServingConfig.class, + com.google.cloud.retail.v2beta.ServingConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ServingConfig.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_ = ""; + + displayName_ = ""; + + modelId_ = ""; + + priceRerankingLevel_ = ""; + + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + diversityLevel_ = ""; + + enableCategoryFilterLevel_ = ""; + + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ServingConfigProto + .internal_static_google_cloud_retail_v2beta_ServingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig build() { + com.google.cloud.retail.v2beta.ServingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig buildPartial() { + com.google.cloud.retail.v2beta.ServingConfig result = + new com.google.cloud.retail.v2beta.ServingConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.modelId_ = modelId_; + result.priceRerankingLevel_ = priceRerankingLevel_; + if (((bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = facetControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.facetControlIds_ = facetControlIds_; + if (dynamicFacetSpecBuilder_ == null) { + result.dynamicFacetSpec_ = dynamicFacetSpec_; + } else { + result.dynamicFacetSpec_ = dynamicFacetSpecBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = boostControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.boostControlIds_ = boostControlIds_; + if (((bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = filterControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.filterControlIds_ = filterControlIds_; + if (((bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = redirectControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.redirectControlIds_ = redirectControlIds_; + if (((bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = twowaySynonymsControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.twowaySynonymsControlIds_ = twowaySynonymsControlIds_; + if (((bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = onewaySynonymsControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.onewaySynonymsControlIds_ = onewaySynonymsControlIds_; + if (((bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = doNotAssociateControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.doNotAssociateControlIds_ = doNotAssociateControlIds_; + if (((bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = replacementControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.replacementControlIds_ = replacementControlIds_; + if (((bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = ignoreControlIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.ignoreControlIds_ = ignoreControlIds_; + result.diversityLevel_ = diversityLevel_; + result.enableCategoryFilterLevel_ = enableCategoryFilterLevel_; + if (((bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.solutionTypes_ = solutionTypes_; + 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.ServingConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.ServingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ServingConfig other) { + if (other == com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getModelId().isEmpty()) { + modelId_ = other.modelId_; + onChanged(); + } + if (!other.getPriceRerankingLevel().isEmpty()) { + priceRerankingLevel_ = other.priceRerankingLevel_; + onChanged(); + } + if (!other.facetControlIds_.isEmpty()) { + if (facetControlIds_.isEmpty()) { + facetControlIds_ = other.facetControlIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFacetControlIdsIsMutable(); + facetControlIds_.addAll(other.facetControlIds_); + } + onChanged(); + } + if (other.hasDynamicFacetSpec()) { + mergeDynamicFacetSpec(other.getDynamicFacetSpec()); + } + if (!other.boostControlIds_.isEmpty()) { + if (boostControlIds_.isEmpty()) { + boostControlIds_ = other.boostControlIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureBoostControlIdsIsMutable(); + boostControlIds_.addAll(other.boostControlIds_); + } + onChanged(); + } + if (!other.filterControlIds_.isEmpty()) { + if (filterControlIds_.isEmpty()) { + filterControlIds_ = other.filterControlIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFilterControlIdsIsMutable(); + filterControlIds_.addAll(other.filterControlIds_); + } + onChanged(); + } + if (!other.redirectControlIds_.isEmpty()) { + if (redirectControlIds_.isEmpty()) { + redirectControlIds_ = other.redirectControlIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.addAll(other.redirectControlIds_); + } + onChanged(); + } + if (!other.twowaySynonymsControlIds_.isEmpty()) { + if (twowaySynonymsControlIds_.isEmpty()) { + twowaySynonymsControlIds_ = other.twowaySynonymsControlIds_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.addAll(other.twowaySynonymsControlIds_); + } + onChanged(); + } + if (!other.onewaySynonymsControlIds_.isEmpty()) { + if (onewaySynonymsControlIds_.isEmpty()) { + onewaySynonymsControlIds_ = other.onewaySynonymsControlIds_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.addAll(other.onewaySynonymsControlIds_); + } + onChanged(); + } + if (!other.doNotAssociateControlIds_.isEmpty()) { + if (doNotAssociateControlIds_.isEmpty()) { + doNotAssociateControlIds_ = other.doNotAssociateControlIds_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.addAll(other.doNotAssociateControlIds_); + } + onChanged(); + } + if (!other.replacementControlIds_.isEmpty()) { + if (replacementControlIds_.isEmpty()) { + replacementControlIds_ = other.replacementControlIds_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.addAll(other.replacementControlIds_); + } + onChanged(); + } + if (!other.ignoreControlIds_.isEmpty()) { + if (ignoreControlIds_.isEmpty()) { + ignoreControlIds_ = other.ignoreControlIds_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.addAll(other.ignoreControlIds_); + } + onChanged(); + } + if (!other.getDiversityLevel().isEmpty()) { + diversityLevel_ = other.diversityLevel_; + onChanged(); + } + if (!other.getEnableCategoryFilterLevel().isEmpty()) { + enableCategoryFilterLevel_ = other.enableCategoryFilterLevel_; + onChanged(); + } + if (!other.solutionTypes_.isEmpty()) { + if (solutionTypes_.isEmpty()) { + solutionTypes_ = other.solutionTypes_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureSolutionTypesIsMutable(); + solutionTypes_.addAll(other.solutionTypes_); + } + 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.ServingConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ServingConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * projects/*/locations/global/catalogs/*/servingConfig/*
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 human readable serving config display name. Used in Retail
+     * UI.
+     * This field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * 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 java.lang.Object modelId_ = ""; + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + public java.lang.String getModelId() { + java.lang.Object ref = modelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + public com.google.protobuf.ByteString getModelIdBytes() { + java.lang.Object ref = modelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @param value The modelId to set. + * @return This builder for chaining. + */ + public Builder setModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + modelId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearModelId() { + + modelId_ = getDefaultInstance().getModelId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the model 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.
+     * others-you-may-like CTR to others-you-may-like CVR).
+     * Required when
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string model_id = 3; + * + * @param value The bytes for modelId to set. + * @return This builder for chaining. + */ + public Builder setModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + modelId_ = value; + onChanged(); + return this; + } + + private java.lang.Object priceRerankingLevel_ = ""; + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + public java.lang.String getPriceRerankingLevel() { + java.lang.Object ref = priceRerankingLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + priceRerankingLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + public com.google.protobuf.ByteString getPriceRerankingLevelBytes() { + java.lang.Object ref = priceRerankingLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + priceRerankingLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @param value The priceRerankingLevel to set. + * @return This builder for chaining. + */ + public Builder setPriceRerankingLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + priceRerankingLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @return This builder for chaining. + */ + public Builder clearPriceRerankingLevel() { + + priceRerankingLevel_ = getDefaultInstance().getPriceRerankingLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * How much price ranking we want in serving results.
+     * Price reranking causes product items with a similar
+     * recommendation probability to be ordered by price, with the
+     * 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'
+     * If not specified, we choose default based on model type. Default value:
+     * 'no-price-reranking'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string price_reranking_level = 4; + * + * @param value The bytes for priceRerankingLevel to set. + * @return This builder for chaining. + */ + public Builder setPriceRerankingLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + priceRerankingLevel_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList facetControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFacetControlIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + facetControlIds_ = new com.google.protobuf.LazyStringArrayList(facetControlIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + public com.google.protobuf.ProtocolStringList getFacetControlIdsList() { + return facetControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + public int getFacetControlIdsCount() { + return facetControlIds_.size(); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + public java.lang.String getFacetControlIds(int index) { + return facetControlIds_.get(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + public com.google.protobuf.ByteString getFacetControlIdsBytes(int index) { + return facetControlIds_.getByteString(index); + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index to set the value at. + * @param value The facetControlIds to set. + * @return This builder for chaining. + */ + public Builder setFacetControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetControlIdsIsMutable(); + facetControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param value The facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addFacetControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetControlIdsIsMutable(); + facetControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param values The facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllFacetControlIds(java.lang.Iterable values) { + ensureFacetControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @return This builder for chaining. + */ + public Builder clearFacetControlIds() { + facetControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+     * resources with only the Facet control set. These controls are assumed to be
+     * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+     * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+     * is returned.
+     * 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].
+     * 
+ * + * repeated string facet_control_ids = 5; + * + * @param value The bytes of the facetControlIds to add. + * @return This builder for chaining. + */ + public Builder addFacetControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFacetControlIdsIsMutable(); + facetControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamicFacetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder> + dynamicFacetSpecBuilder_; + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return Whether the dynamicFacetSpec field is set. + */ + public boolean hasDynamicFacetSpec() { + return dynamicFacetSpecBuilder_ != null || dynamicFacetSpec_ != null; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * + * @return The dynamicFacetSpec. + */ + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } else { + return dynamicFacetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicFacetSpec_ = value; + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder setDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder builderForValue) { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = builderForValue.build(); + onChanged(); + } else { + dynamicFacetSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder mergeDynamicFacetSpec( + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec value) { + if (dynamicFacetSpecBuilder_ == null) { + if (dynamicFacetSpec_ != null) { + dynamicFacetSpec_ = + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.newBuilder( + dynamicFacetSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + dynamicFacetSpec_ = value; + } + onChanged(); + } else { + dynamicFacetSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public Builder clearDynamicFacetSpec() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpec_ = null; + onChanged(); + } else { + dynamicFacetSpec_ = null; + dynamicFacetSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder + getDynamicFacetSpecBuilder() { + + onChanged(); + return getDynamicFacetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder() { + if (dynamicFacetSpecBuilder_ != null) { + return dynamicFacetSpecBuilder_.getMessageOrBuilder(); + } else { + return dynamicFacetSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.getDefaultInstance() + : dynamicFacetSpec_; + } + } + /** + * + * + *
+     * The specification for dynamically generated facets. Notice that only
+     * textual facets can be dynamically generated.
+     * 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].
+     * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder> + getDynamicFacetSpecFieldBuilder() { + if (dynamicFacetSpecBuilder_ == null) { + dynamicFacetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder>( + getDynamicFacetSpec(), getParentForChildren(), isClean()); + dynamicFacetSpec_ = null; + } + return dynamicFacetSpecBuilder_; + } + + private com.google.protobuf.LazyStringList boostControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBoostControlIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + boostControlIds_ = new com.google.protobuf.LazyStringArrayList(boostControlIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + public com.google.protobuf.ProtocolStringList getBoostControlIdsList() { + return boostControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + public int getBoostControlIdsCount() { + return boostControlIds_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + public java.lang.String getBoostControlIds(int index) { + return boostControlIds_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + public com.google.protobuf.ByteString getBoostControlIdsBytes(int index) { + return boostControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index to set the value at. + * @param value The boostControlIds to set. + * @return This builder for chaining. + */ + public Builder setBoostControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoostControlIdsIsMutable(); + boostControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param value The boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addBoostControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBoostControlIdsIsMutable(); + boostControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param values The boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllBoostControlIds(java.lang.Iterable values) { + ensureBoostControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, boostControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @return This builder for chaining. + */ + public Builder clearBoostControlIds() { + boostControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition boost specifications. If a product matches multiple conditions
+     * in the specifications, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 100.
+     * Notice that if both
+     * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+     * and [SearchRequest.boost_spec] are set, the boost conditions from both
+     * places are evaluated. If a search request matches multiple boost
+     * conditions, the final boost score is equal to the sum of the boost scores
+     * from all matched boost conditions.
+     * 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].
+     * 
+ * + * repeated string boost_control_ids = 7; + * + * @param value The bytes of the boostControlIds to add. + * @return This builder for chaining. + */ + public Builder addBoostControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBoostControlIdsIsMutable(); + boostControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList filterControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFilterControlIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + filterControlIds_ = new com.google.protobuf.LazyStringArrayList(filterControlIds_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + public com.google.protobuf.ProtocolStringList getFilterControlIdsList() { + return filterControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + public int getFilterControlIdsCount() { + return filterControlIds_.size(); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + public java.lang.String getFilterControlIds(int index) { + return filterControlIds_.get(index); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + public com.google.protobuf.ByteString getFilterControlIdsBytes(int index) { + return filterControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index to set the value at. + * @param value The filterControlIds to set. + * @return This builder for chaining. + */ + public Builder setFilterControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilterControlIdsIsMutable(); + filterControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param value The filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addFilterControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilterControlIdsIsMutable(); + filterControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param values The filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllFilterControlIds(java.lang.Iterable values) { + ensureFilterControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filterControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @return This builder for chaining. + */ + public Builder clearFilterControlIds() { + filterControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition filter specifications. If a product matches multiple conditions
+     * in the specifications, filters from these specifications are all
+     * applied and combined via the AND operator. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string filter_control_ids = 9; + * + * @param value The bytes of the filterControlIds to add. + * @return This builder for chaining. + */ + public Builder addFilterControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFilterControlIdsIsMutable(); + filterControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList redirectControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRedirectControlIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + redirectControlIds_ = new com.google.protobuf.LazyStringArrayList(redirectControlIds_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + public com.google.protobuf.ProtocolStringList getRedirectControlIdsList() { + return redirectControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + public int getRedirectControlIdsCount() { + return redirectControlIds_.size(); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + public java.lang.String getRedirectControlIds(int index) { + return redirectControlIds_.get(index); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + public com.google.protobuf.ByteString getRedirectControlIdsBytes(int index) { + return redirectControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index to set the value at. + * @param value The redirectControlIds to set. + * @return This builder for chaining. + */ + public Builder setRedirectControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param value The redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addRedirectControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param values The redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllRedirectControlIds(java.lang.Iterable values) { + ensureRedirectControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, redirectControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return This builder for chaining. + */ + public Builder clearRedirectControlIds() { + redirectControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition redirect specifications. Only the first triggered redirect action
+     * is applied, even if multiple apply. Maximum number of specifications is
+     * 1000.
+     * 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].
+     * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param value The bytes of the redirectControlIds to add. + * @return This builder for chaining. + */ + public Builder addRedirectControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRedirectControlIdsIsMutable(); + redirectControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList twowaySynonymsControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTwowaySynonymsControlIdsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + twowaySynonymsControlIds_ = + new com.google.protobuf.LazyStringArrayList(twowaySynonymsControlIds_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getTwowaySynonymsControlIdsList() { + return twowaySynonymsControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + public int getTwowaySynonymsControlIdsCount() { + return twowaySynonymsControlIds_.size(); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + public java.lang.String getTwowaySynonymsControlIds(int index) { + return twowaySynonymsControlIds_.get(index); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index) { + return twowaySynonymsControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index to set the value at. + * @param value The twowaySynonymsControlIds to set. + * @return This builder for chaining. + */ + public Builder setTwowaySynonymsControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param value The twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addTwowaySynonymsControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param values The twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllTwowaySynonymsControlIds(java.lang.Iterable values) { + ensureTwowaySynonymsControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, twowaySynonymsControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return This builder for chaining. + */ + public Builder clearTwowaySynonymsControlIds() { + twowaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition synonyms specifications. If multiple syonyms conditions match,
+     * all matching synonyms control in the list will execute. Order of controls
+     * in the list will not matter. Maximum number of specifications is
+     * 100.
+     * 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].
+     * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param value The bytes of the twowaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addTwowaySynonymsControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTwowaySynonymsControlIdsIsMutable(); + twowaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList onewaySynonymsControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOnewaySynonymsControlIdsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + onewaySynonymsControlIds_ = + new com.google.protobuf.LazyStringArrayList(onewaySynonymsControlIds_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + public com.google.protobuf.ProtocolStringList getOnewaySynonymsControlIdsList() { + return onewaySynonymsControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + public int getOnewaySynonymsControlIdsCount() { + return onewaySynonymsControlIds_.size(); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + public java.lang.String getOnewaySynonymsControlIds(int index) { + return onewaySynonymsControlIds_.get(index); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + public com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index) { + return onewaySynonymsControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index to set the value at. + * @param value The onewaySynonymsControlIds to set. + * @return This builder for chaining. + */ + public Builder setOnewaySynonymsControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param value The onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addOnewaySynonymsControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param values The onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllOnewaySynonymsControlIds(java.lang.Iterable values) { + ensureOnewaySynonymsControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onewaySynonymsControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return This builder for chaining. + */ + public Builder clearOnewaySynonymsControlIds() { + onewaySynonymsControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition oneway synonyms specifications. If multiple oneway synonyms
+     * conditions match, all matching oneway synonyms controls in the list will
+     * execute. Order of controls in the list will not matter. Maximum number of
+     * specifications is 100.
+     * 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].
+     * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param value The bytes of the onewaySynonymsControlIds to add. + * @return This builder for chaining. + */ + public Builder addOnewaySynonymsControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOnewaySynonymsControlIdsIsMutable(); + onewaySynonymsControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList doNotAssociateControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDoNotAssociateControlIdsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + doNotAssociateControlIds_ = + new com.google.protobuf.LazyStringArrayList(doNotAssociateControlIds_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + public com.google.protobuf.ProtocolStringList getDoNotAssociateControlIdsList() { + return doNotAssociateControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + public int getDoNotAssociateControlIdsCount() { + return doNotAssociateControlIds_.size(); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + public java.lang.String getDoNotAssociateControlIds(int index) { + return doNotAssociateControlIds_.get(index); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + public com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index) { + return doNotAssociateControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index to set the value at. + * @param value The doNotAssociateControlIds to set. + * @return This builder for chaining. + */ + public Builder setDoNotAssociateControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param value The doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param values The doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllDoNotAssociateControlIds(java.lang.Iterable values) { + ensureDoNotAssociateControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, doNotAssociateControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return This builder for chaining. + */ + public Builder clearDoNotAssociateControlIds() { + doNotAssociateControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition do not associate specifications. If multiple do not associate
+     * conditions match, all matching do not associate controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param value The bytes of the doNotAssociateControlIds to add. + * @return This builder for chaining. + */ + public Builder addDoNotAssociateControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDoNotAssociateControlIdsIsMutable(); + doNotAssociateControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList replacementControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureReplacementControlIdsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + replacementControlIds_ = + new com.google.protobuf.LazyStringArrayList(replacementControlIds_); + bitField0_ |= 0x00000080; + } + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + public com.google.protobuf.ProtocolStringList getReplacementControlIdsList() { + return replacementControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + public int getReplacementControlIdsCount() { + return replacementControlIds_.size(); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + public java.lang.String getReplacementControlIds(int index) { + return replacementControlIds_.get(index); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + public com.google.protobuf.ByteString getReplacementControlIdsBytes(int index) { + return replacementControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index to set the value at. + * @param value The replacementControlIds to set. + * @return This builder for chaining. + */ + public Builder setReplacementControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param value The replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addReplacementControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param values The replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllReplacementControlIds(java.lang.Iterable values) { + ensureReplacementControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replacementControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return This builder for chaining. + */ + public Builder clearReplacementControlIds() { + replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition replacement specifications.
+     * - Applied according to the order in the list.
+     * - A previously replaced term can not be re-replaced.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param value The bytes of the replacementControlIds to add. + * @return This builder for chaining. + */ + public Builder addReplacementControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureReplacementControlIdsIsMutable(); + replacementControlIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ignoreControlIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIgnoreControlIdsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + ignoreControlIds_ = new com.google.protobuf.LazyStringArrayList(ignoreControlIds_); + bitField0_ |= 0x00000100; + } + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + public com.google.protobuf.ProtocolStringList getIgnoreControlIdsList() { + return ignoreControlIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + public int getIgnoreControlIdsCount() { + return ignoreControlIds_.size(); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + public java.lang.String getIgnoreControlIds(int index) { + return ignoreControlIds_.get(index); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + public com.google.protobuf.ByteString getIgnoreControlIdsBytes(int index) { + return ignoreControlIds_.getByteString(index); + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index to set the value at. + * @param value The ignoreControlIds to set. + * @return This builder for chaining. + */ + public Builder setIgnoreControlIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param value The ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addIgnoreControlIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param values The ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreControlIds(java.lang.Iterable values) { + ensureIgnoreControlIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ignoreControlIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreControlIds() { + ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition ignore specifications. If multiple ignore
+     * conditions match, all matching ignore controls in the list will
+     * execute.
+     * - Order does not matter.
+     * - Maximum number of specifications is 100.
+     * 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].
+     * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param value The bytes of the ignoreControlIds to add. + * @return This builder for chaining. + */ + public Builder addIgnoreControlIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIgnoreControlIdsIsMutable(); + ignoreControlIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object diversityLevel_ = ""; + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + public java.lang.String getDiversityLevel() { + java.lang.Object ref = diversityLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diversityLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + public com.google.protobuf.ByteString getDiversityLevelBytes() { + java.lang.Object ref = diversityLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diversityLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @param value The diversityLevel to set. + * @return This builder for chaining. + */ + public Builder setDiversityLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + diversityLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @return This builder for chaining. + */ + public Builder clearDiversityLevel() { + + diversityLevel_ = getDefaultInstance().getDiversityLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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'
+     * If not specified, we choose default based on recommendation model
+     * type. Default value: 'no-diversity'.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string diversity_level = 8; + * + * @param value The bytes for diversityLevel to set. + * @return This builder for chaining. + */ + public Builder setDiversityLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + diversityLevel_ = value; + onChanged(); + return this; + } + + private java.lang.Object enableCategoryFilterLevel_ = ""; + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + public java.lang.String getEnableCategoryFilterLevel() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enableCategoryFilterLevel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() { + java.lang.Object ref = enableCategoryFilterLevel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enableCategoryFilterLevel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @param value The enableCategoryFilterLevel to set. + * @return This builder for chaining. + */ + public Builder setEnableCategoryFilterLevel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + enableCategoryFilterLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @return This builder for chaining. + */ + public Builder clearEnableCategoryFilterLevel() { + + enableCategoryFilterLevel_ = getDefaultInstance().getEnableCategoryFilterLevel(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     *   the model and the customer's filters.
+     * * '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).
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+     * 
+ * + * string enable_category_filter_level = 16; + * + * @param value The bytes for enableCategoryFilterLevel to set. + * @return This builder for chaining. + */ + public Builder setEnableCategoryFilterLevelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + enableCategoryFilterLevel_ = value; + onChanged(); + return this; + } + + private java.util.List solutionTypes_ = java.util.Collections.emptyList(); + + private void ensureSolutionTypesIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + solutionTypes_ = new java.util.ArrayList(solutionTypes_); + bitField0_ |= 0x00000200; + } + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + public java.util.List getSolutionTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SolutionType>( + solutionTypes_, solutionTypes_converter_); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + public int getSolutionTypesCount() { + return solutionTypes_.size(); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { + return solutionTypes_converter_.convert(solutionTypes_.get(index)); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index to set the value at. + * @param value The solutionTypes to set. + * @return This builder for chaining. + */ + public Builder setSolutionTypes(int index, com.google.cloud.retail.v2beta.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypes(com.google.cloud.retail.v2beta.SolutionType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypes( + java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (com.google.cloud.retail.v2beta.SolutionType value : values) { + solutionTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearSolutionTypes() { + solutionTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + public java.util.List getSolutionTypesValueList() { + return java.util.Collections.unmodifiableList(solutionTypes_); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + public int getSolutionTypesValue(int index) { + return solutionTypes_.get(index); + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + * @return This builder for chaining. + */ + public Builder setSolutionTypesValue(int index, int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addSolutionTypesValue(int value) { + ensureSolutionTypesIsMutable(); + solutionTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. Specifies the solution types that a serving config can
+     * be associated with. Currently we support setting only one type of solution.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param values The enum numeric values on the wire for solutionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSolutionTypesValue(java.lang.Iterable values) { + ensureSolutionTypesIsMutable(); + for (int value : values) { + solutionTypes_.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.ServingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ServingConfig) + private static final com.google.cloud.retail.v2beta.ServingConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ServingConfig(); + } + + public static com.google.cloud.retail.v2beta.ServingConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServingConfig(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.ServingConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigName.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigName.java new file mode 100644 index 00000000..aaee63ae --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigName.java @@ -0,0 +1,269 @@ +/* + * 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 ServingConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_SERVING_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String servingConfig; + + @Deprecated + protected ServingConfigName() { + project = null; + location = null; + catalog = null; + servingConfig = null; + } + + private ServingConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + servingConfig = Preconditions.checkNotNull(builder.getServingConfig()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getServingConfig() { + return servingConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServingConfigName of( + String project, String location, String catalog, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setServingConfig(servingConfig) + .build(); + } + + public static String format( + String project, String location, String catalog, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + public static ServingConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_SERVING_CONFIG.validatedMatch( + formattedString, "ServingConfigName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("serving_config")); + } + + 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 (ServingConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_SERVING_CONFIG.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 (servingConfig != null) { + fieldMapBuilder.put("serving_config", servingConfig); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_SERVING_CONFIG.instantiate( + "project", + project, + "location", + location, + "catalog", + catalog, + "serving_config", + servingConfig); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ServingConfigName that = ((ServingConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.servingConfig, that.servingConfig); + } + 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(servingConfig); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}. + */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String servingConfig; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getServingConfig() { + return servingConfig; + } + + 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 setServingConfig(String servingConfig) { + this.servingConfig = servingConfig; + return this; + } + + private Builder(ServingConfigName servingConfigName) { + this.project = servingConfigName.project; + this.location = servingConfigName.location; + this.catalog = servingConfigName.catalog; + this.servingConfig = servingConfigName.servingConfig; + } + + public ServingConfigName build() { + return new ServingConfigName(this); + } + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java new file mode 100644 index 00000000..2a8a1d25 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java @@ -0,0 +1,1157 @@ +/* + * 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/serving_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ServingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ServingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * projects/*/locations/global/catalogs/*/servingConfig/*
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The human readable serving config display name. Used in Retail
+   * UI.
+   * This field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The modelId. + */ + java.lang.String getModelId(); + /** + * + * + *
+   * The id of the model 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.
+   * others-you-may-like CTR to others-you-may-like CVR).
+   * Required when
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string model_id = 3; + * + * @return The bytes for modelId. + */ + com.google.protobuf.ByteString getModelIdBytes(); + + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The priceRerankingLevel. + */ + java.lang.String getPriceRerankingLevel(); + /** + * + * + *
+   * How much price ranking we want in serving results.
+   * Price reranking causes product items with a similar
+   * recommendation probability to be ordered by price, with the
+   * 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'
+   * If not specified, we choose default based on model type. Default value:
+   * 'no-price-reranking'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string price_reranking_level = 4; + * + * @return The bytes for priceRerankingLevel. + */ + com.google.protobuf.ByteString getPriceRerankingLevelBytes(); + + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return A list containing the facetControlIds. + */ + java.util.List getFacetControlIdsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @return The count of facetControlIds. + */ + int getFacetControlIdsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the element to return. + * @return The facetControlIds at the given index. + */ + java.lang.String getFacetControlIds(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   * The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control]
+   * resources with only the Facet control set. These controls are assumed to be
+   * in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig].
+   * A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
+   * is returned.
+   * 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].
+   * 
+ * + * repeated string facet_control_ids = 5; + * + * @param index The index of the value to return. + * @return The bytes of the facetControlIds at the given index. + */ + com.google.protobuf.ByteString getFacetControlIdsBytes(int index); + + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * @return Whether the dynamicFacetSpec field is set. + */ + boolean hasDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + * + * @return The dynamicFacetSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec getDynamicFacetSpec(); + /** + * + * + *
+   * The specification for dynamically generated facets. Notice that only
+   * textual facets can be dynamically generated.
+   * 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].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + */ + com.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpecOrBuilder + getDynamicFacetSpecOrBuilder(); + + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return A list containing the boostControlIds. + */ + java.util.List getBoostControlIdsList(); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @return The count of boostControlIds. + */ + int getBoostControlIdsCount(); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the element to return. + * @return The boostControlIds at the given index. + */ + java.lang.String getBoostControlIds(int index); + /** + * + * + *
+   * Condition boost specifications. If a product matches multiple conditions
+   * in the specifications, boost scores from these specifications are all
+   * applied and combined in a non-linear way. Maximum number of
+   * specifications is 100.
+   * Notice that if both
+   * [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids]
+   * and [SearchRequest.boost_spec] are set, the boost conditions from both
+   * places are evaluated. If a search request matches multiple boost
+   * conditions, the final boost score is equal to the sum of the boost scores
+   * from all matched boost conditions.
+   * 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].
+   * 
+ * + * repeated string boost_control_ids = 7; + * + * @param index The index of the value to return. + * @return The bytes of the boostControlIds at the given index. + */ + com.google.protobuf.ByteString getBoostControlIdsBytes(int index); + + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return A list containing the filterControlIds. + */ + java.util.List getFilterControlIdsList(); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @return The count of filterControlIds. + */ + int getFilterControlIdsCount(); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the element to return. + * @return The filterControlIds at the given index. + */ + java.lang.String getFilterControlIds(int index); + /** + * + * + *
+   * Condition filter specifications. If a product matches multiple conditions
+   * in the specifications, filters from these specifications are all
+   * applied and combined via the AND operator. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string filter_control_ids = 9; + * + * @param index The index of the value to return. + * @return The bytes of the filterControlIds at the given index. + */ + com.google.protobuf.ByteString getFilterControlIdsBytes(int index); + + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return A list containing the redirectControlIds. + */ + java.util.List getRedirectControlIdsList(); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @return The count of redirectControlIds. + */ + int getRedirectControlIdsCount(); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the element to return. + * @return The redirectControlIds at the given index. + */ + java.lang.String getRedirectControlIds(int index); + /** + * + * + *
+   * Condition redirect specifications. Only the first triggered redirect action
+   * is applied, even if multiple apply. Maximum number of specifications is
+   * 1000.
+   * 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].
+   * 
+ * + * repeated string redirect_control_ids = 10; + * + * @param index The index of the value to return. + * @return The bytes of the redirectControlIds at the given index. + */ + com.google.protobuf.ByteString getRedirectControlIdsBytes(int index); + + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return A list containing the twowaySynonymsControlIds. + */ + java.util.List getTwowaySynonymsControlIdsList(); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @return The count of twowaySynonymsControlIds. + */ + int getTwowaySynonymsControlIdsCount(); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the element to return. + * @return The twowaySynonymsControlIds at the given index. + */ + java.lang.String getTwowaySynonymsControlIds(int index); + /** + * + * + *
+   * Condition synonyms specifications. If multiple syonyms conditions match,
+   * all matching synonyms control in the list will execute. Order of controls
+   * in the list will not matter. Maximum number of specifications is
+   * 100.
+   * 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].
+   * 
+ * + * repeated string twoway_synonyms_control_ids = 18; + * + * @param index The index of the value to return. + * @return The bytes of the twowaySynonymsControlIds at the given index. + */ + com.google.protobuf.ByteString getTwowaySynonymsControlIdsBytes(int index); + + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return A list containing the onewaySynonymsControlIds. + */ + java.util.List getOnewaySynonymsControlIdsList(); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @return The count of onewaySynonymsControlIds. + */ + int getOnewaySynonymsControlIdsCount(); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the element to return. + * @return The onewaySynonymsControlIds at the given index. + */ + java.lang.String getOnewaySynonymsControlIds(int index); + /** + * + * + *
+   * Condition oneway synonyms specifications. If multiple oneway synonyms
+   * conditions match, all matching oneway synonyms controls in the list will
+   * execute. Order of controls in the list will not matter. Maximum number of
+   * specifications is 100.
+   * 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].
+   * 
+ * + * repeated string oneway_synonyms_control_ids = 12; + * + * @param index The index of the value to return. + * @return The bytes of the onewaySynonymsControlIds at the given index. + */ + com.google.protobuf.ByteString getOnewaySynonymsControlIdsBytes(int index); + + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return A list containing the doNotAssociateControlIds. + */ + java.util.List getDoNotAssociateControlIdsList(); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @return The count of doNotAssociateControlIds. + */ + int getDoNotAssociateControlIdsCount(); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the element to return. + * @return The doNotAssociateControlIds at the given index. + */ + java.lang.String getDoNotAssociateControlIds(int index); + /** + * + * + *
+   * Condition do not associate specifications. If multiple do not associate
+   * conditions match, all matching do not associate controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string do_not_associate_control_ids = 13; + * + * @param index The index of the value to return. + * @return The bytes of the doNotAssociateControlIds at the given index. + */ + com.google.protobuf.ByteString getDoNotAssociateControlIdsBytes(int index); + + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return A list containing the replacementControlIds. + */ + java.util.List getReplacementControlIdsList(); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @return The count of replacementControlIds. + */ + int getReplacementControlIdsCount(); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the element to return. + * @return The replacementControlIds at the given index. + */ + java.lang.String getReplacementControlIds(int index); + /** + * + * + *
+   * Condition replacement specifications.
+   * - Applied according to the order in the list.
+   * - A previously replaced term can not be re-replaced.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string replacement_control_ids = 14; + * + * @param index The index of the value to return. + * @return The bytes of the replacementControlIds at the given index. + */ + com.google.protobuf.ByteString getReplacementControlIdsBytes(int index); + + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return A list containing the ignoreControlIds. + */ + java.util.List getIgnoreControlIdsList(); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @return The count of ignoreControlIds. + */ + int getIgnoreControlIdsCount(); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the element to return. + * @return The ignoreControlIds at the given index. + */ + java.lang.String getIgnoreControlIds(int index); + /** + * + * + *
+   * Condition ignore specifications. If multiple ignore
+   * conditions match, all matching ignore controls in the list will
+   * execute.
+   * - Order does not matter.
+   * - Maximum number of specifications is 100.
+   * 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].
+   * 
+ * + * repeated string ignore_control_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the ignoreControlIds at the given index. + */ + 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The diversityLevel. + */ + 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'
+   * If not specified, we choose default based on recommendation model
+   * type. Default value: 'no-diversity'.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string diversity_level = 8; + * + * @return The bytes for diversityLevel. + */ + com.google.protobuf.ByteString getDiversityLevelBytes(); + + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The enableCategoryFilterLevel. + */ + java.lang.String getEnableCategoryFilterLevel(); + /** + * + * + *
+   * 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
+   *   the model and the customer's filters.
+   * * '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).
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
+   * 
+ * + * string enable_category_filter_level = 16; + * + * @return The bytes for enableCategoryFilterLevel. + */ + com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes(); + + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the solutionTypes. + */ + java.util.List getSolutionTypesList(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The count of solutionTypes. + */ + int getSolutionTypesCount(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the element to return. + * @return The solutionTypes at the given index. + */ + com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return A list containing the enum numeric values on the wire for solutionTypes. + */ + java.util.List getSolutionTypesValueList(); + /** + * + * + *
+   * Required. Immutable. Specifies the solution types that a serving config can
+   * be associated with. Currently we support setting only one type of solution.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.SolutionType solution_types = 19 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of solutionTypes at the given index. + */ + int getSolutionTypesValue(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java new file mode 100644 index 00000000..3db5ac08 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java @@ -0,0 +1,121 @@ +/* + * 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/serving_config.proto + +package com.google.cloud.retail.v2beta; + +public final class ServingConfigProto { + private ServingConfigProto() {} + + 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_ServingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ServingConfig_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/serving_con" + + "fig.proto\022\032google.cloud.retail.v2beta\032\037g" + + "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" + + "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" + + "s\030\005 \003(\t\022V\n\022dynamic_facet_spec\030\006 \001(\0132:.go" + + "ogle.cloud.retail.v2beta.SearchRequest.D" + + "ynamicFacetSpec\022\031\n\021boost_control_ids\030\007 \003" + + "(\t\022\032\n\022filter_control_ids\030\t \003(\t\022\034\n\024redire" + + "ct_control_ids\030\n \003(\t\022#\n\033twoway_synonyms_" + + "control_ids\030\022 \003(\t\022#\n\033oneway_synonyms_con" + + "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" + }; + 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.cloud.retail.v2beta.SearchServiceProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_ServingConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_ServingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ServingConfig_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "ModelId", + "PriceRerankingLevel", + "FacetControlIds", + "DynamicFacetSpec", + "BoostControlIds", + "FilterControlIds", + "RedirectControlIds", + "TwowaySynonymsControlIds", + "OnewaySynonymsControlIds", + "DoNotAssociateControlIds", + "ReplacementControlIds", + "IgnoreControlIds", + "DiversityLevel", + "EnableCategoryFilterLevel", + "SolutionTypes", + }); + 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.cloud.retail.v2beta.SearchServiceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceProto.java new file mode 100644 index 00000000..26576528 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceProto.java @@ -0,0 +1,249 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public final class ServingConfigServiceProto { + private ServingConfigServiceProto() {} + + 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_CreateServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_AddControlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RemoveControlRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/retail/v2beta/serving_con" + + "fig_service.proto\022\032google.cloud.retail.v" + + "2beta\032\034google/api/annotations.proto\032\027goo" + + "gle/api/client.proto\032\037google/api/field_b" + + "ehavior.proto\032\031google/api/resource.proto" + + "\032/google/cloud/retail/v2beta/serving_con" + + "fig.proto\032\033google/protobuf/empty.proto\032 " + + "google/protobuf/field_mask.proto\"\273\001\n\032Cre" + + "ateServingConfigRequest\0225\n\006parent\030\001 \001(\tB" + + "%\340A\002\372A\037\n\035retail.googleapis.com/Catalog\022F" + + "\n\016serving_config\030\002 \001(\0132).google.cloud.re" + + "tail.v2beta.ServingConfigB\003\340A\002\022\036\n\021servin" + + "g_config_id\030\003 \001(\tB\003\340A\002\"\225\001\n\032UpdateServing" + + "ConfigRequest\022F\n\016serving_config\030\001 \001(\0132)." + + "google.cloud.retail.v2beta.ServingConfig" + + "B\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMask\"W\n\032DeleteServingConfigReq" + + "uest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#retail.googl" + + "eapis.com/ServingConfig\"T\n\027GetServingCon" + + "figRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#retail" + + ".googleapis.com/ServingConfig\"\203\001\n\031ListSe" + + "rvingConfigsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002" + + "\372A\037\n\035retail.googleapis.com/Catalog\022\026\n\tpa" + + "ge_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003" + + "\340A\001\"y\n\032ListServingConfigsResponse\022B\n\017ser" + + "ving_configs\030\001 \003(\0132).google.cloud.retail" + + ".v2beta.ServingConfig\022\027\n\017next_page_token" + + "\030\002 \001(\t\"q\n\021AddControlRequest\022C\n\016serving_c" + + "onfig\030\001 \001(\tB+\340A\002\372A%\n#retail.googleapis.c" + + "om/ServingConfig\022\027\n\ncontrol_id\030\002 \001(\tB\003\340A" + + "\002\"t\n\024RemoveControlRequest\022C\n\016serving_con" + + "fig\030\001 \001(\tB+\340A\002\372A%\n#retail.googleapis.com" + + "/ServingConfig\022\027\n\ncontrol_id\030\002 \001(\tB\003\340A\0022" + + "\203\r\n\024ServingConfigService\022\376\001\n\023CreateServi" + + "ngConfig\0226.google.cloud.retail.v2beta.Cr" + + "eateServingConfigRequest\032).google.cloud." + + "retail.v2beta.ServingConfig\"\203\001\202\323\344\223\002S\"A/v" + + "2beta/{parent=projects/*/locations/*/cat" + + "alogs/*}/servingConfigs:\016serving_config\332" + + "A\'parent,serving_config,serving_config_i" + + "d\022\267\001\n\023DeleteServingConfig\0226.google.cloud" + + ".retail.v2beta.DeleteServingConfigReques" + + "t\032\026.google.protobuf.Empty\"P\202\323\344\223\002C*A/v2be" + + "ta/{name=projects/*/locations/*/catalogs" + + "/*/servingConfigs/*}\332A\004name\022\200\002\n\023UpdateSe" + + "rvingConfig\0226.google.cloud.retail.v2beta" + + ".UpdateServingConfigRequest\032).google.clo" + + "ud.retail.v2beta.ServingConfig\"\205\001\202\323\344\223\002b2" + + "P/v2beta/{serving_config.name=projects/*" + + "/locations/*/catalogs/*/servingConfigs/*" + + "}:\016serving_config\332A\032serving_config,updat" + + "e_mask\022\304\001\n\020GetServingConfig\0223.google.clo" + + "ud.retail.v2beta.GetServingConfigRequest" + + "\032).google.cloud.retail.v2beta.ServingCon" + + "fig\"P\202\323\344\223\002C\022A/v2beta/{name=projects/*/lo" + + "cations/*/catalogs/*/servingConfigs/*}\332A" + + "\004name\022\327\001\n\022ListServingConfigs\0225.google.cl" + + "oud.retail.v2beta.ListServingConfigsRequ" + + "est\0326.google.cloud.retail.v2beta.ListSer" + + "vingConfigsResponse\"R\202\323\344\223\002C\022A/v2beta/{pa" + + "rent=projects/*/locations/*/catalogs/*}/" + + "servingConfigs\332A\006parent\022\332\001\n\nAddControl\022-" + + ".google.cloud.retail.v2beta.AddControlRe" + + "quest\032).google.cloud.retail.v2beta.Servi" + + "ngConfig\"r\202\323\344\223\002[\"V/v2beta/{serving_confi" + + "g=projects/*/locations/*/catalogs/*/serv" + + "ingConfigs/*}:addControl:\001*\332A\016serving_co" + + "nfig\022\343\001\n\rRemoveControl\0220.google.cloud.re" + + "tail.v2beta.RemoveControlRequest\032).googl" + + "e.cloud.retail.v2beta.ServingConfig\"u\202\323\344" + + "\223\002^\"Y/v2beta/{serving_config=projects/*/" + + "locations/*/catalogs/*/servingConfigs/*}" + + ":removeControl:\001*\332A\016serving_config\032I\312A\025r" + + "etail.googleapis.com\322A.https://www.googl" + + "eapis.com/auth/cloud-platformB\342\001\n\036com.go" + + "ogle.cloud.retail.v2betaB\031ServingConfigS" + + "erviceProtoP\001Z@google.golang.org/genprot" + + "o/googleapis/cloud/retail/v2beta;retail\242" + + "\002\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032" + + "Google\\Cloud\\Retail\\V2beta\352\002\035Google::Clo" + + "ud::Retail::V2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.ServingConfigProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CreateServingConfigRequest_descriptor, + new java.lang.String[] { + "Parent", "ServingConfig", "ServingConfigId", + }); + internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_DeleteServingConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_GetServingConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListServingConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListServingConfigsResponse_descriptor, + new java.lang.String[] { + "ServingConfigs", "NextPageToken", + }); + internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_AddControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_AddControlRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "ControlId", + }); + internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_RemoveControlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RemoveControlRequest_descriptor, + new java.lang.String[] { + "ServingConfig", "ControlId", + }); + 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); + 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.ServingConfigProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequest.java new file mode 100644 index 00000000..5dc552c9 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequest.java @@ -0,0 +1,1165 @@ +/* + * 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 message to set a specified branch as new default_branch.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetDefaultBranchRequest} + */ +public final class SetDefaultBranchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SetDefaultBranchRequest) + SetDefaultBranchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetDefaultBranchRequest.newBuilder() to construct. + private SetDefaultBranchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetDefaultBranchRequest() { + catalog_ = ""; + branchId_ = ""; + note_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetDefaultBranchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetDefaultBranchRequest( + 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(); + + catalog_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + branchId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + note_ = s; + break; + } + case 32: + { + force_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2beta.SetDefaultBranchRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private volatile java.lang.Object catalog_; + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object branchId_; + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + @java.lang.Override + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + 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(); + branchId_ = s; + return s; + } + } + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_FIELD_NUMBER = 3; + private volatile java.lang.Object note_; + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + @java.lang.Override + public java.lang.String getNote() { + java.lang.Object ref = note_; + 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(); + note_ = s; + return s; + } + } + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_; + /** + * + * + *
+   * If set to true, it permits switching to a branch with
+   * [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id]
+   * even if it has no sufficient active products.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branchId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, note_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + 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(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branchId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branchId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(note_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, note_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + 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.SetDefaultBranchRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SetDefaultBranchRequest other = + (com.google.cloud.retail.v2beta.SetDefaultBranchRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (!getBranchId().equals(other.getBranchId())) return false; + if (!getNote().equals(other.getNote())) return false; + if (getForce() != other.getForce()) 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) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + hash = (37 * hash) + BRANCH_ID_FIELD_NUMBER; + hash = (53 * hash) + getBranchId().hashCode(); + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest 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.SetDefaultBranchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest 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.SetDefaultBranchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest 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.SetDefaultBranchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest 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.SetDefaultBranchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest 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.SetDefaultBranchRequest 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.SetDefaultBranchRequest 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.SetDefaultBranchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message to set a specified branch as new default_branch.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetDefaultBranchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SetDefaultBranchRequest) + com.google.cloud.retail.v2beta.SetDefaultBranchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_SetDefaultBranchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetDefaultBranchRequest.class, + com.google.cloud.retail.v2beta.SetDefaultBranchRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SetDefaultBranchRequest.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(); + catalog_ = ""; + + branchId_ = ""; + + note_ = ""; + + force_ = false; + + 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_SetDefaultBranchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetDefaultBranchRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SetDefaultBranchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetDefaultBranchRequest build() { + com.google.cloud.retail.v2beta.SetDefaultBranchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetDefaultBranchRequest buildPartial() { + com.google.cloud.retail.v2beta.SetDefaultBranchRequest result = + new com.google.cloud.retail.v2beta.SetDefaultBranchRequest(this); + result.catalog_ = catalog_; + result.branchId_ = branchId_; + result.note_ = note_; + result.force_ = force_; + 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.SetDefaultBranchRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.SetDefaultBranchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SetDefaultBranchRequest other) { + if (other == com.google.cloud.retail.v2beta.SetDefaultBranchRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + onChanged(); + } + if (!other.getBranchId().isEmpty()) { + branchId_ = other.branchId_; + onChanged(); + } + if (!other.getNote().isEmpty()) { + note_ = other.note_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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.SetDefaultBranchRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SetDefaultBranchRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + catalog_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + + catalog_ = getDefaultInstance().getCatalog(); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of the catalog, such as
+     * `projects/*/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + catalog_ = value; + onChanged(); + return this; + } + + private java.lang.Object branchId_ = ""; + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + public java.lang.String getBranchId() { + java.lang.Object ref = branchId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branchId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + public com.google.protobuf.ByteString getBranchIdBytes() { + java.lang.Object ref = branchId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branchId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + branchId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranchId() { + + branchId_ = getDefaultInstance().getBranchId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The final component of the resource name of a branch.
+     * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+     * error is returned.
+     * If there are no sufficient active products in the targeted branch and
+     * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+     * set, a FAILED_PRECONDITION error is returned.
+     * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branchId to set. + * @return This builder for chaining. + */ + public Builder setBranchIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branchId_ = value; + onChanged(); + return this; + } + + private java.lang.Object note_ = ""; + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return The note. + */ + public java.lang.String getNote() { + java.lang.Object ref = note_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + note_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + public com.google.protobuf.ByteString getNoteBytes() { + java.lang.Object ref = note_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + note_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @param value The note to set. + * @return This builder for chaining. + */ + public Builder setNote(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + note_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @return This builder for chaining. + */ + public Builder clearNote() { + + note_ = getDefaultInstance().getNote(); + onChanged(); + return this; + } + /** + * + * + *
+     * Some note on this request, this can be retrieved by
+     * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+     * before next valid default branch set occurs.
+     * This field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string note = 3; + * + * @param value The bytes for note to set. + * @return This builder for chaining. + */ + public Builder setNoteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + note_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, it permits switching to a branch with
+     * [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id]
+     * even if it has no sufficient active products.
+     * 
+ * + * bool force = 4; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = 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.SetDefaultBranchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SetDefaultBranchRequest) + private static final com.google.cloud.retail.v2beta.SetDefaultBranchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SetDefaultBranchRequest(); + } + + public static com.google.cloud.retail.v2beta.SetDefaultBranchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetDefaultBranchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetDefaultBranchRequest(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.SetDefaultBranchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequestOrBuilder.java new file mode 100644 index 00000000..57cf8ccd --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetDefaultBranchRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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 SetDefaultBranchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SetDefaultBranchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Full resource name of the catalog, such as
+   * `projects/*/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string catalog = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branchId. + */ + java.lang.String getBranchId(); + /** + * + * + *
+   * The final component of the resource name of a branch.
+   * This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
+   * error is returned.
+   * If there are no sufficient active products in the targeted branch and
+   * [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not
+   * set, a FAILED_PRECONDITION error is returned.
+   * 
+ * + * string branch_id = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branchId. + */ + com.google.protobuf.ByteString getBranchIdBytes(); + + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The note. + */ + java.lang.String getNote(); + /** + * + * + *
+   * Some note on this request, this can be retrieved by
+   * [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]
+   * before next valid default branch set occurs.
+   * This field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string note = 3; + * + * @return The bytes for note. + */ + com.google.protobuf.ByteString getNoteBytes(); + + /** + * + * + *
+   * If set to true, it permits switching to a branch with
+   * [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id]
+   * even if it has no sufficient active products.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadata.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadata.java new file mode 100644 index 00000000..da2dbbbd --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadata.java @@ -0,0 +1,462 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata related to the progress of the SetInventory operation.
+ * Currently empty because there is no meaningful metadata populated from the
+ * [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryMetadata} + */ +public final class SetInventoryMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SetInventoryMetadata) + SetInventoryMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryMetadata.newBuilder() to construct. + private SetInventoryMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryMetadata( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryMetadata.class, + com.google.cloud.retail.v2beta.SetInventoryMetadata.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.SetInventoryMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SetInventoryMetadata other = + (com.google.cloud.retail.v2beta.SetInventoryMetadata) 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.SetInventoryMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata 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.SetInventoryMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata 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.SetInventoryMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata 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.SetInventoryMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata 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.SetInventoryMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata 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.SetInventoryMetadata 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.SetInventoryMetadata 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.SetInventoryMetadata 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 related to the progress of the SetInventory operation.
+   * Currently empty because there is no meaningful metadata populated from the
+   * [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SetInventoryMetadata) + com.google.cloud.retail.v2beta.SetInventoryMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryMetadata.class, + com.google.cloud.retail.v2beta.SetInventoryMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SetInventoryMetadata.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SetInventoryMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryMetadata build() { + com.google.cloud.retail.v2beta.SetInventoryMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryMetadata buildPartial() { + com.google.cloud.retail.v2beta.SetInventoryMetadata result = + new com.google.cloud.retail.v2beta.SetInventoryMetadata(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.SetInventoryMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.SetInventoryMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SetInventoryMetadata other) { + if (other == com.google.cloud.retail.v2beta.SetInventoryMetadata.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.SetInventoryMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SetInventoryMetadata) 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.SetInventoryMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SetInventoryMetadata) + private static final com.google.cloud.retail.v2beta.SetInventoryMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SetInventoryMetadata(); + } + + public static com.google.cloud.retail.v2beta.SetInventoryMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryMetadata(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.SetInventoryMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadataOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadataOrBuilder.java new file mode 100644 index 00000000..6acc6fec --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryMetadataOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface SetInventoryMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SetInventoryMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequest.java new file mode 100644 index 00000000..2e04e530 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequest.java @@ -0,0 +1,1981 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [SetInventory][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryRequest} + */ +public final class SetInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SetInventoryRequest) + SetInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryRequest.newBuilder() to construct. + private SetInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryRequest( + 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.Product.Builder subBuilder = null; + if (inventory_ != null) { + subBuilder = inventory_.toBuilder(); + } + inventory_ = + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inventory_); + inventory_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (setMask_ != null) { + subBuilder = setMask_.toBuilder(); + } + setMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setMask_); + setMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (setTime_ != null) { + subBuilder = setTime_.toBuilder(); + } + setTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setTime_); + setTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + allowMissing_ = 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryRequest.class, + com.google.cloud.retail.v2beta.SetInventoryRequest.Builder.class); + } + + public static final int INVENTORY_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Product inventory_; + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + @java.lang.Override + public boolean hasInventory() { + return inventory_ != null; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getInventory() { + return inventory_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : inventory_; + } + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getInventoryOrBuilder() { + return getInventory(); + } + + public static final int SET_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask setMask_; + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + @java.lang.Override + public boolean hasSetMask() { + return setMask_ != null; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getSetMask() { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + return getSetMask(); + } + + public static final int SET_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp setTime_; + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + @java.lang.Override + public boolean hasSetTime() { + return setTime_ != null; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSetTime() { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + return getSetTime(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] with
+   * name [Product.name][google.cloud.retail.v2beta.Product.name] is not found,
+   * the inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2beta.Product] is created. If set
+   * to false, a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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 (inventory_ != null) { + output.writeMessage(1, getInventory()); + } + if (setMask_ != null) { + output.writeMessage(2, getSetMask()); + } + if (setTime_ != null) { + output.writeMessage(3, getSetTime()); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inventory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInventory()); + } + if (setMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSetMask()); + } + if (setTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSetTime()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + 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.SetInventoryRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SetInventoryRequest other = + (com.google.cloud.retail.v2beta.SetInventoryRequest) obj; + + if (hasInventory() != other.hasInventory()) return false; + if (hasInventory()) { + if (!getInventory().equals(other.getInventory())) return false; + } + if (hasSetMask() != other.hasSetMask()) return false; + if (hasSetMask()) { + if (!getSetMask().equals(other.getSetMask())) return false; + } + if (hasSetTime() != other.hasSetTime()) return false; + if (hasSetTime()) { + if (!getSetTime().equals(other.getSetTime())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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 (hasInventory()) { + hash = (37 * hash) + INVENTORY_FIELD_NUMBER; + hash = (53 * hash) + getInventory().hashCode(); + } + if (hasSetMask()) { + hash = (37 * hash) + SET_MASK_FIELD_NUMBER; + hash = (53 * hash) + getSetMask().hashCode(); + } + if (hasSetTime()) { + hash = (37 * hash) + SET_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSetTime().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest 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.SetInventoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest 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.SetInventoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest 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.SetInventoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest 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.SetInventoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest 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.SetInventoryRequest 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.SetInventoryRequest 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.SetInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [SetInventory][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SetInventoryRequest) + com.google.cloud.retail.v2beta.SetInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryRequest.class, + com.google.cloud.retail.v2beta.SetInventoryRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SetInventoryRequest.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 (inventoryBuilder_ == null) { + inventory_ = null; + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + if (setMaskBuilder_ == null) { + setMask_ = null; + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + if (setTimeBuilder_ == null) { + setTime_ = null; + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SetInventoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryRequest build() { + com.google.cloud.retail.v2beta.SetInventoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryRequest buildPartial() { + com.google.cloud.retail.v2beta.SetInventoryRequest result = + new com.google.cloud.retail.v2beta.SetInventoryRequest(this); + if (inventoryBuilder_ == null) { + result.inventory_ = inventory_; + } else { + result.inventory_ = inventoryBuilder_.build(); + } + if (setMaskBuilder_ == null) { + result.setMask_ = setMask_; + } else { + result.setMask_ = setMaskBuilder_.build(); + } + if (setTimeBuilder_ == null) { + result.setTime_ = setTime_; + } else { + result.setTime_ = setTimeBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.SetInventoryRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.SetInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SetInventoryRequest other) { + if (other == com.google.cloud.retail.v2beta.SetInventoryRequest.getDefaultInstance()) + return this; + if (other.hasInventory()) { + mergeInventory(other.getInventory()); + } + if (other.hasSetMask()) { + mergeSetMask(other.getSetMask()); + } + if (other.hasSetTime()) { + mergeSetTime(other.getSetTime()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.SetInventoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SetInventoryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Product inventory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + inventoryBuilder_; + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + public boolean hasInventory() { + return inventoryBuilder_ != null || inventory_ != null; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + public com.google.cloud.retail.v2beta.Product getInventory() { + if (inventoryBuilder_ == null) { + return inventory_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : inventory_; + } else { + return inventoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2beta.Product value) { + if (inventoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inventory_ = value; + onChanged(); + } else { + inventoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInventory(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (inventoryBuilder_ == null) { + inventory_ = builderForValue.build(); + onChanged(); + } else { + inventoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInventory(com.google.cloud.retail.v2beta.Product value) { + if (inventoryBuilder_ == null) { + if (inventory_ != null) { + inventory_ = + com.google.cloud.retail.v2beta.Product.newBuilder(inventory_) + .mergeFrom(value) + .buildPartial(); + } else { + inventory_ = value; + } + onChanged(); + } else { + inventoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInventory() { + if (inventoryBuilder_ == null) { + inventory_ = null; + onChanged(); + } else { + inventory_ = null; + inventoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getInventoryBuilder() { + + onChanged(); + return getInventoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getInventoryOrBuilder() { + if (inventoryBuilder_ != null) { + return inventoryBuilder_.getMessageOrBuilder(); + } else { + return inventory_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : inventory_; + } + } + /** + * + * + *
+     * Required. The inventory information to update. The allowable fields to
+     * update are:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * The updated inventory fields must be specified in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+     * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+     * INVALID_ARGUMENT error is returned.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product] named in
+     * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+     * whether or not it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * have existing inventory information, the provided inventory information
+     * will be inserted.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+     * inventory information, the provided inventory information will be merged
+     * while respecting the last update time for each inventory field, using the
+     * provided or default value for
+     * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+     * The caller can replace place IDs for a subset of fulfillment types in the
+     * following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types and corresponding place IDs
+     * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+     * The caller can clear all place IDs from a subset of fulfillment types in
+     * the following ways:
+     * * Adds "fulfillment_info" in
+     * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+     * * Specifies only the desired fulfillment types to clear in
+     * [SetInventoryRequest.inventory.fulfillment_info][]
+     * * Checks that only the desired fulfillment info types have empty
+     * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+     * The last update time is recorded for the following inventory fields:
+     * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+     * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+     * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+     * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+     * If a full overwrite of inventory information while ignoring timestamps is
+     * needed, [UpdateProduct][] should be invoked instead.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getInventoryFieldBuilder() { + if (inventoryBuilder_ == null) { + inventoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + getInventory(), getParentForChildren(), isClean()); + inventory_ = null; + } + return inventoryBuilder_; + } + + private com.google.protobuf.FieldMask setMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + setMaskBuilder_; + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + public boolean hasSetMask() { + return setMaskBuilder_ != null || setMask_ != null; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + public com.google.protobuf.FieldMask getSetMask() { + if (setMaskBuilder_ == null) { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } else { + return setMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setMask_ = value; + onChanged(); + } else { + setMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder setSetMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (setMaskBuilder_ == null) { + setMask_ = builderForValue.build(); + onChanged(); + } else { + setMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder mergeSetMask(com.google.protobuf.FieldMask value) { + if (setMaskBuilder_ == null) { + if (setMask_ != null) { + setMask_ = + com.google.protobuf.FieldMask.newBuilder(setMask_).mergeFrom(value).buildPartial(); + } else { + setMask_ = value; + } + onChanged(); + } else { + setMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public Builder clearSetMask() { + if (setMaskBuilder_ == null) { + setMask_ = null; + onChanged(); + } else { + setMask_ = null; + setMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getSetMaskBuilder() { + + onChanged(); + return getSetMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder() { + if (setMaskBuilder_ != null) { + return setMaskBuilder_.getMessageOrBuilder(); + } else { + return setMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : setMask_; + } + } + /** + * + * + *
+     * Indicates which inventory fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update.
+     * At least one field must be provided.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned and the entire update will be ignored.
+     * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getSetMaskFieldBuilder() { + if (setMaskBuilder_ == null) { + setMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getSetMask(), getParentForChildren(), isClean()); + setMask_ = null; + } + return setMaskBuilder_; + } + + private com.google.protobuf.Timestamp setTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + setTimeBuilder_; + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + public boolean hasSetTime() { + return setTimeBuilder_ != null || setTime_ != null; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + public com.google.protobuf.Timestamp getSetTime() { + if (setTimeBuilder_ == null) { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } else { + return setTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + setTime_ = value; + onChanged(); + } else { + setTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder setSetTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (setTimeBuilder_ == null) { + setTime_ = builderForValue.build(); + onChanged(); + } else { + setTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder mergeSetTime(com.google.protobuf.Timestamp value) { + if (setTimeBuilder_ == null) { + if (setTime_ != null) { + setTime_ = + com.google.protobuf.Timestamp.newBuilder(setTime_).mergeFrom(value).buildPartial(); + } else { + setTime_ = value; + } + onChanged(); + } else { + setTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public Builder clearSetTime() { + if (setTimeBuilder_ == null) { + setTime_ = null; + onChanged(); + } else { + setTime_ = null; + setTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSetTimeBuilder() { + + onChanged(); + return getSetTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder() { + if (setTimeBuilder_ != null) { + return setTimeBuilder_.getMessageOrBuilder(); + } else { + return setTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : setTime_; + } + } + /** + * + * + *
+     * The time when the request is issued, used to prevent
+     * out-of-order updates on inventory fields with the last update time
+     * recorded. If not provided, the internal system time will be used.
+     * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSetTimeFieldBuilder() { + if (setTimeBuilder_ == null) { + setTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSetTime(), getParentForChildren(), isClean()); + setTime_ = null; + } + return setTimeBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] with
+     * name [Product.name][google.cloud.retail.v2beta.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2beta.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] with
+     * name [Product.name][google.cloud.retail.v2beta.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2beta.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] with
+     * name [Product.name][google.cloud.retail.v2beta.Product.name] is not found,
+     * the inventory update will still be processed and retained for at most 1 day
+     * until the [Product][google.cloud.retail.v2beta.Product] is created. If set
+     * to false, a NOT_FOUND error is returned if the
+     * [Product][google.cloud.retail.v2beta.Product] is not found.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.SetInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SetInventoryRequest) + private static final com.google.cloud.retail.v2beta.SetInventoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SetInventoryRequest(); + } + + public static com.google.cloud.retail.v2beta.SetInventoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryRequest(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.SetInventoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequestOrBuilder.java new file mode 100644 index 00000000..97a77f72 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryRequestOrBuilder.java @@ -0,0 +1,298 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface SetInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SetInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inventory field is set. + */ + boolean hasInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inventory. + */ + com.google.cloud.retail.v2beta.Product getInventory(); + /** + * + * + *
+   * Required. The inventory information to update. The allowable fields to
+   * update are:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * The updated inventory fields must be specified in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
+   * If [SetInventoryRequest.inventory.name][] is empty or invalid, an
+   * INVALID_ARGUMENT error is returned.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product] named in
+   * [Product.name][google.cloud.retail.v2beta.Product.name], regardless of
+   * whether or not it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * have existing inventory information, the provided inventory information
+   * will be inserted.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update has existing
+   * inventory information, the provided inventory information will be merged
+   * while respecting the last update time for each inventory field, using the
+   * provided or default value for
+   * [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
+   * The caller can replace place IDs for a subset of fulfillment types in the
+   * following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types and corresponding place IDs
+   * to update in [SetInventoryRequest.inventory.fulfillment_info][]
+   * The caller can clear all place IDs from a subset of fulfillment types in
+   * the following ways:
+   * * Adds "fulfillment_info" in
+   * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
+   * * Specifies only the desired fulfillment types to clear in
+   * [SetInventoryRequest.inventory.fulfillment_info][]
+   * * Checks that only the desired fulfillment info types have empty
+   * [SetInventoryRequest.inventory.fulfillment_info.place_ids][]
+   * The last update time is recorded for the following inventory fields:
+   * * [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
+   * * [Product.availability][google.cloud.retail.v2beta.Product.availability]
+   * * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
+   * * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
+   * If a full overwrite of inventory information while ignoring timestamps is
+   * needed, [UpdateProduct][] should be invoked instead.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product inventory = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getInventoryOrBuilder(); + + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return Whether the setMask field is set. + */ + boolean hasSetMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + * + * @return The setMask. + */ + com.google.protobuf.FieldMask getSetMask(); + /** + * + * + *
+   * Indicates which inventory fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update.
+   * At least one field must be provided.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned and the entire update will be ignored.
+   * 
+ * + * .google.protobuf.FieldMask set_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getSetMaskOrBuilder(); + + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return Whether the setTime field is set. + */ + boolean hasSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + * + * @return The setTime. + */ + com.google.protobuf.Timestamp getSetTime(); + /** + * + * + *
+   * The time when the request is issued, used to prevent
+   * out-of-order updates on inventory fields with the last update time
+   * recorded. If not provided, the internal system time will be used.
+   * 
+ * + * .google.protobuf.Timestamp set_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSetTimeOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] with
+   * name [Product.name][google.cloud.retail.v2beta.Product.name] is not found,
+   * the inventory update will still be processed and retained for at most 1 day
+   * until the [Product][google.cloud.retail.v2beta.Product] is created. If set
+   * to false, a NOT_FOUND error is returned if the
+   * [Product][google.cloud.retail.v2beta.Product] is not found.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponse.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponse.java new file mode 100644 index 00000000..e1b59190 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponse.java @@ -0,0 +1,462 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the SetInventoryRequest.  Currently empty because
+ * there is no meaningful response populated from the [SetInventory][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryResponse} + */ +public final class SetInventoryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.SetInventoryResponse) + SetInventoryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetInventoryResponse.newBuilder() to construct. + private SetInventoryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetInventoryResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetInventoryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetInventoryResponse( + 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryResponse.class, + com.google.cloud.retail.v2beta.SetInventoryResponse.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.SetInventoryResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.SetInventoryResponse other = + (com.google.cloud.retail.v2beta.SetInventoryResponse) 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.SetInventoryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse 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.SetInventoryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse 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.SetInventoryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse 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.SetInventoryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse 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.SetInventoryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse 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.SetInventoryResponse 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.SetInventoryResponse 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.SetInventoryResponse 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 SetInventoryRequest.  Currently empty because
+   * there is no meaningful response populated from the [SetInventory][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.SetInventoryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.SetInventoryResponse) + com.google.cloud.retail.v2beta.SetInventoryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.SetInventoryResponse.class, + com.google.cloud.retail.v2beta.SetInventoryResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.SetInventoryResponse.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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_SetInventoryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.SetInventoryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryResponse build() { + com.google.cloud.retail.v2beta.SetInventoryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.SetInventoryResponse buildPartial() { + com.google.cloud.retail.v2beta.SetInventoryResponse result = + new com.google.cloud.retail.v2beta.SetInventoryResponse(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.SetInventoryResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.SetInventoryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.SetInventoryResponse other) { + if (other == com.google.cloud.retail.v2beta.SetInventoryResponse.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.SetInventoryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.SetInventoryResponse) 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.SetInventoryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.SetInventoryResponse) + private static final com.google.cloud.retail.v2beta.SetInventoryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.SetInventoryResponse(); + } + + public static com.google.cloud.retail.v2beta.SetInventoryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetInventoryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetInventoryResponse(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.SetInventoryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponseOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponseOrBuilder.java new file mode 100644 index 00000000..99181503 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SetInventoryResponseOrBuilder.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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface SetInventoryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.SetInventoryResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SolutionType.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SolutionType.java new file mode 100644 index 00000000..4c03f6f3 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SolutionType.java @@ -0,0 +1,176 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The type of solution.
+ * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.SolutionType} + */ +public enum SolutionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default value.
+   * 
+ * + * SOLUTION_TYPE_UNSPECIFIED = 0; + */ + SOLUTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Used for Recommendations AI.
+   * 
+ * + * SOLUTION_TYPE_RECOMMENDATION = 1; + */ + SOLUTION_TYPE_RECOMMENDATION(1), + /** + * + * + *
+   * Used for Retail Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + SOLUTION_TYPE_SEARCH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Default value.
+   * 
+ * + * SOLUTION_TYPE_UNSPECIFIED = 0; + */ + public static final int SOLUTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Used for Recommendations AI.
+   * 
+ * + * SOLUTION_TYPE_RECOMMENDATION = 1; + */ + public static final int SOLUTION_TYPE_RECOMMENDATION_VALUE = 1; + /** + * + * + *
+   * Used for Retail Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + public static final int SOLUTION_TYPE_SEARCH_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 SolutionType 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 SolutionType forNumber(int value) { + switch (value) { + case 0: + return SOLUTION_TYPE_UNSPECIFIED; + case 1: + return SOLUTION_TYPE_RECOMMENDATION; + case 2: + return SOLUTION_TYPE_SEARCH; + 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 SolutionType findValueByNumber(int number) { + return SolutionType.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.CommonProto.getDescriptor().getEnumTypes().get(1); + } + + private static final SolutionType[] VALUES = values(); + + public static SolutionType 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 SolutionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.SolutionType) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequest.java new file mode 100644 index 00000000..dcd9c5ce --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequest.java @@ -0,0 +1,1100 @@ +/* + * 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.UpdateAttributesConfig][google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateAttributesConfigRequest} + */ +public final class UpdateAttributesConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateAttributesConfigRequest) + UpdateAttributesConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAttributesConfigRequest.newBuilder() to construct. + private UpdateAttributesConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAttributesConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAttributesConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAttributesConfigRequest( + 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.AttributesConfig.Builder subBuilder = null; + if (attributesConfig_ != null) { + subBuilder = attributesConfig_.toBuilder(); + } + attributesConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.AttributesConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attributesConfig_); + attributesConfig_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.AttributesConfig attributesConfig_; + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + @java.lang.Override + public boolean hasAttributesConfig() { + return attributesConfig_ != null; + } + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributesConfig getAttributesConfig() { + return attributesConfig_ == null + ? com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.AttributesConfigOrBuilder getAttributesConfigOrBuilder() { + return getAttributesConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (attributesConfig_ != null) { + output.writeMessage(1, getAttributesConfig()); + } + 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 (attributesConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAttributesConfig()); + } + 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.UpdateAttributesConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest other = + (com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest) obj; + + if (hasAttributesConfig() != other.hasAttributesConfig()) return false; + if (hasAttributesConfig()) { + if (!getAttributesConfig().equals(other.getAttributesConfig())) 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 (hasAttributesConfig()) { + hash = (37 * hash) + ATTRIBUTES_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAttributesConfig().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.UpdateAttributesConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest 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.UpdateAttributesConfigRequest 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.UpdateAttributesConfig][google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateAttributesConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateAttributesConfigRequest) + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.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 (attributesConfigBuilder_ == null) { + attributesConfig_ = null; + } else { + attributesConfig_ = null; + attributesConfigBuilder_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateAttributesConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest build() { + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest result = + new com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest(this); + if (attributesConfigBuilder_ == null) { + result.attributesConfig_ = attributesConfig_; + } else { + result.attributesConfig_ = attributesConfigBuilder_.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.UpdateAttributesConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest other) { + if (other + == com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest.getDefaultInstance()) + return this; + if (other.hasAttributesConfig()) { + mergeAttributesConfig(other.getAttributesConfig()); + } + 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.UpdateAttributesConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.AttributesConfig attributesConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.AttributesConfig, + com.google.cloud.retail.v2beta.AttributesConfig.Builder, + com.google.cloud.retail.v2beta.AttributesConfigOrBuilder> + attributesConfigBuilder_; + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + public boolean hasAttributesConfig() { + return attributesConfigBuilder_ != null || attributesConfig_ != null; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + public com.google.cloud.retail.v2beta.AttributesConfig getAttributesConfig() { + if (attributesConfigBuilder_ == null) { + return attributesConfig_ == null + ? com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } else { + return attributesConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributesConfig(com.google.cloud.retail.v2beta.AttributesConfig value) { + if (attributesConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributesConfig_ = value; + onChanged(); + } else { + attributesConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributesConfig( + com.google.cloud.retail.v2beta.AttributesConfig.Builder builderForValue) { + if (attributesConfigBuilder_ == null) { + attributesConfig_ = builderForValue.build(); + onChanged(); + } else { + attributesConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttributesConfig(com.google.cloud.retail.v2beta.AttributesConfig value) { + if (attributesConfigBuilder_ == null) { + if (attributesConfig_ != null) { + attributesConfig_ = + com.google.cloud.retail.v2beta.AttributesConfig.newBuilder(attributesConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + attributesConfig_ = value; + } + onChanged(); + } else { + attributesConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAttributesConfig() { + if (attributesConfigBuilder_ == null) { + attributesConfig_ = null; + onChanged(); + } else { + attributesConfig_ = null; + attributesConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.AttributesConfig.Builder getAttributesConfigBuilder() { + + onChanged(); + return getAttributesConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.AttributesConfigOrBuilder getAttributesConfigOrBuilder() { + if (attributesConfigBuilder_ != null) { + return attributesConfigBuilder_.getMessageOrBuilder(); + } else { + return attributesConfig_ == null + ? com.google.cloud.retail.v2beta.AttributesConfig.getDefaultInstance() + : attributesConfig_; + } + } + /** + * + * + *
+     * Required. The
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.AttributesConfig, + com.google.cloud.retail.v2beta.AttributesConfig.Builder, + com.google.cloud.retail.v2beta.AttributesConfigOrBuilder> + getAttributesConfigFieldBuilder() { + if (attributesConfigBuilder_ == null) { + attributesConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.AttributesConfig, + com.google.cloud.retail.v2beta.AttributesConfig.Builder, + com.google.cloud.retail.v2beta.AttributesConfigOrBuilder>( + getAttributesConfig(), getParentForChildren(), isClean()); + attributesConfig_ = null; + } + return attributesConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+     * The following is the only supported field:
+     * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.UpdateAttributesConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateAttributesConfigRequest) + private static final com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateAttributesConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAttributesConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAttributesConfigRequest(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.UpdateAttributesConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequestOrBuilder.java new file mode 100644 index 00000000..f60f4251 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateAttributesConfigRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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 UpdateAttributesConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateAttributesConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributesConfig field is set. + */ + boolean hasAttributesConfig(); + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributesConfig. + */ + com.google.cloud.retail.v2beta.AttributesConfig getAttributesConfig(); + /** + * + * + *
+   * Required. The
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.AttributesConfig attributes_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.AttributesConfigOrBuilder getAttributesConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update.
+   * The following is the only supported field:
+   * * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequest.java new file mode 100644 index 00000000..227a7261 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequest.java @@ -0,0 +1,1131 @@ +/* + * 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.UpdateCatalog][google.cloud.retail.v2beta.CatalogService.UpdateCatalog]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateCatalogRequest} + */ +public final class UpdateCatalogRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateCatalogRequest) + UpdateCatalogRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCatalogRequest.newBuilder() to construct. + private UpdateCatalogRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCatalogRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCatalogRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCatalogRequest( + 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.Catalog.Builder subBuilder = null; + if (catalog_ != null) { + subBuilder = catalog_.toBuilder(); + } + catalog_ = + input.readMessage( + com.google.cloud.retail.v2beta.Catalog.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(catalog_); + catalog_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateCatalogRequest.class, + com.google.cloud.retail.v2beta.UpdateCatalogRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Catalog catalog_; + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + @java.lang.Override + public boolean hasCatalog() { + return catalog_ != null; + } + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Catalog getCatalog() { + return catalog_ == null + ? com.google.cloud.retail.v2beta.Catalog.getDefaultInstance() + : catalog_; + } + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogOrBuilder() { + return getCatalog(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (catalog_ != null) { + output.writeMessage(1, getCatalog()); + } + 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 (catalog_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCatalog()); + } + 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.UpdateCatalogRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateCatalogRequest other = + (com.google.cloud.retail.v2beta.UpdateCatalogRequest) obj; + + if (hasCatalog() != other.hasCatalog()) return false; + if (hasCatalog()) { + if (!getCatalog().equals(other.getCatalog())) 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 (hasCatalog()) { + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().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.UpdateCatalogRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest 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.UpdateCatalogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest 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.UpdateCatalogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest 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.UpdateCatalogRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest 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.UpdateCatalogRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest 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.UpdateCatalogRequest 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.UpdateCatalogRequest 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.UpdateCatalogRequest 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.UpdateCatalog][google.cloud.retail.v2beta.CatalogService.UpdateCatalog]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateCatalogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateCatalogRequest) + com.google.cloud.retail.v2beta.UpdateCatalogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateCatalogRequest.class, + com.google.cloud.retail.v2beta.UpdateCatalogRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateCatalogRequest.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 (catalogBuilder_ == null) { + catalog_ = null; + } else { + catalog_ = null; + catalogBuilder_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCatalogRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCatalogRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateCatalogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCatalogRequest build() { + com.google.cloud.retail.v2beta.UpdateCatalogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCatalogRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateCatalogRequest result = + new com.google.cloud.retail.v2beta.UpdateCatalogRequest(this); + if (catalogBuilder_ == null) { + result.catalog_ = catalog_; + } else { + result.catalog_ = catalogBuilder_.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.UpdateCatalogRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateCatalogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateCatalogRequest other) { + if (other == com.google.cloud.retail.v2beta.UpdateCatalogRequest.getDefaultInstance()) + return this; + if (other.hasCatalog()) { + mergeCatalog(other.getCatalog()); + } + 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.UpdateCatalogRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateCatalogRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Catalog catalog_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder> + catalogBuilder_; + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + public boolean hasCatalog() { + return catalogBuilder_ != null || catalog_ != null; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + public com.google.cloud.retail.v2beta.Catalog getCatalog() { + if (catalogBuilder_ == null) { + return catalog_ == null + ? com.google.cloud.retail.v2beta.Catalog.getDefaultInstance() + : catalog_; + } else { + return catalogBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalog(com.google.cloud.retail.v2beta.Catalog value) { + if (catalogBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + catalog_ = value; + onChanged(); + } else { + catalogBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCatalog(com.google.cloud.retail.v2beta.Catalog.Builder builderForValue) { + if (catalogBuilder_ == null) { + catalog_ = builderForValue.build(); + onChanged(); + } else { + catalogBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCatalog(com.google.cloud.retail.v2beta.Catalog value) { + if (catalogBuilder_ == null) { + if (catalog_ != null) { + catalog_ = + com.google.cloud.retail.v2beta.Catalog.newBuilder(catalog_) + .mergeFrom(value) + .buildPartial(); + } else { + catalog_ = value; + } + onChanged(); + } else { + catalogBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCatalog() { + if (catalogBuilder_ == null) { + catalog_ = null; + onChanged(); + } else { + catalog_ = null; + catalogBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Catalog.Builder getCatalogBuilder() { + + onChanged(); + return getCatalogFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogOrBuilder() { + if (catalogBuilder_ != null) { + return catalogBuilder_.getMessageOrBuilder(); + } else { + return catalog_ == null + ? com.google.cloud.retail.v2beta.Catalog.getDefaultInstance() + : catalog_; + } + } + /** + * + * + *
+     * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If the caller does not have permission to update the
+     * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+     * exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder> + getCatalogFieldBuilder() { + if (catalogBuilder_ == null) { + catalogBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Catalog, + com.google.cloud.retail.v2beta.Catalog.Builder, + com.google.cloud.retail.v2beta.CatalogOrBuilder>( + getCatalog(), getParentForChildren(), isClean()); + catalog_ = null; + } + return catalogBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.UpdateCatalogRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateCatalogRequest) + private static final com.google.cloud.retail.v2beta.UpdateCatalogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateCatalogRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateCatalogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCatalogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCatalogRequest(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.UpdateCatalogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequestOrBuilder.java new file mode 100644 index 00000000..47960976 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCatalogRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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 UpdateCatalogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateCatalogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the catalog field is set. + */ + boolean hasCatalog(); + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The catalog. + */ + com.google.cloud.retail.v2beta.Catalog getCatalog(); + /** + * + * + *
+   * Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If the caller does not have permission to update the
+   * [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not
+   * exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Catalog catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.CatalogOrBuilder getCatalogOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to update.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequest.java new file mode 100644 index 00000000..fd4a5755 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequest.java @@ -0,0 +1,1196 @@ +/* + * 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.UpdateCompletionConfig][google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateCompletionConfigRequest} + */ +public final class UpdateCompletionConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateCompletionConfigRequest) + UpdateCompletionConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCompletionConfigRequest.newBuilder() to construct. + private UpdateCompletionConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCompletionConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCompletionConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCompletionConfigRequest( + 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.CompletionConfig.Builder subBuilder = null; + if (completionConfig_ != null) { + subBuilder = completionConfig_.toBuilder(); + } + completionConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completionConfig_); + completionConfig_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.Builder.class); + } + + public static final int COMPLETION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.CompletionConfig completionConfig_; + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + @java.lang.Override + public boolean hasCompletionConfig() { + return completionConfig_ != null; + } + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionConfig getCompletionConfig() { + return completionConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance() + : completionConfig_; + } + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionConfigOrBuilder getCompletionConfigOrBuilder() { + return getCompletionConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (completionConfig_ != null) { + output.writeMessage(1, getCompletionConfig()); + } + 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 (completionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCompletionConfig()); + } + 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.UpdateCompletionConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest other = + (com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest) obj; + + if (hasCompletionConfig() != other.hasCompletionConfig()) return false; + if (hasCompletionConfig()) { + if (!getCompletionConfig().equals(other.getCompletionConfig())) 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 (hasCompletionConfig()) { + hash = (37 * hash) + COMPLETION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getCompletionConfig().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.UpdateCompletionConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest 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.UpdateCompletionConfigRequest 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.UpdateCompletionConfig][google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateCompletionConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateCompletionConfigRequest) + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.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 (completionConfigBuilder_ == null) { + completionConfig_ = null; + } else { + completionConfig_ = null; + completionConfigBuilder_ = 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.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateCompletionConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest build() { + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest result = + new com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest(this); + if (completionConfigBuilder_ == null) { + result.completionConfig_ = completionConfig_; + } else { + result.completionConfig_ = completionConfigBuilder_.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.UpdateCompletionConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest other) { + if (other + == com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest.getDefaultInstance()) + return this; + if (other.hasCompletionConfig()) { + mergeCompletionConfig(other.getCompletionConfig()); + } + 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.UpdateCompletionConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.CompletionConfig completionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionConfig, + com.google.cloud.retail.v2beta.CompletionConfig.Builder, + com.google.cloud.retail.v2beta.CompletionConfigOrBuilder> + completionConfigBuilder_; + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + public boolean hasCompletionConfig() { + return completionConfigBuilder_ != null || completionConfig_ != null; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + public com.google.cloud.retail.v2beta.CompletionConfig getCompletionConfig() { + if (completionConfigBuilder_ == null) { + return completionConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance() + : completionConfig_; + } else { + return completionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCompletionConfig(com.google.cloud.retail.v2beta.CompletionConfig value) { + if (completionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionConfig_ = value; + onChanged(); + } else { + completionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCompletionConfig( + com.google.cloud.retail.v2beta.CompletionConfig.Builder builderForValue) { + if (completionConfigBuilder_ == null) { + completionConfig_ = builderForValue.build(); + onChanged(); + } else { + completionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCompletionConfig(com.google.cloud.retail.v2beta.CompletionConfig value) { + if (completionConfigBuilder_ == null) { + if (completionConfig_ != null) { + completionConfig_ = + com.google.cloud.retail.v2beta.CompletionConfig.newBuilder(completionConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + completionConfig_ = value; + } + onChanged(); + } else { + completionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCompletionConfig() { + if (completionConfigBuilder_ == null) { + completionConfig_ = null; + onChanged(); + } else { + completionConfig_ = null; + completionConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CompletionConfig.Builder getCompletionConfigBuilder() { + + onChanged(); + return getCompletionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.CompletionConfigOrBuilder getCompletionConfigOrBuilder() { + if (completionConfigBuilder_ != null) { + return completionConfigBuilder_.getMessageOrBuilder(); + } else { + return completionConfig_ == null + ? com.google.cloud.retail.v2beta.CompletionConfig.getDefaultInstance() + : completionConfig_; + } + } + /** + * + * + *
+     * Required. The
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * If the caller does not have permission to update the
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+     * PERMISSION_DENIED error is returned.
+     * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+     * update does not exist, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionConfig, + com.google.cloud.retail.v2beta.CompletionConfig.Builder, + com.google.cloud.retail.v2beta.CompletionConfigOrBuilder> + getCompletionConfigFieldBuilder() { + if (completionConfigBuilder_ == null) { + completionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionConfig, + com.google.cloud.retail.v2beta.CompletionConfig.Builder, + com.google.cloud.retail.v2beta.CompletionConfigOrBuilder>( + getCompletionConfig(), getParentForChildren(), isClean()); + completionConfig_ = null; + } + return completionConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+     * The following are the only supported fields:
+     * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+     * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+     * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+     * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.UpdateCompletionConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateCompletionConfigRequest) + private static final com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateCompletionConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCompletionConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCompletionConfigRequest(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.UpdateCompletionConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequestOrBuilder.java new file mode 100644 index 00000000..89915979 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateCompletionConfigRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * 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 UpdateCompletionConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateCompletionConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the completionConfig field is set. + */ + boolean hasCompletionConfig(); + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The completionConfig. + */ + com.google.cloud.retail.v2beta.CompletionConfig getCompletionConfig(); + /** + * + * + *
+   * Required. The
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * If the caller does not have permission to update the
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a
+   * PERMISSION_DENIED error is returned.
+   * If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to
+   * update does not exist, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CompletionConfig completion_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.CompletionConfigOrBuilder getCompletionConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update.
+   * The following are the only supported fields:
+   * * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order]
+   * * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]
+   * * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length]
+   * * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequest.java new file mode 100644 index 00000000..73cf1368 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequest.java @@ -0,0 +1,1079 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for UpdateControl method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateControlRequest} + */ +public final class UpdateControlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateControlRequest) + UpdateControlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateControlRequest.newBuilder() to construct. + private UpdateControlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateControlRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateControlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateControlRequest( + 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.Control.Builder subBuilder = null; + if (control_ != null) { + subBuilder = control_.toBuilder(); + } + control_ = + input.readMessage( + com.google.cloud.retail.v2beta.Control.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(control_); + control_ = 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateControlRequest.class, + com.google.cloud.retail.v2beta.UpdateControlRequest.Builder.class); + } + + public static final int CONTROL_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Control control_; + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + @java.lang.Override + public boolean hasControl() { + return control_ != null; + } + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Control getControl() { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder() { + return getControl(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (control_ != null) { + output.writeMessage(1, getControl()); + } + 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 (control_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getControl()); + } + 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.UpdateControlRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateControlRequest other = + (com.google.cloud.retail.v2beta.UpdateControlRequest) obj; + + if (hasControl() != other.hasControl()) return false; + if (hasControl()) { + if (!getControl().equals(other.getControl())) 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 (hasControl()) { + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getControl().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.UpdateControlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest 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.UpdateControlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest 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.UpdateControlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest 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.UpdateControlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest 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.UpdateControlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest 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.UpdateControlRequest 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.UpdateControlRequest 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.UpdateControlRequest 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 UpdateControl method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateControlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateControlRequest) + com.google.cloud.retail.v2beta.UpdateControlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateControlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateControlRequest.class, + com.google.cloud.retail.v2beta.UpdateControlRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateControlRequest.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 (controlBuilder_ == null) { + control_ = null; + } else { + control_ = null; + controlBuilder_ = 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.ControlServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateControlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateControlRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateControlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateControlRequest build() { + com.google.cloud.retail.v2beta.UpdateControlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateControlRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateControlRequest result = + new com.google.cloud.retail.v2beta.UpdateControlRequest(this); + if (controlBuilder_ == null) { + result.control_ = control_; + } else { + result.control_ = controlBuilder_.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.UpdateControlRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateControlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateControlRequest other) { + if (other == com.google.cloud.retail.v2beta.UpdateControlRequest.getDefaultInstance()) + return this; + if (other.hasControl()) { + mergeControl(other.getControl()); + } + 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.UpdateControlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateControlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Control control_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + controlBuilder_; + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + public boolean hasControl() { + return controlBuilder_ != null || control_ != null; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + public com.google.cloud.retail.v2beta.Control getControl() { + if (controlBuilder_ == null) { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } else { + return controlBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2beta.Control value) { + if (controlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + onChanged(); + } else { + controlBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setControl(com.google.cloud.retail.v2beta.Control.Builder builderForValue) { + if (controlBuilder_ == null) { + control_ = builderForValue.build(); + onChanged(); + } else { + controlBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeControl(com.google.cloud.retail.v2beta.Control value) { + if (controlBuilder_ == null) { + if (control_ != null) { + control_ = + com.google.cloud.retail.v2beta.Control.newBuilder(control_) + .mergeFrom(value) + .buildPartial(); + } else { + control_ = value; + } + onChanged(); + } else { + controlBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearControl() { + if (controlBuilder_ == null) { + control_ = null; + onChanged(); + } else { + control_ = null; + controlBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Control.Builder getControlBuilder() { + + onChanged(); + return getControlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder() { + if (controlBuilder_ != null) { + return controlBuilder_.getMessageOrBuilder(); + } else { + return control_ == null + ? com.google.cloud.retail.v2beta.Control.getDefaultInstance() + : control_; + } + } + /** + * + * + *
+     * Required. The Control to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder> + getControlFieldBuilder() { + if (controlBuilder_ == null) { + controlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Control, + com.google.cloud.retail.v2beta.Control.Builder, + com.google.cloud.retail.v2beta.ControlOrBuilder>( + getControl(), getParentForChildren(), isClean()); + control_ = null; + } + return controlBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+     * NOT supported:
+     * * [Control.name][google.cloud.retail.v2beta.Control.name]
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.UpdateControlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateControlRequest) + private static final com.google.cloud.retail.v2beta.UpdateControlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateControlRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateControlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateControlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateControlRequest(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.UpdateControlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequestOrBuilder.java new file mode 100644 index 00000000..f737f823 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateControlRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/control_service.proto + +package com.google.cloud.retail.v2beta; + +public interface UpdateControlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateControlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the control field is set. + */ + boolean hasControl(); + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The control. + */ + com.google.cloud.retail.v2beta.Control getControl(); + /** + * + * + *
+   * Required. The Control to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Control control = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ControlOrBuilder getControlOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Control][google.cloud.retail.v2beta.Control] to update. The following are
+   * NOT supported:
+   * * [Control.name][google.cloud.retail.v2beta.Control.name]
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequest.java new file mode 100644 index 00000000..02e3d651 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequest.java @@ -0,0 +1,1273 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for [UpdateProduct][] method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateProductRequest} + */ +public final class UpdateProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateProductRequest) + UpdateProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateProductRequest.newBuilder() to construct. + private UpdateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateProductRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateProductRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateProductRequest( + 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.Product.Builder subBuilder = null; + if (product_ != null) { + subBuilder = product_.toBuilder(); + } + product_ = + input.readMessage( + com.google.cloud.retail.v2beta.Product.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(product_); + product_ = 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; + } + case 24: + { + allowMissing_ = 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.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateProductRequest.class, + com.google.cloud.retail.v2beta.UpdateProductRequest.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Product product_; + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Product getProduct() { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + return getProduct(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_; + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, a new [Product][google.cloud.retail.v2beta.Product] will be
+   * created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + 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 (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + 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.UpdateProductRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateProductRequest other = + (com.google.cloud.retail.v2beta.UpdateProductRequest) obj; + + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest 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.UpdateProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest 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.UpdateProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest 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.UpdateProductRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest 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.UpdateProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest 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.UpdateProductRequest 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.UpdateProductRequest 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.UpdateProductRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [UpdateProduct][] method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateProductRequest) + com.google.cloud.retail.v2beta.UpdateProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateProductRequest.class, + com.google.cloud.retail.v2beta.UpdateProductRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateProductRequest.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 (productBuilder_ == null) { + product_ = null; + } else { + product_ = null; + productBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + allowMissing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ProductServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateProductRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateProductRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateProductRequest build() { + com.google.cloud.retail.v2beta.UpdateProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateProductRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateProductRequest result = + new com.google.cloud.retail.v2beta.UpdateProductRequest(this); + if (productBuilder_ == null) { + result.product_ = product_; + } else { + result.product_ = productBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.allowMissing_ = allowMissing_; + 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.UpdateProductRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateProductRequest other) { + if (other == com.google.cloud.retail.v2beta.UpdateProductRequest.getDefaultInstance()) + return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + 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.UpdateProductRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateProductRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return productBuilder_ != null || product_ != null; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + public com.google.cloud.retail.v2beta.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + onChanged(); + } else { + productBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProduct(com.google.cloud.retail.v2beta.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + onChanged(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProduct(com.google.cloud.retail.v2beta.Product value) { + if (productBuilder_ == null) { + if (product_ != null) { + product_ = + com.google.cloud.retail.v2beta.Product.newBuilder(product_) + .mergeFrom(value) + .buildPartial(); + } else { + product_ = value; + } + onChanged(); + } else { + productBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProduct() { + if (productBuilder_ == null) { + product_ = null; + onChanged(); + } else { + product_ = null; + productBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Product.Builder getProductBuilder() { + + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.retail.v2beta.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Required. The product to update/create.
+     * If the caller does not have permission to update the
+     * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+     * it exists, a PERMISSION_DENIED error is returned.
+     * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+     * exist and
+     * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+     * is not set, a NOT_FOUND error is returned.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Product, + com.google.cloud.retail.v2beta.Product.Builder, + com.google.cloud.retail.v2beta.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+     * output only fields are NOT supported. If not set, all supported fields (the
+     * fields that are neither immutable nor output only) are updated.
+     * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+     * is returned.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, a new [Product][google.cloud.retail.v2beta.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, a new [Product][google.cloud.retail.v2beta.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+     * not found, a new [Product][google.cloud.retail.v2beta.Product] will be
+     * created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + + allowMissing_ = 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.UpdateProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateProductRequest) + private static final com.google.cloud.retail.v2beta.UpdateProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateProductRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateProductRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProductRequest(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.UpdateProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequestOrBuilder.java new file mode 100644 index 00000000..fce55133 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateProductRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/product_service.proto + +package com.google.cloud.retail.v2beta; + +public interface UpdateProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The product. + */ + com.google.cloud.retail.v2beta.Product getProduct(); + /** + * + * + *
+   * Required. The product to update/create.
+   * If the caller does not have permission to update the
+   * [Product][google.cloud.retail.v2beta.Product], regardless of whether or not
+   * it exists, a PERMISSION_DENIED error is returned.
+   * If the [Product][google.cloud.retail.v2beta.Product] to update does not
+   * exist and
+   * [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing]
+   * is not set, a NOT_FOUND error is returned.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Product product = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Product][google.cloud.retail.v2beta.Product] to update. The immutable and
+   * output only fields are NOT supported. If not set, all supported fields (the
+   * fields that are neither immutable nor output only) are updated.
+   * If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
+   * is returned.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set to true, and the [Product][google.cloud.retail.v2beta.Product] is
+   * not found, a new [Product][google.cloud.retail.v2beta.Product] will be
+   * created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequest.java new file mode 100644 index 00000000..c023ba71 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequest.java @@ -0,0 +1,1081 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for UpdateServingConfig method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateServingConfigRequest} + */ +public final class UpdateServingConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateServingConfigRequest) + UpdateServingConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServingConfigRequest.newBuilder() to construct. + private UpdateServingConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServingConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateServingConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServingConfigRequest( + 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.ServingConfig.Builder subBuilder = null; + if (servingConfig_ != null) { + subBuilder = servingConfig_.toBuilder(); + } + servingConfig_ = + input.readMessage( + com.google.cloud.retail.v2beta.ServingConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(servingConfig_); + servingConfig_ = 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateServingConfigRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.ServingConfig servingConfig_; + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + @java.lang.Override + public boolean hasServingConfig() { + return servingConfig_ != null; + } + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig getServingConfig() { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder() { + return getServingConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (servingConfig_ != null) { + output.writeMessage(1, getServingConfig()); + } + 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 (servingConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getServingConfig()); + } + 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.UpdateServingConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateServingConfigRequest other = + (com.google.cloud.retail.v2beta.UpdateServingConfigRequest) obj; + + if (hasServingConfig() != other.hasServingConfig()) return false; + if (hasServingConfig()) { + if (!getServingConfig().equals(other.getServingConfig())) 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 (hasServingConfig()) { + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().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.UpdateServingConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest 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.UpdateServingConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest 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.UpdateServingConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest 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.UpdateServingConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest 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.UpdateServingConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest 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.UpdateServingConfigRequest 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.UpdateServingConfigRequest 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.UpdateServingConfigRequest 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 UpdateServingConfig method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateServingConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateServingConfigRequest) + com.google.cloud.retail.v2beta.UpdateServingConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateServingConfigRequest.class, + com.google.cloud.retail.v2beta.UpdateServingConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateServingConfigRequest.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 (servingConfigBuilder_ == null) { + servingConfig_ = null; + } else { + servingConfig_ = null; + servingConfigBuilder_ = 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.ServingConfigServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateServingConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateServingConfigRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateServingConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateServingConfigRequest build() { + com.google.cloud.retail.v2beta.UpdateServingConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateServingConfigRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateServingConfigRequest result = + new com.google.cloud.retail.v2beta.UpdateServingConfigRequest(this); + if (servingConfigBuilder_ == null) { + result.servingConfig_ = servingConfig_; + } else { + result.servingConfig_ = servingConfigBuilder_.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.UpdateServingConfigRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateServingConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateServingConfigRequest other) { + if (other == com.google.cloud.retail.v2beta.UpdateServingConfigRequest.getDefaultInstance()) + return this; + if (other.hasServingConfig()) { + mergeServingConfig(other.getServingConfig()); + } + 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.UpdateServingConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateServingConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.ServingConfig servingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + servingConfigBuilder_; + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + public boolean hasServingConfig() { + return servingConfigBuilder_ != null || servingConfig_ != null; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + public com.google.cloud.retail.v2beta.ServingConfig getServingConfig() { + if (servingConfigBuilder_ == null) { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } else { + return servingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig(com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + onChanged(); + } else { + servingConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServingConfig( + com.google.cloud.retail.v2beta.ServingConfig.Builder builderForValue) { + if (servingConfigBuilder_ == null) { + servingConfig_ = builderForValue.build(); + onChanged(); + } else { + servingConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServingConfig(com.google.cloud.retail.v2beta.ServingConfig value) { + if (servingConfigBuilder_ == null) { + if (servingConfig_ != null) { + servingConfig_ = + com.google.cloud.retail.v2beta.ServingConfig.newBuilder(servingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + servingConfig_ = value; + } + onChanged(); + } else { + servingConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServingConfig() { + if (servingConfigBuilder_ == null) { + servingConfig_ = null; + onChanged(); + } else { + servingConfig_ = null; + servingConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ServingConfig.Builder getServingConfigBuilder() { + + onChanged(); + return getServingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder() { + if (servingConfigBuilder_ != null) { + return servingConfigBuilder_.getMessageOrBuilder(); + } else { + return servingConfig_ == null + ? com.google.cloud.retail.v2beta.ServingConfig.getDefaultInstance() + : servingConfig_; + } + } + /** + * + * + *
+     * Required. The ServingConfig to update.
+     * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder> + getServingConfigFieldBuilder() { + if (servingConfigBuilder_ == null) { + servingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ServingConfig, + com.google.cloud.retail.v2beta.ServingConfig.Builder, + com.google.cloud.retail.v2beta.ServingConfigOrBuilder>( + getServingConfig(), getParentForChildren(), isClean()); + servingConfig_ = null; + } + return servingConfigBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+     * following are NOT supported:
+     * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+     * If not set, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.UpdateServingConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateServingConfigRequest) + private static final com.google.cloud.retail.v2beta.UpdateServingConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateServingConfigRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateServingConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServingConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServingConfigRequest(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.UpdateServingConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequestOrBuilder.java new file mode 100644 index 00000000..98af04b1 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateServingConfigRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/serving_config_service.proto + +package com.google.cloud.retail.v2beta; + +public interface UpdateServingConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateServingConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the servingConfig field is set. + */ + boolean hasServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The servingConfig. + */ + com.google.cloud.retail.v2beta.ServingConfig getServingConfig(); + /** + * + * + *
+   * Required. The ServingConfig to update.
+   * 
+ * + * + * .google.cloud.retail.v2beta.ServingConfig serving_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ServingConfigOrBuilder getServingConfigOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The
+   * following are NOT supported:
+   * * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name]
+   * If not set, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java new file mode 100644 index 00000000..a812613c --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java @@ -0,0 +1,6353 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * UserEvent captures all metadata information Retail API needs to know about
+ * how end users interact with customers' website.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEvent} + */ +public final class UserEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UserEvent) + UserEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEvent.newBuilder() to construct. + private UserEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEvent() { + eventType_ = ""; + visitorId_ = ""; + sessionId_ = ""; + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + attributionToken_ = ""; + productDetails_ = java.util.Collections.emptyList(); + cartId_ = ""; + searchQuery_ = ""; + filter_ = ""; + orderBy_ = ""; + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + uri_ = ""; + referrerUri_ = ""; + pageViewId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEvent( + 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(); + + eventType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + visitorId_ = s; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (eventTime_ != null) { + subBuilder = eventTime_.toBuilder(); + } + eventTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTime_); + eventTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + experimentIds_.add(s); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributionToken_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + productDetails_.add( + input.readMessage( + com.google.cloud.retail.v2beta.ProductDetail.parser(), extensionRegistry)); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + attributes_ = + com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + attributes_.getMutableMap().put(attributes__.getKey(), attributes__.getValue()); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + cartId_ = s; + break; + } + case 74: + { + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder subBuilder = null; + if (purchaseTransaction_ != null) { + subBuilder = purchaseTransaction_.toBuilder(); + } + purchaseTransaction_ = + input.readMessage( + com.google.cloud.retail.v2beta.PurchaseTransaction.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(purchaseTransaction_); + purchaseTransaction_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + searchQuery_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + pageCategories_.add(s); + break; + } + case 98: + { + com.google.cloud.retail.v2beta.UserInfo.Builder subBuilder = null; + if (userInfo_ != null) { + subBuilder = userInfo_.toBuilder(); + } + userInfo_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userInfo_); + userInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + + referrerUri_ = s; + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageViewId_ = s; + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 144: + { + offset_ = input.readInt32(); + break; + } + case 170: + { + java.lang.String s = input.readStringRequireUtf8(); + + sessionId_ = s; + break; + } + case 178: + { + com.google.cloud.retail.v2beta.CompletionDetail.Builder subBuilder = null; + if (completionDetail_ != null) { + subBuilder = completionDetail_.toBuilder(); + } + completionDetail_ = + input.readMessage( + com.google.cloud.retail.v2beta.CompletionDetail.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completionDetail_); + completionDetail_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEvent.class, + com.google.cloud.retail.v2beta.UserEvent.Builder.class); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + @java.lang.Override + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + 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(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISITOR_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object visitorId_; + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + @java.lang.Override + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + 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(); + visitorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SESSION_ID_FIELD_NUMBER = 21; + private volatile java.lang.Object sessionId_; + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + @java.lang.Override + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + 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(); + sessionId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp eventTime_; + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + @java.lang.Override + public boolean hasEventTime() { + return eventTime_ != null; + } + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEventTime() { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + return getEventTime(); + } + + public static final int EXPERIMENT_IDS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList experimentIds_; + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_; + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object attributionToken_; + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + @java.lang.Override + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + 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(); + attributionToken_ = s; + return s; + } + } + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_DETAILS_FIELD_NUMBER = 6; + private java.util.List productDetails_; + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + @java.lang.Override + public java.util.List getProductDetailsList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + @java.lang.Override + public java.util.List + getProductDetailsOrBuilderList() { + return productDetails_; + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + @java.lang.Override + public int getProductDetailsCount() { + return productDetails_.size(); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductDetail getProductDetails(int index) { + return productDetails_.get(index); + } + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ProductDetailOrBuilder getProductDetailsOrBuilder( + int index) { + return productDetails_.get(index); + } + + public static final int COMPLETION_DETAIL_FIELD_NUMBER = 22; + private com.google.cloud.retail.v2beta.CompletionDetail completionDetail_; + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + @java.lang.Override + public boolean hasCompletionDetail() { + return completionDetail_ != null; + } + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDetail getCompletionDetail() { + return completionDetail_ == null + ? com.google.cloud.retail.v2beta.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { + return getCompletionDetail(); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 7; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.retail.v2beta.CustomAttribute.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CART_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object cartId_; + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + @java.lang.Override + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + 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(); + cartId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PURCHASE_TRANSACTION_FIELD_NUMBER = 9; + private com.google.cloud.retail.v2beta.PurchaseTransaction purchaseTransaction_; + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + @java.lang.Override + public boolean hasPurchaseTransaction() { + return purchaseTransaction_ != null; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PurchaseTransaction getPurchaseTransaction() { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2beta.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + return getPurchaseTransaction(); + } + + public static final int SEARCH_QUERY_FIELD_NUMBER = 10; + private volatile java.lang.Object searchQuery_; + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + @java.lang.Override + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + 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(); + searchQuery_ = s; + return s; + } + } + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 16; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 17; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 18; + private int offset_; + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset]
+   * for definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int PAGE_CATEGORIES_FIELD_NUMBER = 11; + private com.google.protobuf.LazyStringList pageCategories_; + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_; + } + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+   * 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(index); + } + + public static final int USER_INFO_FIELD_NUMBER = 12; + private com.google.cloud.retail.v2beta.UserInfo userInfo_; + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder() { + return getUserInfo(); + } + + public static final int URI_FIELD_NUMBER = 13; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERRER_URI_FIELD_NUMBER = 14; + private volatile java.lang.Object referrerUri_; + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + @java.lang.Override + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + 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(); + referrerUri_ = s; + return s; + } + } + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_VIEW_ID_FIELD_NUMBER = 15; + private volatile java.lang.Object pageViewId_; + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + @java.lang.Override + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + 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(); + pageViewId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = 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(eventType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, visitorId_); + } + if (eventTime_ != null) { + output.writeMessage(3, getEventTime()); + } + for (int i = 0; i < experimentIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, experimentIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); + } + for (int i = 0; i < productDetails_.size(); i++) { + output.writeMessage(6, productDetails_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 7); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, cartId_); + } + if (purchaseTransaction_ != null) { + output.writeMessage(9, getPurchaseTransaction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, searchQuery_); + } + for (int i = 0; i < pageCategories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, pageCategories_.getRaw(i)); + } + if (userInfo_ != null) { + output.writeMessage(12, getUserInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, referrerUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, pageViewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, orderBy_); + } + if (offset_ != 0) { + output.writeInt32(18, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 21, sessionId_); + } + if (completionDetail_ != null) { + output.writeMessage(22, getCompletionDetail()); + } + 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(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, visitorId_); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEventTime()); + } + { + int dataSize = 0; + for (int i = 0; i < experimentIds_.size(); i++) { + dataSize += computeStringSizeNoTag(experimentIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getExperimentIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); + } + for (int i = 0; i < productDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, productDetails_.get(i)); + } + for (java.util.Map.Entry + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, attributes__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, cartId_); + } + if (purchaseTransaction_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPurchaseTransaction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, searchQuery_); + } + { + int dataSize = 0; + for (int i = 0; i < pageCategories_.size(); i++) { + dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); + } + size += dataSize; + size += 1 * getPageCategoriesList().size(); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUserInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, referrerUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, pageViewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, orderBy_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, sessionId_); + } + if (completionDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCompletionDetail()); + } + 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.UserEvent)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UserEvent other = (com.google.cloud.retail.v2beta.UserEvent) obj; + + if (!getEventType().equals(other.getEventType())) return false; + if (!getVisitorId().equals(other.getVisitorId())) return false; + if (!getSessionId().equals(other.getSessionId())) return false; + if (hasEventTime() != other.hasEventTime()) return false; + if (hasEventTime()) { + if (!getEventTime().equals(other.getEventTime())) return false; + } + if (!getExperimentIdsList().equals(other.getExperimentIdsList())) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; + if (hasCompletionDetail() != other.hasCompletionDetail()) return false; + if (hasCompletionDetail()) { + if (!getCompletionDetail().equals(other.getCompletionDetail())) return false; + } + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (!getCartId().equals(other.getCartId())) return false; + if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; + if (hasPurchaseTransaction()) { + if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) return false; + } + if (!getSearchQuery().equals(other.getSearchQuery())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (!getUri().equals(other.getUri())) return false; + if (!getReferrerUri().equals(other.getReferrerUri())) return false; + if (!getPageViewId().equals(other.getPageViewId())) 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) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getVisitorId().hashCode(); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + if (getExperimentIdsCount() > 0) { + hash = (37 * hash) + EXPERIMENT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getExperimentIdsList().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + if (getProductDetailsCount() > 0) { + hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getProductDetailsList().hashCode(); + } + if (hasCompletionDetail()) { + hash = (37 * hash) + COMPLETION_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getCompletionDetail().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + CART_ID_FIELD_NUMBER; + hash = (53 * hash) + getCartId().hashCode(); + if (hasPurchaseTransaction()) { + hash = (37 * hash) + PURCHASE_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getPurchaseTransaction().hashCode(); + } + hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSearchQuery().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + if (getPageCategoriesCount() > 0) { + hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getPageCategoriesList().hashCode(); + } + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + REFERRER_URI_FIELD_NUMBER; + hash = (53 * hash) + getReferrerUri().hashCode(); + hash = (37 * hash) + PAGE_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getPageViewId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UserEvent parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEvent 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.UserEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEvent 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.UserEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEvent 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.UserEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEvent 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.UserEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEvent 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.UserEvent 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.UserEvent 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.UserEvent 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; + } + /** + * + * + *
+   * UserEvent captures all metadata information Retail API needs to know about
+   * how end users interact with customers' website.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UserEvent) + com.google.cloud.retail.v2beta.UserEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEvent.class, + com.google.cloud.retail.v2beta.UserEvent.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UserEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProductDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + eventType_ = ""; + + visitorId_ = ""; + + sessionId_ = ""; + + if (eventTimeBuilder_ == null) { + eventTime_ = null; + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + attributionToken_ = ""; + + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + productDetailsBuilder_.clear(); + } + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } + internalGetMutableAttributes().clear(); + cartId_ = ""; + + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + searchQuery_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + offset_ = 0; + + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + if (userInfoBuilder_ == null) { + userInfo_ = null; + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + uri_ = ""; + + referrerUri_ = ""; + + pageViewId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventProto + .internal_static_google_cloud_retail_v2beta_UserEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent build() { + com.google.cloud.retail.v2beta.UserEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent buildPartial() { + com.google.cloud.retail.v2beta.UserEvent result = + new com.google.cloud.retail.v2beta.UserEvent(this); + int from_bitField0_ = bitField0_; + result.eventType_ = eventType_; + result.visitorId_ = visitorId_; + result.sessionId_ = sessionId_; + if (eventTimeBuilder_ == null) { + result.eventTime_ = eventTime_; + } else { + result.eventTime_ = eventTimeBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = experimentIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.experimentIds_ = experimentIds_; + result.attributionToken_ = attributionToken_; + if (productDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.productDetails_ = productDetails_; + } else { + result.productDetails_ = productDetailsBuilder_.build(); + } + if (completionDetailBuilder_ == null) { + result.completionDetail_ = completionDetail_; + } else { + result.completionDetail_ = completionDetailBuilder_.build(); + } + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.cartId_ = cartId_; + if (purchaseTransactionBuilder_ == null) { + result.purchaseTransaction_ = purchaseTransaction_; + } else { + result.purchaseTransaction_ = purchaseTransactionBuilder_.build(); + } + result.searchQuery_ = searchQuery_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + result.offset_ = offset_; + if (((bitField0_ & 0x00000008) != 0)) { + pageCategories_ = pageCategories_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.pageCategories_ = pageCategories_; + if (userInfoBuilder_ == null) { + result.userInfo_ = userInfo_; + } else { + result.userInfo_ = userInfoBuilder_.build(); + } + result.uri_ = uri_; + result.referrerUri_ = referrerUri_; + result.pageViewId_ = pageViewId_; + 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.UserEvent) { + return mergeFrom((com.google.cloud.retail.v2beta.UserEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UserEvent other) { + if (other == com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance()) return this; + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (!other.getVisitorId().isEmpty()) { + visitorId_ = other.visitorId_; + onChanged(); + } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + onChanged(); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (!other.experimentIds_.isEmpty()) { + if (experimentIds_.isEmpty()) { + experimentIds_ = other.experimentIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExperimentIdsIsMutable(); + experimentIds_.addAll(other.experimentIds_); + } + onChanged(); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + onChanged(); + } + if (productDetailsBuilder_ == null) { + if (!other.productDetails_.isEmpty()) { + if (productDetails_.isEmpty()) { + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureProductDetailsIsMutable(); + productDetails_.addAll(other.productDetails_); + } + onChanged(); + } + } else { + if (!other.productDetails_.isEmpty()) { + if (productDetailsBuilder_.isEmpty()) { + productDetailsBuilder_.dispose(); + productDetailsBuilder_ = null; + productDetails_ = other.productDetails_; + bitField0_ = (bitField0_ & ~0x00000002); + productDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductDetailsFieldBuilder() + : null; + } else { + productDetailsBuilder_.addAllMessages(other.productDetails_); + } + } + } + if (other.hasCompletionDetail()) { + mergeCompletionDetail(other.getCompletionDetail()); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + if (!other.getCartId().isEmpty()) { + cartId_ = other.cartId_; + onChanged(); + } + if (other.hasPurchaseTransaction()) { + mergePurchaseTransaction(other.getPurchaseTransaction()); + } + if (!other.getSearchQuery().isEmpty()) { + searchQuery_ = other.searchQuery_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.pageCategories_.isEmpty()) { + if (pageCategories_.isEmpty()) { + pageCategories_ = other.pageCategories_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePageCategoriesIsMutable(); + pageCategories_.addAll(other.pageCategories_); + } + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getReferrerUri().isEmpty()) { + referrerUri_ = other.referrerUri_; + onChanged(); + } + if (!other.getPageViewId().isEmpty()) { + pageViewId_ = other.pageViewId_; + 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.UserEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.UserEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     * * `add-to-cart`: Products being added to cart.
+     * * `category-page-view`: Special pages such as sale or promotion pages
+     *   viewed.
+     * * `detail-page-view`: Products detail page viewed.
+     * * `home-page-view`: Homepage viewed.
+     * * `promotion-offered`: Promotion is offered to a user.
+     * * `promotion-not-offered`: Promotion is not offered to a user.
+     * * `purchase-complete`: User finishing a purchase.
+     * * `search`: Product search.
+     * * `shopping-cart-page-view`: User viewing a shopping cart.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private java.lang.Object visitorId_ = ""; + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + public java.lang.String getVisitorId() { + java.lang.Object ref = visitorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + public com.google.protobuf.ByteString getVisitorIdBytes() { + java.lang.Object ref = visitorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + visitorId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearVisitorId() { + + visitorId_ = getDefaultInstance().getVisitorId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A unique identifier for tracking visitors.
+     * For example, this could be implemented with an HTTP cookie, which should be
+     * able to uniquely identify a visitor on a single device. This unique
+     * identifier should not change if the visitor log in/out of the website.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * The field should not contain PII or user-data. We recommend to use Google
+     * Analystics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for visitorId to set. + * @return This builder for chaining. + */ + public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + visitorId_ = value; + onChanged(); + return this; + } + + private java.lang.Object sessionId_ = ""; + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + public java.lang.String getSessionId() { + java.lang.Object ref = sessionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sessionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + public com.google.protobuf.ByteString getSessionIdBytes() { + java.lang.Object ref = sessionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sessionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sessionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + + sessionId_ = getDefaultInstance().getSessionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking a visitor session with a length limit of
+     * 128 bytes. A session is an aggregation of an end user behavior in a time
+     * span.
+     * A general guideline to populate the sesion_id:
+     * 1. If user has no activity for 30 min, a new session_id should be assigned.
+     * 2. The session_id should be unique across users, suggest use uuid or add
+     * visitor_id as prefix.
+     * 
+ * + * string session_id = 21; + * + * @param value The bytes for sessionId to set. + * @return This builder for chaining. + */ + public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sessionId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp eventTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder setEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTime_ = value; + onChanged(); + } else { + eventTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (eventTimeBuilder_ == null) { + eventTime_ = builderForValue.build(); + onChanged(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder mergeEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (eventTime_ != null) { + eventTime_ = + com.google.protobuf.Timestamp.newBuilder(eventTime_).mergeFrom(value).buildPartial(); + } else { + eventTime_ = value; + } + onChanged(); + } else { + eventTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder clearEventTime() { + if (eventTimeBuilder_ == null) { + eventTime_ = null; + onChanged(); + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + if (eventTimeBuilder_ != null) { + return eventTimeBuilder_.getMessageOrBuilder(); + } else { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEventTimeFieldBuilder() { + if (eventTimeBuilder_ == null) { + eventTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEventTime(), getParentForChildren(), isClean()); + eventTime_ = null; + } + return eventTimeBuilder_; + } + + private com.google.protobuf.LazyStringList experimentIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExperimentIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + experimentIds_ = new com.google.protobuf.LazyStringArrayList(experimentIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + public com.google.protobuf.ProtocolStringList getExperimentIdsList() { + return experimentIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + public int getExperimentIdsCount() { + return experimentIds_.size(); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + public java.lang.String getExperimentIds(int index) { + return experimentIds_.get(index); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { + return experimentIds_.getByteString(index); + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index to set the value at. + * @param value The experimentIds to set. + * @return This builder for chaining. + */ + public Builder setExperimentIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param value The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param values The experimentIds to add. + * @return This builder for chaining. + */ + public Builder addAllExperimentIds(java.lang.Iterable values) { + ensureExperimentIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, experimentIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearExperimentIds() { + experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of identifiers for the independent experiment groups this user event
+     * belongs to. This is used to distinguish between user events associated with
+     * different experiment setups (e.g. using Retail API, using different
+     * recommendation models).
+     * 
+ * + * repeated string experiment_ids = 4; + * + * @param value The bytes of the experimentIds to add. + * @return This builder for chaining. + */ + public Builder addExperimentIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExperimentIdsIsMutable(); + experimentIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + public java.lang.String getAttributionToken() { + java.lang.Object ref = attributionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributionToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + + attributionToken_ = getDefaultInstance().getAttributionToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     * The value must be a valid
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * for user events that are the result of
+     * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+     * The value must be a valid
+     * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+     * for user events that are the result of
+     * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+     * This token enables us to accurately attribute page view or purchase back to
+     * the event and the particular predict response containing this
+     * clicked/purchased product. If user clicks on product K in the
+     * recommendation results, pass
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 5; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributionToken_ = value; + onChanged(); + return this; + } + + private java.util.List productDetails_ = + java.util.Collections.emptyList(); + + private void ensureProductDetailsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + productDetails_ = + new java.util.ArrayList(productDetails_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductDetail, + com.google.cloud.retail.v2beta.ProductDetail.Builder, + com.google.cloud.retail.v2beta.ProductDetailOrBuilder> + productDetailsBuilder_; + + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public java.util.List getProductDetailsList() { + if (productDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productDetails_); + } else { + return productDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public int getProductDetailsCount() { + if (productDetailsBuilder_ == null) { + return productDetails_.size(); + } else { + return productDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2beta.ProductDetail getProductDetails(int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder setProductDetails( + int index, com.google.cloud.retail.v2beta.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.set(index, value); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder setProductDetails( + int index, com.google.cloud.retail.v2beta.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder addProductDetails(com.google.cloud.retail.v2beta.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + int index, com.google.cloud.retail.v2beta.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(index, value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + com.google.cloud.retail.v2beta.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder addProductDetails( + int index, com.google.cloud.retail.v2beta.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder addAllProductDetails( + java.lang.Iterable values) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); + onChanged(); + } else { + productDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder clearProductDetails() { + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + productDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public Builder removeProductDetails(int index) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.remove(index); + onChanged(); + } else { + productDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2beta.ProductDetail.Builder getProductDetailsBuilder( + int index) { + return getProductDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2beta.ProductDetailOrBuilder getProductDetailsOrBuilder( + int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public java.util.List + getProductDetailsOrBuilderList() { + if (productDetailsBuilder_ != null) { + return productDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productDetails_); + } + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2beta.ProductDetail.Builder addProductDetailsBuilder() { + return getProductDetailsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public com.google.cloud.retail.v2beta.ProductDetail.Builder addProductDetailsBuilder( + int index) { + return getProductDetailsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The main product details related to the event.
+     * This field is required for the following event types:
+     * * `add-to-cart`
+     * * `detail-page-view`
+     * * `purchase-complete`
+     * * `search`
+     * In a `search` event, this field represents the products returned to the end
+     * user on the current page (the end user may have not finished browsing the
+     * whole page yet). When a new page is returned to the end user, after
+     * pagination/filtering/ordering even for the same query, a new `search` event
+     * with different
+     * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+     * desired. The end user may have not finished browsing the whole page yet.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + public java.util.List + getProductDetailsBuilderList() { + return getProductDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductDetail, + com.google.cloud.retail.v2beta.ProductDetail.Builder, + com.google.cloud.retail.v2beta.ProductDetailOrBuilder> + getProductDetailsFieldBuilder() { + if (productDetailsBuilder_ == null) { + productDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.ProductDetail, + com.google.cloud.retail.v2beta.ProductDetail.Builder, + com.google.cloud.retail.v2beta.ProductDetailOrBuilder>( + productDetails_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + productDetails_ = null; + } + return productDetailsBuilder_; + } + + private com.google.cloud.retail.v2beta.CompletionDetail completionDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDetail, + com.google.cloud.retail.v2beta.CompletionDetail.Builder, + com.google.cloud.retail.v2beta.CompletionDetailOrBuilder> + completionDetailBuilder_; + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + public boolean hasCompletionDetail() { + return completionDetailBuilder_ != null || completionDetail_ != null; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + public com.google.cloud.retail.v2beta.CompletionDetail getCompletionDetail() { + if (completionDetailBuilder_ == null) { + return completionDetail_ == null + ? com.google.cloud.retail.v2beta.CompletionDetail.getDefaultInstance() + : completionDetail_; + } else { + return completionDetailBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail(com.google.cloud.retail.v2beta.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionDetail_ = value; + onChanged(); + } else { + completionDetailBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public Builder setCompletionDetail( + com.google.cloud.retail.v2beta.CompletionDetail.Builder builderForValue) { + if (completionDetailBuilder_ == null) { + completionDetail_ = builderForValue.build(); + onChanged(); + } else { + completionDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public Builder mergeCompletionDetail(com.google.cloud.retail.v2beta.CompletionDetail value) { + if (completionDetailBuilder_ == null) { + if (completionDetail_ != null) { + completionDetail_ = + com.google.cloud.retail.v2beta.CompletionDetail.newBuilder(completionDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + completionDetail_ = value; + } + onChanged(); + } else { + completionDetailBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public Builder clearCompletionDetail() { + if (completionDetailBuilder_ == null) { + completionDetail_ = null; + onChanged(); + } else { + completionDetail_ = null; + completionDetailBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2beta.CompletionDetail.Builder getCompletionDetailBuilder() { + + onChanged(); + return getCompletionDetailFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + public com.google.cloud.retail.v2beta.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { + if (completionDetailBuilder_ != null) { + return completionDetailBuilder_.getMessageOrBuilder(); + } else { + return completionDetail_ == null + ? com.google.cloud.retail.v2beta.CompletionDetail.getDefaultInstance() + : completionDetail_; + } + } + /** + * + * + *
+     * The main auto-completion details related to the event.
+     * This field should be set for `search` event when autocomplete function is
+     * enabled and the user clicks a suggestion for search.
+     * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDetail, + com.google.cloud.retail.v2beta.CompletionDetail.Builder, + com.google.cloud.retail.v2beta.CompletionDetailOrBuilder> + getCompletionDetailFieldBuilder() { + if (completionDetailBuilder_ == null) { + completionDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.CompletionDetail, + com.google.cloud.retail.v2beta.CompletionDetail.Builder, + com.google.cloud.retail.v2beta.CompletionDetailOrBuilder>( + getCompletionDetail(), getParentForChildren(), isClean()); + completionDetail_ = null; + } + return completionDetailBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.retail.v2beta.CustomAttribute> + internalGetMutableAttributes() { + onChanged(); + ; + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public boolean containsAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAttributes().getMap().containsKey(key); + } + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAttributes() { + return getAttributesMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + public Builder removeAttributes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAttributes().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.retail.v2beta.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAttributes().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * If you provide custom attributes for ingested user events, also include
+     * them in the user events that you associate with prediction requests. Custom
+     * attribute formatting must be consistent between imported events and events
+     * provided with prediction requests. This lets the Retail API use
+     * those custom attributes when training models and serving predictions, which
+     * helps improve recommendation quality.
+     * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+     * error is returned:
+     * * The key must be a UTF-8 encoded string with a length limit of 5,000
+     *   characters.
+     * * For text attributes, at most 400 values are allowed. Empty values are not
+     *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+     *   256 characters.
+     * * For number attributes, at most 400 values are allowed.
+     * For product recommendations, an example of extra user information is
+     * traffic_channel, which is how a user arrives at the site. Users can arrive
+     * at the site by coming to the site directly, coming through Google
+     * search, or in other ways.
+     * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object cartId_ = ""; + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + public java.lang.String getCartId() { + java.lang.Object ref = cartId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cartId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + public com.google.protobuf.ByteString getCartIdBytes() { + java.lang.Object ref = cartId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cartId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @param value The cartId to set. + * @return This builder for chaining. + */ + public Builder setCartId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cartId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearCartId() { + + cartId_ = getDefaultInstance().getCartId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID or name of the associated shopping cart. This ID is used
+     * to associate multiple items added or present in the cart before purchase.
+     * This can only be set for `add-to-cart`, `purchase-complete`, or
+     * `shopping-cart-page-view` events.
+     * 
+ * + * string cart_id = 8; + * + * @param value The bytes for cartId to set. + * @return This builder for chaining. + */ + public Builder setCartIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cartId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.PurchaseTransaction purchaseTransaction_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PurchaseTransaction, + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder, + com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder> + purchaseTransactionBuilder_; + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + public boolean hasPurchaseTransaction() { + return purchaseTransactionBuilder_ != null || purchaseTransaction_ != null; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + public com.google.cloud.retail.v2beta.PurchaseTransaction getPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2beta.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } else { + return purchaseTransactionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public Builder setPurchaseTransaction( + com.google.cloud.retail.v2beta.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + purchaseTransaction_ = value; + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public Builder setPurchaseTransaction( + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder builderForValue) { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = builderForValue.build(); + onChanged(); + } else { + purchaseTransactionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public Builder mergePurchaseTransaction( + com.google.cloud.retail.v2beta.PurchaseTransaction value) { + if (purchaseTransactionBuilder_ == null) { + if (purchaseTransaction_ != null) { + purchaseTransaction_ = + com.google.cloud.retail.v2beta.PurchaseTransaction.newBuilder(purchaseTransaction_) + .mergeFrom(value) + .buildPartial(); + } else { + purchaseTransaction_ = value; + } + onChanged(); + } else { + purchaseTransactionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public Builder clearPurchaseTransaction() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransaction_ = null; + onChanged(); + } else { + purchaseTransaction_ = null; + purchaseTransactionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public com.google.cloud.retail.v2beta.PurchaseTransaction.Builder + getPurchaseTransactionBuilder() { + + onChanged(); + return getPurchaseTransactionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + public com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder + getPurchaseTransactionOrBuilder() { + if (purchaseTransactionBuilder_ != null) { + return purchaseTransactionBuilder_.getMessageOrBuilder(); + } else { + return purchaseTransaction_ == null + ? com.google.cloud.retail.v2beta.PurchaseTransaction.getDefaultInstance() + : purchaseTransaction_; + } + } + /** + * + * + *
+     * A transaction represents the entire purchase transaction.
+     * Required for `purchase-complete` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PurchaseTransaction, + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder, + com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder> + getPurchaseTransactionFieldBuilder() { + if (purchaseTransactionBuilder_ == null) { + purchaseTransactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.PurchaseTransaction, + com.google.cloud.retail.v2beta.PurchaseTransaction.Builder, + com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder>( + getPurchaseTransaction(), getParentForChildren(), isClean()); + purchaseTransaction_ = null; + } + return purchaseTransactionBuilder_; + } + + private java.lang.Object searchQuery_ = ""; + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + public java.lang.String getSearchQuery() { + java.lang.Object ref = searchQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + public com.google.protobuf.ByteString getSearchQueryBytes() { + java.lang.Object ref = searchQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + searchQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @param value The searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + searchQuery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @return This builder for chaining. + */ + public Builder clearSearchQuery() { + + searchQuery_ = getDefaultInstance().getSearchQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+     * for definition.
+     * The value must be a UTF-8 encoded string with a length limit of 5,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string search_query = 10; + * + * @param value The bytes for searchQuery to set. + * @return This builder for chaining. + */ + public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + searchQuery_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the products being filtered.
+     * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string filter = 16; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned.
+     * See
+     * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+     * for definition and syntax.
+     * The value must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string order_by = 17; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private int offset_; + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer that specifies the current offset for pagination (the 0-indexed
+     * starting location, amongst the products deemed by the API as relevant).
+     * See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset]
+     * for definition.
+     * If this field is negative, an INVALID_ARGUMENT is returned.
+     * This can only be set for `search` events. Other event types should not set
+     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * int32 offset = 18; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList pageCategories_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePageCategoriesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + public com.google.protobuf.ProtocolStringList getPageCategoriesList() { + return pageCategories_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + public int getPageCategoriesCount() { + return pageCategories_.size(); + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + public java.lang.String getPageCategories(int index) { + return pageCategories_.get(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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { + return pageCategories_.getByteString(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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param index The index to set the value at. + * @param value The pageCategories to set. + * @return This builder for chaining. + */ + public Builder setPageCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param value The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param values The pageCategories to add. + * @return This builder for chaining. + */ + public Builder addAllPageCategories(java.lang.Iterable values) { + ensurePageCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @return This builder for chaining. + */ + public Builder clearPageCategories() { + pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * other character(s).
+     * Category pages include special pages such as sales or promotions. For
+     * instance, a special sale page may have the category hierarchy:
+     * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+     * Required for `category-page-view` events. At least one of
+     * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+     * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+     * required for `search` events. Other event types should not set this field.
+     * Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * repeated string page_categories = 11; + * + * @param value The bytes of the pageCategories to add. + * @return This builder for chaining. + */ + public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePageCategoriesIsMutable(); + pageCategories_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return userInfoBuilder_ != null || userInfo_ != null; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return The userInfo. + */ + public com.google.cloud.retail.v2beta.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public Builder setUserInfo(com.google.cloud.retail.v2beta.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + onChanged(); + } else { + userInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public Builder setUserInfo(com.google.cloud.retail.v2beta.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + onChanged(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public Builder mergeUserInfo(com.google.cloud.retail.v2beta.UserInfo value) { + if (userInfoBuilder_ == null) { + if (userInfo_ != null) { + userInfo_ = + com.google.cloud.retail.v2beta.UserInfo.newBuilder(userInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + userInfo_ = value; + } + onChanged(); + } else { + userInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public Builder clearUserInfo() { + if (userInfoBuilder_ == null) { + userInfo_ = null; + onChanged(); + } else { + userInfo_ = null; + userInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public com.google.cloud.retail.v2beta.UserInfo.Builder getUserInfoBuilder() { + + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + public com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * User information.
+     * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserInfo, + com.google.cloud.retail.v2beta.UserInfo.Builder, + com.google.cloud.retail.v2beta.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Complete URL (window.location.href) of the user's current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically. Maximum length 5,000
+     * characters.
+     * 
+ * + * string uri = 13; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object referrerUri_ = ""; + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + public java.lang.String getReferrerUri() { + java.lang.Object ref = referrerUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referrerUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + public com.google.protobuf.ByteString getReferrerUriBytes() { + java.lang.Object ref = referrerUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referrerUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @param value The referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referrerUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @return This builder for chaining. + */ + public Builder clearReferrerUri() { + + referrerUri_ = getDefaultInstance().getReferrerUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The referrer URL of the current page.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string referrer_uri = 14; + * + * @param value The bytes for referrerUri to set. + * @return This builder for chaining. + */ + public Builder setReferrerUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referrerUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageViewId_ = ""; + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + public java.lang.String getPageViewId() { + java.lang.Object ref = pageViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + public com.google.protobuf.ByteString getPageViewIdBytes() { + java.lang.Object ref = pageViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @param value The pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageViewId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @return This builder for chaining. + */ + public Builder clearPageViewId() { + + pageViewId_ = getDefaultInstance().getPageViewId(); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique ID of a web page view.
+     * This should be kept the same for all user events triggered from the same
+     * pageview. For example, an item detail page view could trigger multiple
+     * events as the user is browsing the page. The `pageViewId` property should
+     * be kept the same for all these events so that they can be grouped together
+     * properly.
+     * When using the client side event reporting with JavaScript pixel and Google
+     * Tag Manager, this value is filled in automatically.
+     * 
+ * + * string page_view_id = 15; + * + * @param value The bytes for pageViewId to set. + * @return This builder for chaining. + */ + public Builder setPageViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageViewId_ = 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.UserEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UserEvent) + private static final com.google.cloud.retail.v2beta.UserEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UserEvent(); + } + + public static com.google.cloud.retail.v2beta.UserEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEvent(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.UserEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummary.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummary.java new file mode 100644 index 00000000..71c2f42b --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummary.java @@ -0,0 +1,645 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * A summary of import result. The UserEventImportSummary summarizes
+ * the import status for user events.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventImportSummary} + */ +public final class UserEventImportSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UserEventImportSummary) + UserEventImportSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventImportSummary.newBuilder() to construct. + private UserEventImportSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventImportSummary() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventImportSummary(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventImportSummary( + 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 8: + { + joinedEventsCount_ = input.readInt64(); + break; + } + case 16: + { + unjoinedEventsCount_ = input.readInt64(); + 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventImportSummary.class, + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder.class); + } + + public static final int JOINED_EVENTS_COUNT_FIELD_NUMBER = 1; + private long joinedEventsCount_; + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + + public static final int UNJOINED_EVENTS_COUNT_FIELD_NUMBER = 2; + private long unjoinedEventsCount_; + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + @java.lang.Override + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + + 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 (joinedEventsCount_ != 0L) { + output.writeInt64(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + output.writeInt64(2, unjoinedEventsCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (joinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, unjoinedEventsCount_); + } + 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.UserEventImportSummary)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UserEventImportSummary other = + (com.google.cloud.retail.v2beta.UserEventImportSummary) obj; + + if (getJoinedEventsCount() != other.getJoinedEventsCount()) return false; + if (getUnjoinedEventsCount() != other.getUnjoinedEventsCount()) 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) + JOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getJoinedEventsCount()); + hash = (37 * hash) + UNJOINED_EVENTS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUnjoinedEventsCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary 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.UserEventImportSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary 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.UserEventImportSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary 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.UserEventImportSummary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary 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.UserEventImportSummary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary 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.UserEventImportSummary 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.UserEventImportSummary 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.UserEventImportSummary 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; + } + /** + * + * + *
+   * A summary of import result. The UserEventImportSummary summarizes
+   * the import status for user events.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventImportSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UserEventImportSummary) + com.google.cloud.retail.v2beta.UserEventImportSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventImportSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventImportSummary.class, + com.google.cloud.retail.v2beta.UserEventImportSummary.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UserEventImportSummary.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(); + joinedEventsCount_ = 0L; + + unjoinedEventsCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventImportSummary_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventImportSummary getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UserEventImportSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventImportSummary build() { + com.google.cloud.retail.v2beta.UserEventImportSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventImportSummary buildPartial() { + com.google.cloud.retail.v2beta.UserEventImportSummary result = + new com.google.cloud.retail.v2beta.UserEventImportSummary(this); + result.joinedEventsCount_ = joinedEventsCount_; + result.unjoinedEventsCount_ = unjoinedEventsCount_; + 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.UserEventImportSummary) { + return mergeFrom((com.google.cloud.retail.v2beta.UserEventImportSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UserEventImportSummary other) { + if (other == com.google.cloud.retail.v2beta.UserEventImportSummary.getDefaultInstance()) + return this; + if (other.getJoinedEventsCount() != 0L) { + setJoinedEventsCount(other.getJoinedEventsCount()); + } + if (other.getUnjoinedEventsCount() != 0L) { + setUnjoinedEventsCount(other.getUnjoinedEventsCount()); + } + 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.UserEventImportSummary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UserEventImportSummary) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long joinedEventsCount_; + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @param value The joinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setJoinedEventsCount(long value) { + + joinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported with complete existing catalog information.
+     * 
+ * + * int64 joined_events_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearJoinedEventsCount() { + + joinedEventsCount_ = 0L; + onChanged(); + return this; + } + + private long unjoinedEventsCount_; + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + @java.lang.Override + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @param value The unjoinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setUnjoinedEventsCount(long value) { + + unjoinedEventsCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported, but with catalog information not found
+     * in the imported catalog.
+     * 
+ * + * int64 unjoined_events_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnjoinedEventsCount() { + + unjoinedEventsCount_ = 0L; + 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.UserEventImportSummary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UserEventImportSummary) + private static final com.google.cloud.retail.v2beta.UserEventImportSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UserEventImportSummary(); + } + + public static com.google.cloud.retail.v2beta.UserEventImportSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventImportSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventImportSummary(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.UserEventImportSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummaryOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummaryOrBuilder.java new file mode 100644 index 00000000..82fb90f6 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventImportSummaryOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface UserEventImportSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UserEventImportSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Count of user events imported with complete existing catalog information.
+   * 
+ * + * int64 joined_events_count = 1; + * + * @return The joinedEventsCount. + */ + long getJoinedEventsCount(); + + /** + * + * + *
+   * Count of user events imported, but with catalog information not found
+   * in the imported catalog.
+   * 
+ * + * int64 unjoined_events_count = 2; + * + * @return The unjoinedEventsCount. + */ + long getUnjoinedEventsCount(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSource.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSource.java new file mode 100644 index 00000000..f6e20c7f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSource.java @@ -0,0 +1,998 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The inline source for the input config for ImportUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventInlineSource} + */ +public final class UserEventInlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UserEventInlineSource) + UserEventInlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventInlineSource.newBuilder() to construct. + private UserEventInlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventInlineSource() { + userEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventInlineSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventInlineSource( + 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)) { + userEvents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + userEvents_.add( + input.readMessage( + com.google.cloud.retail.v2beta.UserEvent.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)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventInlineSource.class, + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder.class); + } + + public static final int USER_EVENTS_FIELD_NUMBER = 1; + private java.util.List userEvents_; + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getUserEventsList() { + return userEvents_; + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getUserEventsOrBuilderList() { + return userEvents_; + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getUserEventsCount() { + return userEvents_.size(); + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent getUserEvents(int index) { + return userEvents_.get(index); + } + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventsOrBuilder(int index) { + return userEvents_.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 { + for (int i = 0; i < userEvents_.size(); i++) { + output.writeMessage(1, userEvents_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < userEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, userEvents_.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.UserEventInlineSource)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UserEventInlineSource other = + (com.google.cloud.retail.v2beta.UserEventInlineSource) obj; + + if (!getUserEventsList().equals(other.getUserEventsList())) 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 (getUserEventsCount() > 0) { + hash = (37 * hash) + USER_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource 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.UserEventInlineSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource 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.UserEventInlineSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource 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.UserEventInlineSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource 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.UserEventInlineSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource 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.UserEventInlineSource 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.UserEventInlineSource 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.UserEventInlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The inline source for the input config for ImportUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventInlineSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UserEventInlineSource) + com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventInlineSource.class, + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UserEventInlineSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + userEventsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSource getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSource build() { + com.google.cloud.retail.v2beta.UserEventInlineSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSource buildPartial() { + com.google.cloud.retail.v2beta.UserEventInlineSource result = + new com.google.cloud.retail.v2beta.UserEventInlineSource(this); + int from_bitField0_ = bitField0_; + if (userEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEvents_ = userEvents_; + } else { + result.userEvents_ = userEventsBuilder_.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.UserEventInlineSource) { + return mergeFrom((com.google.cloud.retail.v2beta.UserEventInlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UserEventInlineSource other) { + if (other == com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance()) + return this; + if (userEventsBuilder_ == null) { + if (!other.userEvents_.isEmpty()) { + if (userEvents_.isEmpty()) { + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUserEventsIsMutable(); + userEvents_.addAll(other.userEvents_); + } + onChanged(); + } + } else { + if (!other.userEvents_.isEmpty()) { + if (userEventsBuilder_.isEmpty()) { + userEventsBuilder_.dispose(); + userEventsBuilder_ = null; + userEvents_ = other.userEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + userEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUserEventsFieldBuilder() + : null; + } else { + userEventsBuilder_.addAllMessages(other.userEvents_); + } + } + } + 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.UserEventInlineSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UserEventInlineSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List userEvents_ = + java.util.Collections.emptyList(); + + private void ensureUserEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + userEvents_ = + new java.util.ArrayList(userEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + userEventsBuilder_; + + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getUserEventsList() { + if (userEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(userEvents_); + } else { + return userEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getUserEventsCount() { + if (userEventsBuilder_ == null) { + return userEvents_.size(); + } else { + return userEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent getUserEvents(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents(int index, com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.set(index, value); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents( + int index, com.google.cloud.retail.v2beta.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(value); + onChanged(); + } else { + userEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(int index, com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUserEventsIsMutable(); + userEvents_.add(index, value); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(com.google.cloud.retail.v2beta.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + int index, com.google.cloud.retail.v2beta.UserEvent.Builder builderForValue) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + userEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllUserEvents( + java.lang.Iterable values) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, userEvents_); + onChanged(); + } else { + userEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvents() { + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + userEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeUserEvents(int index) { + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.remove(index); + onChanged(); + } else { + userEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent.Builder getUserEventsBuilder(int index) { + return getUserEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventsOrBuilder(int index) { + if (userEventsBuilder_ == null) { + return userEvents_.get(index); + } else { + return userEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getUserEventsOrBuilderList() { + if (userEventsBuilder_ != null) { + return userEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(userEvents_); + } + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent.Builder addUserEventsBuilder() { + return getUserEventsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent.Builder addUserEventsBuilder(int index) { + return getUserEventsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getUserEventsBuilderList() { + return getUserEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + getUserEventsFieldBuilder() { + if (userEventsBuilder_ == null) { + userEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder>( + userEvents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + userEvents_ = null; + } + return userEventsBuilder_; + } + + @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.UserEventInlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UserEventInlineSource) + private static final com.google.cloud.retail.v2beta.UserEventInlineSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UserEventInlineSource(); + } + + public static com.google.cloud.retail.v2beta.UserEventInlineSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventInlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventInlineSource(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.UserEventInlineSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSourceOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSourceOrBuilder.java new file mode 100644 index 00000000..575f0265 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInlineSourceOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface UserEventInlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UserEventInlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getUserEventsList(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.UserEvent getUserEvents(int index); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getUserEventsCount(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getUserEventsOrBuilderList(); + /** + * + * + *
+   * Required. A list of user events to import. Recommended max of 10k items.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventsOrBuilder(int index); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfig.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfig.java new file mode 100644 index 00000000..15924501 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfig.java @@ -0,0 +1,1532 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The input config source for user events.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventInputConfig} + */ +public final class UserEventInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UserEventInputConfig) + UserEventInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserEventInputConfig.newBuilder() to construct. + private UserEventInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserEventInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEventInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserEventInputConfig( + 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.UserEventInlineSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.retail.v2beta.UserEventInlineSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserEventInlineSource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.retail.v2beta.UserEventInlineSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.retail.v2beta.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: + { + com.google.cloud.retail.v2beta.BigQuerySource.Builder subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = ((com.google.cloud.retail.v2beta.BigQuerySource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.retail.v2beta.BigQuerySource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.retail.v2beta.BigQuerySource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + 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.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventInputConfig.class, + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + USER_EVENT_INLINE_SOURCE(1), + GCS_SOURCE(2), + BIG_QUERY_SOURCE(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return USER_EVENT_INLINE_SOURCE; + case 2: + return GCS_SOURCE; + case 3: + return BIG_QUERY_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int USER_EVENT_INLINE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + @java.lang.Override + public boolean hasUserEventInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSource getUserEventInlineSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + + public static final int BIG_QUERY_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.retail.v2beta.UserEventInlineSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.retail.v2beta.GcsSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2beta.UserEventInlineSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2beta.GcsSource) source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.retail.v2beta.BigQuerySource) source_); + } + 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.UserEventInputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UserEventInputConfig other = + (com.google.cloud.retail.v2beta.UserEventInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getUserEventInlineSource().equals(other.getUserEventInlineSource())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 3: + if (!getBigQuerySource().equals(other.getBigQuerySource())) return false; + break; + case 0: + default: + } + 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(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + USER_EVENT_INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getUserEventInlineSource().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 3: + hash = (37 * hash) + BIG_QUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigQuerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig 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.UserEventInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig 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.UserEventInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig 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.UserEventInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig 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.UserEventInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig 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.UserEventInputConfig 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.UserEventInputConfig 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.UserEventInputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The input config source for user events.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserEventInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UserEventInputConfig) + com.google.cloud.retail.v2beta.UserEventInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserEventInputConfig.class, + com.google.cloud.retail.v2beta.UserEventInputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UserEventInputConfig.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ImportConfigProto + .internal_static_google_cloud_retail_v2beta_UserEventInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UserEventInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInputConfig build() { + com.google.cloud.retail.v2beta.UserEventInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInputConfig buildPartial() { + com.google.cloud.retail.v2beta.UserEventInputConfig result = + new com.google.cloud.retail.v2beta.UserEventInputConfig(this); + if (sourceCase_ == 1) { + if (userEventInlineSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = userEventInlineSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (bigQuerySourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQuerySourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.UserEventInputConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.UserEventInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UserEventInputConfig other) { + if (other == com.google.cloud.retail.v2beta.UserEventInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case USER_EVENT_INLINE_SOURCE: + { + mergeUserEventInlineSource(other.getUserEventInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIG_QUERY_SOURCE: + { + mergeBigQuerySource(other.getBigQuerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + 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.UserEventInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UserEventInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInlineSource, + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder, + com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder> + userEventInlineSourceBuilder_; + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + @java.lang.Override + public boolean hasUserEventInlineSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSource getUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return userEventInlineSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.retail.v2beta.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEventInlineSource( + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder builderForValue) { + if (userEventInlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + userEventInlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEventInlineSource( + com.google.cloud.retail.v2beta.UserEventInlineSource value) { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.UserEventInlineSource.newBuilder( + (com.google.cloud.retail.v2beta.UserEventInlineSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + userEventInlineSourceBuilder_.mergeFrom(value); + } else { + userEventInlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEventInlineSource() { + if (userEventInlineSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + userEventInlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventInlineSource.Builder + getUserEventInlineSourceBuilder() { + return getUserEventInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder + getUserEventInlineSourceOrBuilder() { + if ((sourceCase_ == 1) && (userEventInlineSourceBuilder_ != null)) { + return userEventInlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.retail.v2beta.UserEventInlineSource) source_; + } + return com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInlineSource, + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder, + com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder> + getUserEventInlineSourceFieldBuilder() { + if (userEventInlineSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.retail.v2beta.UserEventInlineSource.getDefaultInstance(); + } + userEventInlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEventInlineSource, + com.google.cloud.retail.v2beta.UserEventInlineSource.Builder, + com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder>( + (com.google.cloud.retail.v2beta.UserEventInlineSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return userEventInlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.retail.v2beta.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.retail.v2beta.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsSource(com.google.cloud.retail.v2beta.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.GcsSource.newBuilder( + (com.google.cloud.retail.v2beta.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.retail.v2beta.GcsSource) source_; + } + return com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location for the input content.
+     * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.retail.v2beta.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.GcsSource, + com.google.cloud.retail.v2beta.GcsSource.Builder, + com.google.cloud.retail.v2beta.GcsSourceOrBuilder>( + (com.google.cloud.retail.v2beta.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + bigQuerySourceBuilder_; + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + @java.lang.Override + public boolean hasBigQuerySource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return bigQuerySourceBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBigQuerySource( + com.google.cloud.retail.v2beta.BigQuerySource.Builder builderForValue) { + if (bigQuerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQuerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBigQuerySource(com.google.cloud.retail.v2beta.BigQuerySource value) { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.retail.v2beta.BigQuerySource.newBuilder( + (com.google.cloud.retail.v2beta.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + bigQuerySourceBuilder_.mergeFrom(value); + } else { + bigQuerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBigQuerySource() { + if (bigQuerySourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + bigQuerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.BigQuerySource.Builder getBigQuerySourceBuilder() { + return getBigQuerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder() { + if ((sourceCase_ == 3) && (bigQuerySourceBuilder_ != null)) { + return bigQuerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.retail.v2beta.BigQuerySource) source_; + } + return com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Required. BigQuery input source.
+     * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder> + getBigQuerySourceFieldBuilder() { + if (bigQuerySourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.retail.v2beta.BigQuerySource.getDefaultInstance(); + } + bigQuerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.BigQuerySource, + com.google.cloud.retail.v2beta.BigQuerySource.Builder, + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder>( + (com.google.cloud.retail.v2beta.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + ; + return bigQuerySourceBuilder_; + } + + @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.UserEventInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UserEventInputConfig) + private static final com.google.cloud.retail.v2beta.UserEventInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UserEventInputConfig(); + } + + public static com.google.cloud.retail.v2beta.UserEventInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserEventInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserEventInputConfig(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.UserEventInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfigOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfigOrBuilder.java new file mode 100644 index 00000000..5b3f46a5 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventInputConfigOrBuilder.java @@ -0,0 +1,150 @@ +/* + * 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/import_config.proto + +package com.google.cloud.retail.v2beta; + +public interface UserEventInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UserEventInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEventInlineSource field is set. + */ + boolean hasUserEventInlineSource(); + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEventInlineSource. + */ + com.google.cloud.retail.v2beta.UserEventInlineSource getUserEventInlineSource(); + /** + * + * + *
+   * Required. The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEventInlineSource user_event_inline_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.UserEventInlineSourceOrBuilder getUserEventInlineSourceOrBuilder(); + + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + com.google.cloud.retail.v2beta.GcsSource getGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location for the input content.
+   * 
+ * + * + * .google.cloud.retail.v2beta.GcsSource gcs_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bigQuerySource field is set. + */ + boolean hasBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bigQuerySource. + */ + com.google.cloud.retail.v2beta.BigQuerySource getBigQuerySource(); + /** + * + * + *
+   * Required. BigQuery input source.
+   * 
+ * + * + * .google.cloud.retail.v2beta.BigQuerySource big_query_source = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.BigQuerySourceOrBuilder getBigQuerySourceOrBuilder(); + + public com.google.cloud.retail.v2beta.UserEventInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java new file mode 100644 index 00000000..7232c87f --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java @@ -0,0 +1,1059 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +public interface UserEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UserEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   * * `add-to-cart`: Products being added to cart.
+   * * `category-page-view`: Special pages such as sale or promotion pages
+   *   viewed.
+   * * `detail-page-view`: Products detail page viewed.
+   * * `home-page-view`: Homepage viewed.
+   * * `promotion-offered`: Promotion is offered to a user.
+   * * `promotion-not-offered`: Promotion is not offered to a user.
+   * * `purchase-complete`: User finishing a purchase.
+   * * `search`: Product search.
+   * * `shopping-cart-page-view`: User viewing a shopping cart.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The visitorId. + */ + java.lang.String getVisitorId(); + /** + * + * + *
+   * Required. A unique identifier for tracking visitors.
+   * For example, this could be implemented with an HTTP cookie, which should be
+   * able to uniquely identify a visitor on a single device. This unique
+   * identifier should not change if the visitor log in/out of the website.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * The field should not contain PII or user-data. We recommend to use Google
+   * Analystics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for visitorId. + */ + com.google.protobuf.ByteString getVisitorIdBytes(); + + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The sessionId. + */ + java.lang.String getSessionId(); + /** + * + * + *
+   * A unique identifier for tracking a visitor session with a length limit of
+   * 128 bytes. A session is an aggregation of an end user behavior in a time
+   * span.
+   * A general guideline to populate the sesion_id:
+   * 1. If user has no activity for 30 min, a new session_id should be assigned.
+   * 2. The session_id should be unique across users, suggest use uuid or add
+   * visitor_id as prefix.
+   * 
+ * + * string session_id = 21; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); + + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return Whether the eventTime field is set. + */ + boolean hasEventTime(); + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + * + * @return The eventTime. + */ + com.google.protobuf.Timestamp getEventTime(); + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return A list containing the experimentIds. + */ + java.util.List getExperimentIdsList(); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @return The count of experimentIds. + */ + int getExperimentIdsCount(); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the element to return. + * @return The experimentIds at the given index. + */ + java.lang.String getExperimentIds(int index); + /** + * + * + *
+   * A list of identifiers for the independent experiment groups this user event
+   * belongs to. This is used to distinguish between user events associated with
+   * different experiment setups (e.g. using Retail API, using different
+   * recommendation models).
+   * 
+ * + * repeated string experiment_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the experimentIds at the given index. + */ + com.google.protobuf.ByteString getExperimentIdsBytes(int index); + + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * Highly recommended for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   * The value must be a valid
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * for user events that are the result of
+   * [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict].
+   * The value must be a valid
+   * [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token]
+   * for user events that are the result of
+   * [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
+   * This token enables us to accurately attribute page view or purchase back to
+   * the event and the particular predict response containing this
+   * clicked/purchased product. If user clicks on product K in the
+   * recommendation results, pass
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 5; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + java.util.List getProductDetailsList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + com.google.cloud.retail.v2beta.ProductDetail getProductDetails(int index); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + int getProductDetailsCount(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + java.util.List + getProductDetailsOrBuilderList(); + /** + * + * + *
+   * The main product details related to the event.
+   * This field is required for the following event types:
+   * * `add-to-cart`
+   * * `detail-page-view`
+   * * `purchase-complete`
+   * * `search`
+   * In a `search` event, this field represents the products returned to the end
+   * user on the current page (the end user may have not finished browsing the
+   * whole page yet). When a new page is returned to the end user, after
+   * pagination/filtering/ordering even for the same query, a new `search` event
+   * with different
+   * [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is
+   * desired. The end user may have not finished browsing the whole page yet.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.ProductDetail product_details = 6; + */ + com.google.cloud.retail.v2beta.ProductDetailOrBuilder getProductDetailsOrBuilder(int index); + + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return Whether the completionDetail field is set. + */ + boolean hasCompletionDetail(); + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + * + * @return The completionDetail. + */ + com.google.cloud.retail.v2beta.CompletionDetail getCompletionDetail(); + /** + * + * + *
+   * The main auto-completion details related to the event.
+   * This field should be set for `search` event when autocomplete function is
+   * enabled and the user clicks a suggestion for search.
+   * 
+ * + * .google.cloud.retail.v2beta.CompletionDetail completion_detail = 22; + */ + com.google.cloud.retail.v2beta.CompletionDetailOrBuilder getCompletionDetailOrBuilder(); + + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + int getAttributesCount(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + boolean containsAttributes(java.lang.String key); + /** Use {@link #getAttributesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAttributes(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.retail.v2beta.CustomAttribute defaultValue); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * If you provide custom attributes for ingested user events, also include
+   * them in the user events that you associate with prediction requests. Custom
+   * attribute formatting must be consistent between imported events and events
+   * provided with prediction requests. This lets the Retail API use
+   * those custom attributes when training models and serving predictions, which
+   * helps improve recommendation quality.
+   * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
+   * error is returned:
+   * * The key must be a UTF-8 encoded string with a length limit of 5,000
+   *   characters.
+   * * For text attributes, at most 400 values are allowed. Empty values are not
+   *   allowed. Each value must be a UTF-8 encoded string with a length limit of
+   *   256 characters.
+   * * For number attributes, at most 400 values are allowed.
+   * For product recommendations, an example of extra user information is
+   * traffic_channel, which is how a user arrives at the site. Users can arrive
+   * at the site by coming to the site directly, coming through Google
+   * search, or in other ways.
+   * 
+ * + * map<string, .google.cloud.retail.v2beta.CustomAttribute> attributes = 7; + */ + com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The cartId. + */ + java.lang.String getCartId(); + /** + * + * + *
+   * The ID or name of the associated shopping cart. This ID is used
+   * to associate multiple items added or present in the cart before purchase.
+   * This can only be set for `add-to-cart`, `purchase-complete`, or
+   * `shopping-cart-page-view` events.
+   * 
+ * + * string cart_id = 8; + * + * @return The bytes for cartId. + */ + com.google.protobuf.ByteString getCartIdBytes(); + + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return Whether the purchaseTransaction field is set. + */ + boolean hasPurchaseTransaction(); + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + * + * @return The purchaseTransaction. + */ + com.google.cloud.retail.v2beta.PurchaseTransaction getPurchaseTransaction(); + /** + * + * + *
+   * A transaction represents the entire purchase transaction.
+   * Required for `purchase-complete` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * .google.cloud.retail.v2beta.PurchaseTransaction purchase_transaction = 9; + */ + com.google.cloud.retail.v2beta.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder(); + + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The searchQuery. + */ + java.lang.String getSearchQuery(); + /** + * + * + *
+   * The user's search query.
+   * See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query]
+   * for definition.
+   * The value must be a UTF-8 encoded string with a length limit of 5,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string search_query = 10; + * + * @return The bytes for searchQuery. + */ + com.google.protobuf.ByteString getSearchQueryBytes(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the products being filtered.
+   * See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string filter = 16; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned.
+   * See
+   * [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by]
+   * for definition and syntax.
+   * The value must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string order_by = 17; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * An integer that specifies the current offset for pagination (the 0-indexed
+   * starting location, amongst the products deemed by the API as relevant).
+   * See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset]
+   * for definition.
+   * If this field is negative, an INVALID_ARGUMENT is returned.
+   * This can only be set for `search` events. Other event types should not set
+   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * int32 offset = 18; + * + * @return The offset. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return A list containing the pageCategories. + */ + java.util.List 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @return The count of pageCategories. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the element to return. + * @return The pageCategories at the given index. + */ + 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
+   * other character(s).
+   * Category pages include special pages such as sales or promotions. For
+   * instance, a special sale page may have the category hierarchy:
+   * "pageCategories" : ["Sales > 2017 Black Friday Deals"].
+   * Required for `category-page-view` events. At least one of
+   * [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or
+   * [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is
+   * required for `search` events. Other event types should not set this field.
+   * Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * repeated string page_categories = 11; + * + * @param index The index of the value to return. + * @return The bytes of the pageCategories at the given index. + */ + com.google.protobuf.ByteString getPageCategoriesBytes(int index); + + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + * + * @return The userInfo. + */ + com.google.cloud.retail.v2beta.UserInfo getUserInfo(); + /** + * + * + *
+   * User information.
+   * 
+ * + * .google.cloud.retail.v2beta.UserInfo user_info = 12; + */ + com.google.cloud.retail.v2beta.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Complete URL (window.location.href) of the user's current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically. Maximum length 5,000
+   * characters.
+   * 
+ * + * string uri = 13; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The referrerUri. + */ + java.lang.String getReferrerUri(); + /** + * + * + *
+   * The referrer URL of the current page.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string referrer_uri = 14; + * + * @return The bytes for referrerUri. + */ + com.google.protobuf.ByteString getReferrerUriBytes(); + + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The pageViewId. + */ + java.lang.String getPageViewId(); + /** + * + * + *
+   * A unique ID of a web page view.
+   * This should be kept the same for all user events triggered from the same
+   * pageview. For example, an item detail page view could trigger multiple
+   * events as the user is browsing the page. The `pageViewId` property should
+   * be kept the same for all these events so that they can be grouped together
+   * properly.
+   * When using the client side event reporting with JavaScript pixel and Google
+   * Tag Manager, this value is filled in automatically.
+   * 
+ * + * string page_view_id = 15; + * + * @return The bytes for pageViewId. + */ + com.google.protobuf.ByteString getPageViewIdBytes(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventProto.java new file mode 100644 index 00000000..2d93c086 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventProto.java @@ -0,0 +1,183 @@ +/* + * 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/user_event.proto + +package com.google.cloud.retail.v2beta; + +public final class UserEventProto { + private UserEventProto() {} + + 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_UserEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ProductDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CompletionDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PurchaseTransaction_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/user_event." + + "proto\022\032google.cloud.retail.v2beta\032\037googl" + + "e/api/field_behavior.proto\032\'google/cloud" + + "/retail/v2beta/common.proto\032(google/clou" + + "d/retail/v2beta/product.proto\032\037google/pr" + + "otobuf/timestamp.proto\032\036google/protobuf/" + + "wrappers.proto\"\237\006\n\tUserEvent\022\027\n\nevent_ty" + + "pe\030\001 \001(\tB\003\340A\002\022\027\n\nvisitor_id\030\002 \001(\tB\003\340A\002\022\022" + + "\n\nsession_id\030\025 \001(\t\022.\n\nevent_time\030\003 \001(\0132\032" + + ".google.protobuf.Timestamp\022\026\n\016experiment" + + "_ids\030\004 \003(\t\022\031\n\021attribution_token\030\005 \001(\t\022B\n" + + "\017product_details\030\006 \003(\0132).google.cloud.re" + + "tail.v2beta.ProductDetail\022G\n\021completion_" + + "detail\030\026 \001(\0132,.google.cloud.retail.v2bet" + + "a.CompletionDetail\022I\n\nattributes\030\007 \003(\01325" + + ".google.cloud.retail.v2beta.UserEvent.At" + + "tributesEntry\022\017\n\007cart_id\030\010 \001(\t\022M\n\024purcha" + + "se_transaction\030\t \001(\0132/.google.cloud.reta" + + "il.v2beta.PurchaseTransaction\022\024\n\014search_" + + "query\030\n \001(\t\022\016\n\006filter\030\020 \001(\t\022\020\n\010order_by\030" + + "\021 \001(\t\022\016\n\006offset\030\022 \001(\005\022\027\n\017page_categories" + + "\030\013 \003(\t\0227\n\tuser_info\030\014 \001(\0132$.google.cloud" + + ".retail.v2beta.UserInfo\022\013\n\003uri\030\r \001(\t\022\024\n\014" + + "referrer_uri\030\016 \001(\t\022\024\n\014page_view_id\030\017 \001(\t" + + "\032^\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\022:\n\005valu" + + "e\030\002 \001(\0132+.google.cloud.retail.v2beta.Cus" + + "tomAttribute:\0028\001\"y\n\rProductDetail\0229\n\007pro" + + "duct\030\001 \001(\0132#.google.cloud.retail.v2beta." + + "ProductB\003\340A\002\022-\n\010quantity\030\002 \001(\0132\033.google." + + "protobuf.Int32Value\"p\n\020CompletionDetail\022" + + "$\n\034completion_attribution_token\030\001 \001(\t\022\033\n" + + "\023selected_suggestion\030\002 \001(\t\022\031\n\021selected_p" + + "osition\030\003 \001(\005\"n\n\023PurchaseTransaction\022\n\n\002" + + "id\030\001 \001(\t\022\024\n\007revenue\030\002 \001(\002B\003\340A\002\022\013\n\003tax\030\003 " + + "\001(\002\022\014\n\004cost\030\004 \001(\002\022\032\n\rcurrency_code\030\005 \001(\t" + + "B\003\340A\002B\327\001\n\036com.google.cloud.retail.v2beta" + + "B\016UserEventProtoP\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" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_UserEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_UserEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserEvent_descriptor, + new java.lang.String[] { + "EventType", + "VisitorId", + "SessionId", + "EventTime", + "ExperimentIds", + "AttributionToken", + "ProductDetails", + "CompletionDetail", + "Attributes", + "CartId", + "PurchaseTransaction", + "SearchQuery", + "Filter", + "OrderBy", + "Offset", + "PageCategories", + "UserInfo", + "Uri", + "ReferrerUri", + "PageViewId", + }); + internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_descriptor = + internal_static_google_cloud_retail_v2beta_UserEvent_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UserEvent_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_ProductDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ProductDetail_descriptor, + new java.lang.String[] { + "Product", "Quantity", + }); + internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_CompletionDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CompletionDetail_descriptor, + new java.lang.String[] { + "CompletionAttributionToken", "SelectedSuggestion", "SelectedPosition", + }); + internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_PurchaseTransaction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PurchaseTransaction_descriptor, + new java.lang.String[] { + "Id", "Revenue", "Tax", "Cost", "CurrencyCode", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(); + com.google.cloud.retail.v2beta.ProductProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java new file mode 100644 index 00000000..b8802e9a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java @@ -0,0 +1,195 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public final class UserEventServiceProto { + private UserEventServiceProto() {} + + 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_WriteUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/retail/v2beta/user_event_" + + "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\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( + 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.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(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", + }); + internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CollectUserEventRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEvent", "Uri", "Ets", + }); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RejoinUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "UserEventRejoinScope", + }); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RejoinUserEventsResponse_descriptor, + new java.lang.String[] { + "RejoinedUserEventsCount", + }); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_RejoinUserEventsMetadata_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.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.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(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfo.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfo.java new file mode 100644 index 00000000..5d3bb3b5 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfo.java @@ -0,0 +1,1286 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Information of an end user.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserInfo} + */ +public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UserInfo) + UserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserInfo.newBuilder() to construct. + private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserInfo() { + userId_ = ""; + ipAddress_ = ""; + userAgent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserInfo( + 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(); + + userId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 32: + { + directUserRequest_ = 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.CommonProto + .internal_static_google_cloud_retail_v2beta_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserInfo.class, + com.google.cloud.retail.v2beta.UserInfo.Builder.class); + } + + public static final int USER_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object userId_; + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + 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(); + userId_ = s; + return s; + } + } + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_AGENT_FIELD_NUMBER = 3; + private volatile java.lang.Object userAgent_; + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + @java.lang.Override + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + 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(); + userAgent_ = s; + return s; + } + } + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIRECT_USER_REQUEST_FIELD_NUMBER = 4; + private boolean directUserRequest_; + /** + * + * + *
+   * True if the request is made directly from the end user, in which case the
+   * [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and
+   * [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be
+   * populated from the HTTP request. This flag should be set only if the API
+   * request is made directly from the end user such as a mobile app (and not if
+   * a gateway or a server is processing and pushing the user events).
+   * This should not be set when using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + + 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(userId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userAgent_); + } + if (directUserRequest_ != false) { + output.writeBool(4, directUserRequest_); + } + 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(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userAgent_); + } + if (directUserRequest_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, directUserRequest_); + } + 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.UserInfo)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UserInfo other = (com.google.cloud.retail.v2beta.UserInfo) obj; + + if (!getUserId().equals(other.getUserId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (getDirectUserRequest() != other.getDirectUserRequest()) 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) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + DIRECT_USER_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectUserRequest()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UserInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserInfo 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.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserInfo 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.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UserInfo 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.UserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserInfo 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.UserInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UserInfo 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.UserInfo 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.UserInfo 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.UserInfo 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; + } + /** + * + * + *
+   * Information of an end user.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UserInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UserInfo) + com.google.cloud.retail.v2beta.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UserInfo.class, + com.google.cloud.retail.v2beta.UserInfo.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UserInfo.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(); + userId_ = ""; + + ipAddress_ = ""; + + userAgent_ = ""; + + directUserRequest_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CommonProto + .internal_static_google_cloud_retail_v2beta_UserInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfo getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfo build() { + com.google.cloud.retail.v2beta.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UserInfo buildPartial() { + com.google.cloud.retail.v2beta.UserInfo result = + new com.google.cloud.retail.v2beta.UserInfo(this); + result.userId_ = userId_; + result.ipAddress_ = ipAddress_; + result.userAgent_ = userAgent_; + result.directUserRequest_ = directUserRequest_; + 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.UserInfo) { + return mergeFrom((com.google.cloud.retail.v2beta.UserInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UserInfo other) { + if (other == com.google.cloud.retail.v2beta.UserInfo.getDefaultInstance()) return this; + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (other.getDirectUserRequest() != false) { + setDirectUserRequest(other.getDirectUserRequest()); + } + 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.UserInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.UserInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + + userId_ = getDefaultInstance().getUserId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name.
+     * Always use a hashed value for this ID.
+     * The field must be a UTF-8 encoded string with a length limit of 128
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * 
+ * + * string user_id = 1; + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userId_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * The end user's IP address. This field is used to extract location
+     * information for personalization.
+     * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+     * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+     * INVALID_ARGUMENT error is returned.
+     * This should not be set when:
+     * * setting
+     * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+     * * using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string ip_address = 2; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @param value The userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header. Required for getting
+     * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+     * The field must be a UTF-8 encoded string with a length limit of 1,000
+     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * This should not be set when using the client side event reporting with
+     * GTM or JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+     * or if
+     * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 3; + * + * @param value The bytes for userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private boolean directUserRequest_; + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @param value The directUserRequest to set. + * @return This builder for chaining. + */ + public Builder setDirectUserRequest(boolean value) { + + directUserRequest_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the request is made directly from the end user, in which case the
+     * [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and
+     * [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be
+     * populated from the HTTP request. This flag should be set only if the API
+     * request is made directly from the end user such as a mobile app (and not if
+     * a gateway or a server is processing and pushing the user events).
+     * This should not be set when using the JavaScript tag in
+     * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 4; + * + * @return This builder for chaining. + */ + public Builder clearDirectUserRequest() { + + directUserRequest_ = 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.UserInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UserInfo) + private static final com.google.cloud.retail.v2beta.UserInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UserInfo(); + } + + public static com.google.cloud.retail.v2beta.UserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserInfo(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.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfoOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfoOrBuilder.java new file mode 100644 index 00000000..8e49d706 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserInfoOrBuilder.java @@ -0,0 +1,170 @@ +/* + * 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/common.proto + +package com.google.cloud.retail.v2beta; + +public interface UserInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The userId. + */ + java.lang.String getUserId(); + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name.
+   * Always use a hashed value for this ID.
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * 
+ * + * string user_id = 1; + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The end user's IP address. This field is used to extract location
+   * information for personalization.
+   * This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6
+   * address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an
+   * INVALID_ARGUMENT error is returned.
+   * This should not be set when:
+   * * setting
+   * [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info].
+   * * using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string ip_address = 2; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The userAgent. + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * User agent as included in the HTTP header. Required for getting
+   * [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results].
+   * The field must be a UTF-8 encoded string with a length limit of 1,000
+   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * This should not be set when using the client side event reporting with
+   * GTM or JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]
+   * or if
+   * [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 3; + * + * @return The bytes for userAgent. + */ + com.google.protobuf.ByteString getUserAgentBytes(); + + /** + * + * + *
+   * True if the request is made directly from the end user, in which case the
+   * [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and
+   * [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be
+   * populated from the HTTP request. This flag should be set only if the API
+   * request is made directly from the end user such as a mobile app (and not if
+   * a gateway or a server is processing and pushing the user events).
+   * This should not be set when using the JavaScript tag in
+   * [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 4; + * + * @return The directUserRequest. + */ + boolean getDirectUserRequest(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequest.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequest.java new file mode 100644 index 00000000..3531f731 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequest.java @@ -0,0 +1,946 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for WriteUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.WriteUserEventRequest} + */ +public final class WriteUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.WriteUserEventRequest) + WriteUserEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteUserEventRequest.newBuilder() to construct. + private WriteUserEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteUserEventRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteUserEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteUserEventRequest( + 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.UserEvent.Builder subBuilder = null; + if (userEvent_ != null) { + subBuilder = userEvent_.toBuilder(); + } + userEvent_ = + input.readMessage( + com.google.cloud.retail.v2beta.UserEvent.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userEvent_); + userEvent_ = 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.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.WriteUserEventRequest.class, + com.google.cloud.retail.v2beta.WriteUserEventRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.UserEvent userEvent_; + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + @java.lang.Override + public boolean hasUserEvent() { + return userEvent_ != null; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() { + return getUserEvent(); + } + + 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 (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + 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 (userEvent_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + 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.WriteUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.WriteUserEventRequest other = + (com.google.cloud.retail.v2beta.WriteUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) 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 (hasUserEvent()) { + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest 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.WriteUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest 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.WriteUserEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest 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.WriteUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest 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.WriteUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest 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.WriteUserEventRequest 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.WriteUserEventRequest 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.WriteUserEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for WriteUserEvent method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.WriteUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.WriteUserEventRequest) + com.google.cloud.retail.v2beta.WriteUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.WriteUserEventRequest.class, + com.google.cloud.retail.v2beta.WriteUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.WriteUserEventRequest.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 (userEventBuilder_ == null) { + userEvent_ = null; + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.UserEventServiceProto + .internal_static_google_cloud_retail_v2beta_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.WriteUserEventRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.WriteUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.WriteUserEventRequest build() { + com.google.cloud.retail.v2beta.WriteUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.WriteUserEventRequest buildPartial() { + com.google.cloud.retail.v2beta.WriteUserEventRequest result = + new com.google.cloud.retail.v2beta.WriteUserEventRequest(this); + result.parent_ = parent_; + if (userEventBuilder_ == null) { + result.userEvent_ = userEvent_; + } else { + result.userEvent_ = userEventBuilder_.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.WriteUserEventRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.WriteUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.WriteUserEventRequest other) { + if (other == com.google.cloud.retail.v2beta.WriteUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + 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.WriteUserEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.WriteUserEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent catalog resource name, such as
+     * `projects/1234/locations/global/catalogs/default_catalog`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return userEventBuilder_ != null || userEvent_ != null; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.retail.v2beta.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + onChanged(); + } else { + userEventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.retail.v2beta.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + onChanged(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.retail.v2beta.UserEvent value) { + if (userEventBuilder_ == null) { + if (userEvent_ != null) { + userEvent_ = + com.google.cloud.retail.v2beta.UserEvent.newBuilder(userEvent_) + .mergeFrom(value) + .buildPartial(); + } else { + userEvent_ = value; + } + onChanged(); + } else { + userEventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + if (userEventBuilder_ == null) { + userEvent_ = null; + onChanged(); + } else { + userEvent_ = null; + userEventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEvent.Builder getUserEventBuilder() { + + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.retail.v2beta.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.UserEvent, + com.google.cloud.retail.v2beta.UserEvent.Builder, + com.google.cloud.retail.v2beta.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + @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.WriteUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.WriteUserEventRequest) + private static final com.google.cloud.retail.v2beta.WriteUserEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.WriteUserEventRequest(); + } + + public static com.google.cloud.retail.v2beta.WriteUserEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteUserEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteUserEventRequest(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.WriteUserEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequestOrBuilder.java b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequestOrBuilder.java new file mode 100644 index 00000000..cd01b63d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/WriteUserEventRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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/user_event_service.proto + +package com.google.cloud.retail.v2beta; + +public interface WriteUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.WriteUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent catalog resource name, such as
+   * `projects/1234/locations/global/catalogs/default_catalog`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.retail.v2beta.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * .google.cloud.retail.v2beta.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder(); +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto new file mode 100644 index 00000000..e0b844ef --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto @@ -0,0 +1,397 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/import_config.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 = "CatalogProto"; +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"; + +// Configures what level the product should be uploaded with regards to +// how users will be send events and how predictions will be made. +message ProductLevelConfig { + // The type of [Product][google.cloud.retail.v2beta.Product]s allowed to be + // ingested into the catalog. Acceptable values are: + // + // * `primary` (default): You can ingest + // [Product][google.cloud.retail.v2beta.Product]s of all types. When + // ingesting a [Product][google.cloud.retail.v2beta.Product], its type will + // default to + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // if unset. + // * `variant`: You can only ingest + // [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s. + // This means + // [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id] + // cannot be empty. + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // If this field is `variant` and + // [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field] + // is `itemGroupId`, an INVALID_ARGUMENT error is returned. + // + // See [Using product + // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + // for more details. + string ingestion_product_type = 1; + + // Which field of [Merchant Center + // Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + // imported as [Product.id][google.cloud.retail.v2beta.Product.id]. Acceptable + // values are: + // + // * `offerId` (default): Import `offerId` as the product ID. + // * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + // API will choose one item from the ones with the same `itemGroupId`, and + // use it to represent the item group. + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // If this field is `itemGroupId` and + // [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type] + // is `variant`, an INVALID_ARGUMENT error is returned. + // + // See [Using product + // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) + // for more details. + string merchant_center_product_id_field = 2; +} + +// Catalog level attribute config for an attribute. For example, if customers +// want to enable/disable facet for a specific attribute. +message CatalogAttribute { + // The type of an attribute. + enum AttributeType { + // The type of the attribute is unknown. + // + // Used when type cannot be derived from attribute that is not + // [in_use][google.cloud.retail.v2beta.CatalogAttribute.in_use]. + UNKNOWN = 0; + + // Textual attribute. + TEXTUAL = 1; + + // Numerical attribute. + NUMERICAL = 2; + } + + // The status of the indexable option of a catalog attribute. + enum IndexableOption { + // Value used when unset. Defaults to + // [INDEXABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED]. + INDEXABLE_OPTION_UNSPECIFIED = 0; + + // Indexable option enabled for an attribute. + INDEXABLE_ENABLED = 1; + + // Indexable option disabled for an attribute. + INDEXABLE_DISABLED = 2; + } + + // The status of the dynamic facetable option of a catalog attribute. + enum DynamicFacetableOption { + // Value used when unset. Defaults to + // [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED]. + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + + // Dynamic facetable option enabled for an attribute. + DYNAMIC_FACETABLE_ENABLED = 1; + + // Dynamic facetable option disabled for an attribute. + DYNAMIC_FACETABLE_DISABLED = 2; + } + + // The status of the searchable option of a catalog attribute. + enum SearchableOption { + // Value used when unset. Defaults to + // [SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED]. + SEARCHABLE_OPTION_UNSPECIFIED = 0; + + // Searchable option enabled for an attribute. + SEARCHABLE_ENABLED = 1; + + // Searchable option disabled for an attribute. + SEARCHABLE_DISABLED = 2; + } + + // Required. Attribute name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Indicates whether this attribute has been used by any + // products. `True` if at least one + // [Product][google.cloud.retail.v2beta.Product] is using this attribute in + // [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + // Otherwise, this field is `False`. + // + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be + // pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][], + // or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s. + // + // Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that + // are not in use by products can be deleted. + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are + // in use by products cannot be deleted; however, their configuration + // properties will reset to default values upon removal request. + // + // After catalog changes, it takes about 10 minutes for this field to update. + bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of this attribute. This is derived from the attribute + // in [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + AttributeType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + // are indexed so that it can be filtered, faceted, or boosted in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + IndexableOption indexable_option = 5; + + // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + // facet. Could only be DYNAMIC_FACETABLE_DISABLED if + // [CatalogAttribute.indexable_option][google.cloud.retail.v2beta.CatalogAttribute.indexable_option] + // is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + DynamicFacetableOption dynamic_facetable_option = 6; + + // When + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + // are searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + // will not be searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as + // there are no text values associated to numerical attributes. + SearchableOption searchable_option = 7; +} + +// Catalog level attribute config. +message AttributesConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/AttributesConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + }; + + // Required. Immutable. The fully qualified resource name of the attribute + // config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Enable attribute(s) config at catalog level. + // For example, indexable, dynamic_facetable, or searchable for each + // attribute. + // + // The key is catalog attribute's name. + // For example: `color`, `brands`, `attributes.custom_attribute`, such as + // `attributes.xyz`. + // + // The maximum number of catalog attributes allowed in a request is 1000. + map catalog_attributes = 2; + + // Output only. The + // [AttributeConfigLevel][google.cloud.retail.v2beta.AttributeConfigLevel] + // used for this catalog. + AttributeConfigLevel attribute_config_level = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Catalog level autocomplete config for customers to customize autocomplete +// feature's settings. +message CompletionConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/CompletionConfig" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" + }; + + // Required. Immutable. Fully qualified name + // `projects/*/locations/*/catalogs/*/completionConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Specifies the matching order for autocomplete suggestions, e.g., a query + // consisting of 'sh' with 'out-of-order' specified would suggest "women's + // shoes", whereas a query of 'red s' with 'exact-prefix' specified would + // suggest "red shoes". Currently supported values: + // + // * 'out-of-order' + // * 'exact-prefix' + // + // Default value: 'exact-prefix'. + string matching_order = 2; + + // The maximum number of autocomplete suggestions returned per term. The + // maximum allowed max suggestions is 20. Default value is 20. If left unset + // or set to 0, then will fallback to default value. + int32 max_suggestions = 3; + + // The minimum number of characters needed to be typed in order to get + // suggestions. Default value is 2. If left unset or set to 0, then will + // fallback to default value. + int32 min_prefix_length = 4; + + // If set to true, the auto learning function is enabled. Auto learning uses + // user data to generate suggestions using ML techniques. Default value is + // false. Only after enabling auto learning can users use `cloud-retail` + // data in + // [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest]. + bool auto_learning = 11; + + // Output only. The input config for the import of the source data that + // contains the autocomplete phrases uploaded by the customer. + CompletionDataInputConfig suggestions_input_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the LRO corresponding to the latest suggestion terms + // list import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_suggestions_import_operation = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the / autocomplete denylist phrases uploaded by the customer. + CompletionDataInputConfig denylist_input_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest denylist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_denylist_import_operation = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input config for the import of the source data that + // contains the autocomplete allowlist phrases uploaded by the customer. + CompletionDataInputConfig allowlist_input_config = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. LRO corresponding to the latest allowlist import. + // + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to + // retrieve the latest state of the Long Running Operation. + string last_allowlist_import_operation = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a link between a Merchant Center account and a branch. +// Once a link is established, products from the linked merchant center account +// will be streamed to the linked branch. +message MerchantCenterLink { + // Required. The linked [Merchant center account + // id](https://developers.google.com/shopping-content/guides/accountstatuses). + // The account must be a standalone account or a sub-account of a MCA. + int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The branch id (e.g. 0/1/2) within this catalog that products from + // merchant_center_account_id are streamed to. When updating this field, an + // empty value will use the currently configured default branch. However, + // changing the default branch later on won't change the linked branch here. + // + // A single branch id can only have one linked merchant center account id. + 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 allowed string values: + // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory + // _ads", "Free_listings", "Free_local_listings" + // NOTE: The string values are case sensitive. + repeated string destinations = 3; + + // Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2 + // code. List of values can be found + // [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) + // under the `region` tag. If left blank no region filtering will be + // performed. + // + // Example value: `US`. + string region_code = 4; + + // Language of the title/description and other string attributes. Use language + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // ISO 639-1. + // + // This specifies the language of offers in Merchant Center that will be + // accepted. If empty no language filtering will be performed. + // + // Example value: `en`. + string language_code = 5; +} + +// Configures Merchant Center linking. +// Links contained in the config will be used to sync data from a Merchant +// Center account to a Cloud Retail branch. +message MerchantCenterLinkingConfig { + // Links between Merchant Center accounts and branches. + repeated MerchantCenterLink links = 1; +} + +// The catalog configuration. +message Catalog { + option (google.api.resource) = { + type: "retail.googleapis.com/Catalog" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}" + }; + + // Required. Immutable. The fully qualified resource name of the catalog. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The catalog display name. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string display_name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The product level configuration. + ProductLevelConfig product_level_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // The Merchant Center linking configuration. + // Once a link is added, the data stream from Merchant Center to Cloud Retail + // will be enabled automatically. The requester must have access to the + // merchant center account in order to make changes to this field. + MerchantCenterLinkingConfig merchant_center_linking_config = 6; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto new file mode 100644 index 00000000..7e27c916 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto @@ -0,0 +1,478 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/catalog.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.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 = "CatalogServiceProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Service for managing catalog configuration. +service CatalogService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated + // with the project. + rpc ListCatalogs(ListCatalogsRequest) returns (ListCatalogsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*}/catalogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s. + rpc UpdateCatalog(UpdateCatalogRequest) returns (Catalog) { + option (google.api.http) = { + patch: "/v2beta/{catalog.name=projects/*/locations/*/catalogs/*}" + body: "catalog" + }; + option (google.api.method_signature) = "catalog,update_mask"; + } + + // Set a specified branch id as default branch. API methods such as + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], + // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] + // will treat requests using "default_branch" to the actual branch id set as + // default. + // + // For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + // default, setting + // [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to + // `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + // to setting + // [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to + // `projects/*/locations/*/catalogs/*/branches/1`. + // + // Using multiple branches can be useful when developers would like + // to have a staging branch to test and verify for future usage. When it + // becomes ready, developers switch on the staging branch using this API while + // keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` + // as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] + // to route the traffic to this staging branch. + // + // CAUTION: If you have live predict/search traffic, switching the default + // branch could potentially cause outages if the ID space of the new branch is + // very different from the old one. + // + // More specifically: + // + // * PredictionService will only return product IDs from branch {newBranch}. + // * SearchService will only return product IDs from branch {newBranch} + // (if branch is not explicitly set). + // * UserEventService will only join events with products from branch + // {newBranch}. + rpc SetDefaultBranch(SetDefaultBranchRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch" + body: "*" + }; + option (google.api.method_signature) = "catalog"; + } + + // Get which branch is currently default branch set by + // [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] + // method under a specified parent catalog. + rpc GetDefaultBranch(GetDefaultBranchRequest) + returns (GetDefaultBranchResponse) { + option (google.api.http) = { + get: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch" + }; + option (google.api.method_signature) = "catalog"; + } + + // Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]. + rpc GetCompletionConfig(GetCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/completionConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s. + rpc UpdateCompletionConfig(UpdateCompletionConfigRequest) + returns (CompletionConfig) { + option (google.api.http) = { + patch: "/v2beta/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}" + body: "completion_config" + }; + option (google.api.method_signature) = "completion_config,update_mask"; + } + + // Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + rpc GetAttributesConfig(GetAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/attributesConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // The catalog attributes in the request will be updated in the catalog, or + // inserted if they do not exist. Existing catalog attributes not included in + // the request will remain unchanged. Attributes that are assigned to + // products, but do not exist at the catalog level, are always included in the + // response. The product attribute is assigned default values for missing + // catalog attribute fields, e.g., searchable and dynamic facetable options. + rpc UpdateAttributesConfig(UpdateAttributesConfigRequest) + returns (AttributesConfig) { + option (google.api.http) = { + patch: "/v2beta/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}" + body: "attributes_config" + }; + option (google.api.method_signature) = "attributes_config,update_mask"; + } + + // Adds the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // add already exists, an ALREADY_EXISTS error is returned. + rpc AddCatalogAttribute(AddCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute" + body: "*" + }; + } + + // Removes the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // remove does not exist, a NOT_FOUND error is returned. + rpc RemoveCatalogAttribute(RemoveCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute" + body: "*" + }; + } + + // Replaces the specified + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating + // the catalog attribute with the same + // [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. + // + // If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to + // replace does not exist, a NOT_FOUND error is returned. + rpc ReplaceCatalogAttribute(ReplaceCatalogAttributeRequest) + returns (AttributesConfig) { + option (google.api.http) = { + post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute" + body: "*" + }; + } +} + +// Request for +// [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs] +// method. +message ListCatalogsRequest { + // Required. The account resource name with an associated location. + // + // If the caller does not have permission to list + // [Catalog][google.cloud.retail.v2beta.Catalog]s under this location, + // regardless of whether or not this location exists, a PERMISSION_DENIED + // error is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of [Catalog][google.cloud.retail.v2beta.Catalog]s to return. + // If unspecified, defaults to 50. The maximum allowed value is 1000. Values + // above 1000 will be coerced to 1000. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 page_size = 2; + + // A page token + // [ListCatalogsResponse.next_page_token][google.cloud.retail.v2beta.ListCatalogsResponse.next_page_token], + // received from a previous + // [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 3; +} + +// Response for +// [CatalogService.ListCatalogs][google.cloud.retail.v2beta.CatalogService.ListCatalogs] +// method. +message ListCatalogsResponse { + // All the customer's [Catalog][google.cloud.retail.v2beta.Catalog]s. + repeated Catalog catalogs = 1; + + // A token that can be sent as + // [ListCatalogsRequest.page_token][google.cloud.retail.v2beta.ListCatalogsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request for +// [CatalogService.UpdateCatalog][google.cloud.retail.v2beta.CatalogService.UpdateCatalog] +// method. +message UpdateCatalogRequest { + // Required. The [Catalog][google.cloud.retail.v2beta.Catalog] to update. + // + // If the caller does not have permission to update the + // [Catalog][google.cloud.retail.v2beta.Catalog], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + // + // If the [Catalog][google.cloud.retail.v2beta.Catalog] to update does not + // exist, a NOT_FOUND error is returned. + Catalog catalog = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Catalog][google.cloud.retail.v2beta.Catalog] to update. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message to set a specified branch as new default_branch. +message SetDefaultBranchRequest { + // Full resource name of the catalog, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // The final component of the resource name of a branch. + // + // This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + // error is returned. + // + // If there are no sufficient active products in the targeted branch and + // [force][google.cloud.retail.v2beta.SetDefaultBranchRequest.force] is not + // set, a FAILED_PRECONDITION error is returned. + string branch_id = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Some note on this request, this can be retrieved by + // [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch] + // before next valid default branch set occurs. + // + // This field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string note = 3; + + // If set to true, it permits switching to a branch with + // [branch_id][google.cloud.retail.v2beta.SetDefaultBranchRequest.branch_id] + // even if it has no sufficient active products. + bool force = 4; +} + +// Request message to show which branch is currently the default branch. +message GetDefaultBranchRequest { + // The parent catalog resource name, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; +} + +// Response message of +// [CatalogService.GetDefaultBranch][google.cloud.retail.v2beta.CatalogService.GetDefaultBranch]. +message GetDefaultBranchResponse { + // Full resource name of the branch id currently set as default branch. + string branch = 1 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // The time when this branch is set to default. + google.protobuf.Timestamp set_time = 2; + + // This corresponds to + // [SetDefaultBranchRequest.note][google.cloud.retail.v2beta.SetDefaultBranchRequest.note] + // field, when this branch was set as default. + string note = 3; +} + +// Request for +// [CatalogService.GetCompletionConfig][google.cloud.retail.v2beta.CatalogService.GetCompletionConfig] +// method. +message GetCompletionConfigRequest { + // Required. Full CompletionConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/CompletionConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateCompletionConfig][google.cloud.retail.v2beta.CatalogService.UpdateCompletionConfig] +// method. +message UpdateCompletionConfigRequest { + // Required. The + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. + // + // If the caller does not have permission to update the + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig], then a + // PERMISSION_DENIED error is returned. + // + // If the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to + // update does not exist, a NOT_FOUND error is returned. + CompletionConfig completion_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig] to update. + // The following are the only supported fields: + // + // * [CompletionConfig.matching_order][google.cloud.retail.v2beta.CompletionConfig.matching_order] + // * [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions] + // * [CompletionConfig.min_prefix_length][google.cloud.retail.v2beta.CompletionConfig.min_prefix_length] + // * [CompletionConfig.auto_learning][google.cloud.retail.v2beta.CompletionConfig.auto_learning] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.GetAttributesConfig][google.cloud.retail.v2beta.CatalogService.GetAttributesConfig] +// method. +message GetAttributesConfigRequest { + // Required. Full AttributesConfig resource name. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/AttributesConfig" + } + ]; +} + +// Request for +// [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig] +// method. +message UpdateAttributesConfigRequest { + // Required. The + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. + AttributesConfig attributes_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] to update. + // The following is the only supported field: + // + // * [AttributesConfig.catalog_attributes][google.cloud.retail.v2beta.AttributesConfig.catalog_attributes] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [CatalogService.AddCatalogAttribute][google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute] +// method. +message AddCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.RemoveCatalogAttribute][google.cloud.retail.v2beta.CatalogService.RemoveCatalogAttribute] +// method. +message RemoveCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 key of the + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove. + string key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for +// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute] +// method. +message ReplaceCatalogAttributeRequest { + // Required. Full AttributesConfig resource name. 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 updated + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]. + CatalogAttribute catalog_attribute = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to update. + // The following are NOT supported: + // + // * [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto new file mode 100644 index 00000000..ada7dd15 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto @@ -0,0 +1,760 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.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 = "CommonProto"; +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"; + +// At which level we offer configuration for attributes. +enum AttributeConfigLevel { + // Value used when unset. Defaults to + // [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2beta.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; + + // At this level, we honor the attribute configurations set in + // [Product.attributes][google.cloud.retail.v2beta.Product.attributes]. + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; + + // At this level, we honor the attribute configurations set in + // [CatalogConfig.attribute_configs][]. + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; +} + +// The type of solution. +enum SolutionType { + // Default value. + SOLUTION_TYPE_UNSPECIFIED = 0; + + // Used for Recommendations AI. + SOLUTION_TYPE_RECOMMENDATION = 1; + + // Used for Retail Search. + SOLUTION_TYPE_SEARCH = 2; +} + +// The use case of Cloud Retail Search. +enum SearchSolutionUseCase { + // The value when it's unspecified. Defaults to + // [SEARCH][]. + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; + + // Search use case. Expects the traffic has a non-empty + // [query][google.cloud.retail.v2beta.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_SEARCH = 1; + + // Browse use case. Expects the traffic has an empty + // [query][google.cloud.retail.v2beta.SearchRequest.query]. + SEARCH_SOLUTION_USE_CASE_BROWSE = 2; +} + +// Metadata that is used to define a condition that triggers an action. +// A valid condition must specify at least one of 'query_terms' or +// 'products_filter'. If multiple fields are specified, the condition is met if +// all the fields are satisfied e.g. if a set of query terms and product_filter +// are set, then only items matching the product_filter for requests with a +// query matching the query terms wil get boosted. +message Condition { + // Query terms that we want to match on. + message QueryTerm { + // The value of the term to match on. + // 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. + string value = 1; + + // Whether this is supposed to be a full or partial match. + bool full_match = 2; + } + + // Used for time-dependent conditions. + // Example: Want to have rule applied for week long sale. + message TimeRange { + // Start of time range. Range is inclusive. + google.protobuf.Timestamp start_time = 1; + + // End of time range. Range is inclusive. + google.protobuf.Timestamp end_time = 2; + } + + // A list (up to 10 entries) of terms to match the query on. If not + // specified, match all queries. + // If many query terms are specified, the condition + // is matched if any of the terms is a match (i.e. using the OR operator). + repeated QueryTerm query_terms = 1; + + // Range of time(s) specifying when Condition is active. + // Condition true if any time range matches. + repeated TimeRange active_time_range = 3; +} + +// 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. +message Rule { + // A boost action to apply to results matching condition specified above. + message BoostAction { + // Strength of the condition boost, which must be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the item a big promotion. However, it does not + // necessarily mean that the boosted item will be the top result at all + // times, nor that other items will be excluded. Results could still be + // shown even when none of them matches the condition. And results that + // are significantly more relevant to the search query can still trump + // your heavily favored but irrelevant items. + // + // Setting to -1.0 gives the item a big demotion. However, results that + // are deeply relevant might still be shown. The item will have an + // upstream battle to get a fairly high ranking, but it is not blocked out + // completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 1; + + // The filter can have a max size of 5000 characters. + // An expression which specifies which products to apply an action to. + // The syntax and supported fields are the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] + // for detail syntax and limitations. + // + // Examples: + // + // * To boost products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue":
+ // *(id: ANY("product_1", "product_2"))
* + // *AND
* + // *(colorFamilies: ANY("Red", "Blue"))
* + string products_filter = 2; + } + + // * Rule Condition: + // - No [Condition][query_terms] provided is a global match. + // - 1 or more [Condition][query_terms] provided is combined with OR + // operator. + // * Action Input: The request query and filter that will be applied to the + // retrieved products, in addition to any filters already provided with the + // SearchRequest. The AND operator is used to combine the query's existing + // filters with the filter rule(s). NOTE: May result in 0 results when + // filters conflict. + // * Action Result: Filters the returned objects to be ONLY those that passed + // the filter. + message FilterAction { + // A filter to apply on the matching condition results. Supported features: + // + // * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be + // set. + // * Filter syntax is identical to + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]. + // See more + // details at the Retail Search + // [user guide](/retail/search/docs/filter-and-order#filter). + // * To filter products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue":
+ // *(id: ANY("product_1", "product_2"))
* + // *AND
* + // *(colorFamilies: ANY("Red", "Blue"))
* + string filter = 1; + } + + // Redirects a shopper to a specific page. + // * Rule Condition: + // - Must specify [Condition][query_terms]. + // * Action Input: Request Query + // * Action Result: Redirects shopper to provided uri. + message RedirectAction { + // URL must have length equal or less than 2000 characters. + string redirect_uri = 1; + } + + // Creates a set of terms that will be treated as synonyms of each other. + // Example: synonyms of "sneakers" and "shoes". + // * "sneakers" will use a synonym of "shoes". + // * "shoes" will use a synonym of "sneakers". + message TwowaySynonymsAction { + // Defines a set of synonyms. + // Can specify up to 100 synonyms. + // Must specify at least 2 synonyms. + repeated string synonyms = 1; + } + + // Maps a set of terms to a set of synonyms. + // Set of synonyms will be treated as synonyms of each query term only. + // `query_terms` will not be treated as synonyms of each other. + // Example: "sneakers" will use a synonym of "shoes". + // "shoes" will not use a synonym of "sneakers". + message OnewaySynonymsAction { + // Terms from the search query. + // Will treat synonyms as their synonyms. + // Not themselves synonyms of the synonyms. + // Can specify up to 100 terms. + repeated string query_terms = 3; + + // Defines a set of synonyms. + // Cannot contain duplicates. + // Can specify up to 100 synonyms. + repeated string synonyms = 4; + + // Will be [deprecated = true] post migration; + repeated string oneway_terms = 2; + } + + // Prevents `query_term` from being associated with specified terms during + // search. + // Example: Don't associate "gShoe" and "cheap". + message DoNotAssociateAction { + // Terms from the search query. + // Will not consider do_not_associate_terms for search if in search query. + // Can specify up to 100 terms. + repeated string query_terms = 2; + + // Cannot contain duplicates or the query term. + // Can specify up to 100 terms. + repeated string do_not_associate_terms = 3; + + // Will be [deprecated = true] post migration; + repeated string terms = 1; + } + + // Replaces a term in the query. Multiple replacement candidates can be + // specified. All `query_terms` will be replaced with the replacement term. + // Example: Replace "gShoe" with "google shoe". + message ReplacementAction { + // Terms from the search query. + // Will be replaced by replacement term. + // Can specify up to 100 terms. + repeated string query_terms = 2; + + // Term that will be used for replacement. + string replacement_term = 3; + + // Will be [deprecated = true] post migration; + string term = 1; + } + + // Prevents a term in the query from being used in search. + // Example: Don't search for "shoddy". + message IgnoreAction { + // Terms to ignore in the search query. + repeated string ignore_terms = 1; + } + + // An action must be provided. + oneof action { + // A boost action. + BoostAction boost_action = 2; + + // Redirects a shopper to a specific page. + RedirectAction redirect_action = 3; + + // Treats specific term as a synonym with a group of terms. + // Group of terms will not be treated as synonyms with the specific term. + OnewaySynonymsAction oneway_synonyms_action = 6; + + // Prevents term from being associated with other terms. + DoNotAssociateAction do_not_associate_action = 7; + + // Replaces specific terms in the query. + ReplacementAction replacement_action = 8; + + // Ignores specific terms from query during search. + IgnoreAction ignore_action = 9; + + // Filters results. + FilterAction filter_action = 10; + + // Treats a set of terms as synonyms of one another. + TwowaySynonymsAction twoway_synonyms_action = 11; + } + + // Required. The condition that triggers the rule. + // If the condition is empty, the rule will always apply. + Condition condition = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An intended audience of the [Product][google.cloud.retail.v2beta.Product] for +// whom it's sold. +message Audience { + // The genders of the audience. Strongly encouraged to use the standard + // values: "male", "female", "unisex". + // + // At most 5 values are allowed. Each value must be a UTF-8 encoded string + // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Google Merchant Center property + // [gender](https://support.google.com/merchants/answer/6324479). Schema.org + // property + // [Product.audience.suggestedGender](https://schema.org/suggestedGender). + repeated string genders = 1; + + // The age groups of the audience. Strongly encouraged to use the standard + // values: "newborn" (up to 3 months old), "infant" (3–12 months old), + // "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + // teens or older). + // + // At most 5 values are allowed. Each value must be a UTF-8 encoded string + // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // Google Merchant Center property + // [age_group](https://support.google.com/merchants/answer/6324463). + // Schema.org property + // [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + // [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + repeated string age_groups = 2; +} + +// The color information of a [Product][google.cloud.retail.v2beta.Product]. +message ColorInfo { + // The standard color families. Strongly recommended to use the following + // standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + // "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and + // "Mixed". Normally it is expected to have only 1 color family. May consider + // using single "Mixed" instead of multiple values. + // + // A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + repeated string color_families = 1; + + // The color display names, which may be different from standard color family + // names, such as the color aliases used in the website frontend. Normally + // it is expected to have only 1 color. May consider using single "Mixed" + // instead of multiple values. + // + // A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + repeated string colors = 2; +} + +// A custom attribute that is not explicitly modeled in +// [Product][google.cloud.retail.v2beta.Product]. +message CustomAttribute { + // The textual values of this custom attribute. For example, `["yellow", + // "green"]` when the key is "color". + // + // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or + // [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be + // set. Otherwise, an INVALID_ARGUMENT error is returned. + repeated string text = 1; + + // The numerical values of this custom attribute. For example, `[2.3, 15.4]` + // when the key is "lengths_cm". + // + // Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or + // [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be + // set. Otherwise, an INVALID_ARGUMENT error is returned. + repeated double numbers = 2; + + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2beta.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // searchable by text queries in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // This field is ignored in a + // [UserEvent][google.cloud.retail.v2beta.UserEvent]. + // + // Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is + // set. Otherwise, a INVALID_ARGUMENT error is returned. + optional bool searchable = 3; + + // This field will only be used when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // of the [Catalog][google.cloud.retail.v2beta.Catalog] is + // 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are + // indexed, so that it can be filtered, faceted or boosted in + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // This field is ignored in a + // [UserEvent][google.cloud.retail.v2beta.UserEvent]. + // + // See + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter], + // [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs] + // and + // [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec] + // for more details. + optional bool indexable = 4; +} + +// Fulfillment information, such as the store IDs for in-store pickup or region +// IDs for different shipping methods. +message FulfillmentInfo { + // The fulfillment type, including commonly used types (such as pickup in + // store and same day delivery), and custom types. Customers have to map + // custom types to their display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + string type = 1; + + // The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type], + // such as the store IDs for + // [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type] + // or the region IDs for + // [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type]. + // + // A maximum of 3000 values are allowed. Each value must be a string with a + // length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + // as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string place_ids = 2; +} + +// [Product][google.cloud.retail.v2beta.Product] image. Recommendations AI and +// Retail Search do not use product images to improve prediction and search +// results. However, product images can be returned in results, and are shown in +// prediction or search previews in the console. +message Image { + // Required. URI of the image. + // + // This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Google Merchant Center property + // [image_link](https://support.google.com/merchants/answer/6324350). + // Schema.org property [Product.image](https://schema.org/image). + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Height of the image in number of pixels. + // + // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 height = 2; + + // Width of the image in number of pixels. + // + // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 width = 3; +} + +// A floating point interval. +message Interval { + // The lower bound of the interval. If neither of the min fields are set, then + // the lower bound is negative infinity. + // + // This field must be not larger than + // [max][google.cloud.retail.v2beta.Interval.max]. Otherwise, an + // INVALID_ARGUMENT error is returned. + oneof min { + // Inclusive lower bound. + double minimum = 1; + + // Exclusive lower bound. + double exclusive_minimum = 2; + } + + // The upper bound of the interval. If neither of the max fields are set, then + // the upper bound is positive infinity. + // + // This field must be not smaller than + // [min][google.cloud.retail.v2beta.Interval.min]. Otherwise, an + // INVALID_ARGUMENT error is returned. + oneof max { + // Inclusive upper bound. + double maximum = 3; + + // Exclusive upper bound. + double exclusive_maximum = 4; + } +} + +// The price information of a [Product][google.cloud.retail.v2beta.Product]. +message PriceInfo { + // The price range of all + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]. + message PriceRange { + // The inclusive + // [Product.pricing_info.price][google.cloud.retail.v2beta.PriceInfo.price] + // interval of all + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]. + Interval price = 1; + + // The inclusive + // [Product.pricing_info.original_price][google.cloud.retail.v2beta.PriceInfo.original_price] + // internal of all + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product] having the same + // [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]. + Interval original_price = 2; + } + + // The 3-letter currency code defined in [ISO + // 4217](https://www.iso.org/iso-4217-currency-codes.html). + // + // If this field is an unrecognizable currency code, an INVALID_ARGUMENT + // error is returned. + // + // The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s with the same + // [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id] + // must share the same + // [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code]. + // Otherwise, a FAILED_PRECONDITION error is returned. + string currency_code = 1; + + // Price of the product. + // + // Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). Schema.org + // property [Offer.price](https://schema.org/price). + float price = 2; + + // Price of the product without any discount. If zero, by default set to be + // the [price][google.cloud.retail.v2beta.PriceInfo.price]. + float original_price = 3; + + // The costs associated with the sale of a particular product. Used for gross + // profit reporting. + // + // * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] - + // [cost][google.cloud.retail.v2beta.PriceInfo.cost] + // + // Google Merchant Center property + // [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + float cost = 4; + + // The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price] + // starts to be effective. This can be set as a future timestamp, and the + // [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search + // after + // [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time]. + // If so, the + // [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must + // be set and + // [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is + // used before + // [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time]. + // + // Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always + // effective because it will cause additional latency during search. + google.protobuf.Timestamp price_effective_time = 5; + + // The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price] + // stops to be effective. The + // [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search + // before + // [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time]. + // If this field is set, the + // [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must + // be set and + // [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is + // used after + // [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time]. + // + // Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always + // effective because it will cause additional latency during search. + google.protobuf.Timestamp price_expire_time = 6; + + // Output only. The price range of all the child + // [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s grouped together on the + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]. Only populated for + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]s. + // + // Note: This field is OUTPUT_ONLY for + // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]. + // Do not set this field in API requests. + PriceRange price_range = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The rating of a [Product][google.cloud.retail.v2beta.Product]. +message Rating { + // The total number of ratings. This value is independent of the value of + // [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram]. + // + // This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + // returned. + int32 rating_count = 1; + + // The average rating of the [Product][google.cloud.retail.v2beta.Product]. + // + // The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + // returned. + float average_rating = 2; + + // List of rating counts per rating value (index = rating - 1). The list is + // empty if there is no rating. If the list is non-empty, its size is + // always 5. Otherwise, an INVALID_ARGUMENT error is returned. + // + // For example, [41, 14, 13, 47, 303]. It means that the + // [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star, + // 14 ratings with 2 star, and so on. + repeated int32 rating_histogram = 3; +} + +// Information of an end user. +message UserInfo { + // Highly recommended for logged-in users. Unique identifier for logged-in + // user, such as a user name. + // + // Always use a hashed value for this ID. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string user_id = 1; + + // The end user's IP address. This field is used to extract location + // information for personalization. + // + // This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + // address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // This should not be set when: + // + // * setting + // [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info]. + // * using the JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent] + // or if + // [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request] + // is set. + string ip_address = 2; + + // User agent as included in the HTTP header. Required for getting + // [SearchResponse.sponsored_results][google.cloud.retail.v2beta.SearchResponse.sponsored_results]. + // + // The field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This should not be set when using the client side event reporting with + // GTM or JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent] + // or if + // [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request] + // is set. + string user_agent = 3; + + // True if the request is made directly from the end user, in which case the + // [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and + // [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be + // populated from the HTTP request. This flag should be set only if the API + // request is made directly from the end user such as a mobile app (and not if + // a gateway or a server is processing and pushing the user events). + // + // This should not be set when using the JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent]. + bool direct_user_request = 4; +} + +// The inventory information at a place (e.g. a store) identified +// by a place ID. +message LocalInventory { + // The place ID for the current set of inventory information. + string place_id = 1; + + // Product price and cost information. + // + // Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 2; + + // Additional local inventory attributes, for example, store name, promotion + // tags, etc. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * At most 30 attributes are allowed. + // * The key must be a UTF-8 encoded string with a length limit of 32 + // characters. + // * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + // key0LikeThis or KEY_1_LIKE_THIS. + // * The attribute values must be of the same type (text or number). + // * Only 1 value is allowed for each attribute. + // * For text values, the length limit is 256 UTF-8 characters. + // * The attribute does not support search. The `searchable` field should be + // unset or set to false. + // * The max summed total bytes of custom attribute keys and values per + // product is 5MiB. + map attributes = 3; + + // Input only. Supported fulfillment types. Valid fulfillment type values + // include commonly used types (such as pickup in store and same day + // delivery), and custom types. Customers have to map custom types to their + // display names before rendering UI. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + // returned. + repeated string fulfillment_types = 4 + [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto new file mode 100644 index 00000000..6a1f2907 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto @@ -0,0 +1,199 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/import_config.proto"; +import "google/longrunning/operations.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 = "CompletionServiceProto"; +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"; + +// 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. +service CompletionService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // 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. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:completeQuery" + }; + } + + // Bulk import of processed completion dataset. + // + // Request processing is asynchronous. Partial updating is not supported. + // + // The operation is successfully finished only after the imported suggestions + // are indexed successfully and ready for serving. The process takes hours. + // + // This feature is only available for users who have Retail Search enabled. + // Please enable Retail Search on Cloud Console before using this feature. + rpc ImportCompletionData(ImportCompletionDataRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/completionData:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.ImportCompletionDataResponse" + metadata_type: "google.cloud.retail.v2beta.ImportMetadata" + }; + } +} + +// Auto-complete parameters. +message CompleteQueryRequest { + // Required. Catalog for which the completion is performed. + // + // Full resource name of catalog, such as + // `projects/*/locations/global/catalogs/default_catalog`. + string catalog = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The query used to generate suggestions. + // + // The maximum number of allowed characters is 255. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required field. A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able to + // uniquely identify a visitor on a single device. This unique identifier + // should not change if the visitor logs in or out of the website. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string visitor_id = 7; + + // The language filters applied to the output suggestions. If set, it should + // contain the language of the query. If not set, suggestions are returned + // without considering language restrictions. This is the BCP-47 language + // code, such as "en-US" or "sr-Latn". For more information, see [Tags for + // Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + // number of language codes is 3. + repeated string language_codes = 3; + + // The device type context for completion suggestions. + // It is useful to apply different suggestions on different device types, e.g. + // `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + // types. + // + // Supported formats: + // + // * `UNKNOWN_DEVICE_TYPE` + // + // * `DESKTOP` + // + // * `MOBILE` + // + // * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + string device_type = 4; + + // Determines which dataset to use for fetching completion. "user-data" will + // use the imported dataset through + // [CompletionService.ImportCompletionData][google.cloud.retail.v2beta.CompletionService.ImportCompletionData]. + // "cloud-retail" will use the dataset generated by cloud retail based on user + // events. If leave empty, it will use the "user-data". + // + // Current supported values: + // + // * user-data + // + // * cloud-retail + // This option requires additional allowlisting. Before using cloud-retail, + // contact Cloud Retail support team first. + string dataset = 6; + + // Completion max suggestions. If left unset or set to 0, then will fallback + // to the configured value + // [CompletionConfig.max_suggestions][google.cloud.retail.v2beta.CompletionConfig.max_suggestions]. + // + // The maximum allowed max suggestions is 20. If it is set higher, it will be + // capped by 20. + int32 max_suggestions = 5; +} + +// Response of the auto-complete query. +message CompleteQueryResponse { + // Resource that represents completion results. + message CompletionResult { + // The suggestion for the query. + string suggestion = 1; + + // Custom attributes for the suggestion term. + // * For "user-data", the attributes are additional custom attributes + // ingested through BigQuery. + // * For "cloud-retail", the attributes are product attributes generated + // by Cloud Retail. + map attributes = 2; + } + + // Recent search of this user. + message RecentSearchResult { + // The recent search query. + string recent_search = 1; + } + + // Results of the matching suggestions. The result list is ordered and the + // first result is top suggestion. + repeated CompletionResult completion_results = 1; + + // A unique complete token. This should be included in the + // [UserEvent.completion_detail][google.cloud.retail.v2beta.UserEvent.completion_detail] + // for search events resulting from this completion, which enables accurate + // attribution of complete model performance. + string attribution_token = 2; + + // Matched recent searches of this user. The maximum number of recent searches + // is 10. This field is a restricted feature. Contact Retail Search support + // team if you are interested in enabling it. + // + // This feature is only available when + // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id] + // field is set and [UserEvent][google.cloud.retail.v2beta.UserEvent] is + // imported. The recent searches satisfy the follow rules: + // * They are ordered from latest to oldest. + // * They are matched with + // [CompleteQueryRequest.query][google.cloud.retail.v2beta.CompleteQueryRequest.query] + // case insensitively. + // * They are transformed to lower cases. + // * They are UTF-8 safe. + // + // Recent searches are deduplicated. More recent searches will be reserved + // when duplication happens. + repeated RecentSearchResult recent_search_results = 3; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto new file mode 100644 index 00000000..e5562227 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto @@ -0,0 +1,84 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/search_service.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 = "ControlProto"; +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"; + +// Configures dynamic serving time metadata that is used to pre and post +// process search/recommendation model results. +message Control { + option (google.api.resource) = { + type: "retail.googleapis.com/Control" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}" + }; + + // The behavior/type of the control + // + // A behavior/type must be specified on creation. Type cannot be changed once + // specified (e.g. A Rule control will always be a Rule control.). An + // INVALID_ARGUMENT will be returned if either condition is violated. + oneof control { + // A facet specification to perform faceted search. + SearchRequest.FacetSpec facet_spec = 3; + + // A rule control - a condition-action pair. + // Enacts a set action when the condition is triggered. + // For example: Boost "gShoe" when query full matches "Running Shoes". + Rule rule = 4; + } + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/controls/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable control display name. Used in Retail UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + 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. + // + // 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. + repeated SolutionType solution_types = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto new file mode 100644 index 00000000..922c46f2 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto @@ -0,0 +1,184 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/control.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 = "ControlServiceProto"; +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 modifying Control. +service ControlService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Control. + // + // If the [Control][google.cloud.retail.v2beta.Control] to create already + // exists, an ALREADY_EXISTS error is returned. + rpc CreateControl(CreateControlRequest) returns (Control) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls" + body: "control" + }; + option (google.api.method_signature) = "parent,control,control_id"; + } + + // Deletes a Control. + // + // If the [Control][google.cloud.retail.v2beta.Control] to delete does not + // exist, a NOT_FOUND error is returned. + rpc DeleteControl(DeleteControlRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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 + // NOT_FOUND error is returned. + rpc UpdateControl(UpdateControlRequest) returns (Control) { + option (google.api.http) = { + patch: "/v2beta/{control.name=projects/*/locations/*/catalogs/*/controls/*}" + body: "control" + }; + option (google.api.method_signature) = "control,update_mask"; + } + + // Gets a Control. + rpc GetControl(GetControlRequest) returns (Control) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/controls/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all Controls linked to this catalog. + rpc ListControls(ListControlsRequest) returns (ListControlsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for CreateControl method. +message CreateControlRequest { + // Required. Full resource name of parent catalog. 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 Control to create. + Control control = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Control, which will become the final + // component of the Control's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string control_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateControl method. +message UpdateControlRequest { + // Required. The Control to update. + Control control = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Control][google.cloud.retail.v2beta.Control] to update. The following are + // NOT supported: + // + // * [Control.name][google.cloud.retail.v2beta.Control.name] + // + // If not set or empty, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for DeleteControl method. +message DeleteControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for GetControl method. +message GetControlRequest { + // Required. The resource name of the Control to delete. Format: + // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Control" } + ]; +} + +// Request for ListControls method. +message ListControlsRequest { + // Required. The catalog resource name. 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 `ListControls` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter to apply on the list results. Supported features: + // + // * List all the products under the parent branch if + // [filter][google.cloud.retail.v2beta.ListControlsRequest.filter] is unset. + // * List controls that are used in a single ServingConfig: + // 'serving_config = "boosted_home_page_cvr"' + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListControls method. +message ListControlsResponse { + // All the Controls for a given catalog. + repeated Control controls = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto new file mode 100644 index 00000000..249f5011 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto @@ -0,0 +1,77 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.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 = "ExportConfigProto"; +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"; + +// Configuration of destination for Export related errors. +message ExportErrorsConfig { + // Required. Errors destination. + oneof destination { + // Google Cloud Storage path for import errors. This must be an empty, + // existing Cloud Storage bucket. Export errors will be written to a file in + // this bucket, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Metadata related to the progress of the Export operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ExportMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} + +// Response of the ExportProductsRequest. If the long running +// operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportProductsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ExportErrorsConfig errors_config = 2; +} + +// Response of the ExportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ExportErrorsConfig errors_config = 2; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto new file mode 100644 index 00000000..c1390ab0 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto @@ -0,0 +1,397 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/product.proto"; +import "google/cloud/retail/v2beta/user_event.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.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 = "ImportConfigProto"; +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"; + +// 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, + // `gs://bucket/directory/object.json`) or a pattern matching one or more + // files, such as `gs://bucket/directory/*.json`. A request can + // contain at most 100 files, and each file can be up to 2 GB. See + // [Importing product + // information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) + // for the expected file format and setup instructions. + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; + + // The schema to use when parsing the data from the source. + // + // Supported values for product imports: + // + // * `product` (default): One JSON + // [Product][google.cloud.retail.v2beta.Product] per line. Each product must + // have a valid [Product.id][google.cloud.retail.v2beta.Product.id]. + // * `product_merchant_center`: See [Importing catalog data from Merchant + // Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + // + // Supported values for user events imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.retail.v2beta.UserEvent] per line. + // * `user_event_ga360`: Using + // https://support.google.com/analytics/answer/3437719. + // + // Supported values for control imports: + // + // * 'control' (default): One JSON + // [Control][google.cloud.retail.v2beta.Control] per line. + // + // Supported values for catalog attribute imports: + // + // * 'catalog_attribute' (default): One CSV + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. + string data_schema = 2; +} + +// BigQuery source import data from. +message BigQuerySource { + // BigQuery table partition info. Leave this empty if the BigQuery table + // is not partitioned. + 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`. + google.type.Date partition_date = 6; + } + + // The project ID (can be project # or ID) that the BigQuery source is in with + // a length limit of 128 characters. If not specified, inherits the project + // ID from the parent request. + string project_id = 5; + + // Required. The BigQuery data set to copy the data from with a length limit + // of 1,024 characters. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to copy the data from with a length limit of + // 1,024 characters. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // BigQuery export to a specific Cloud Storage directory. + string gcs_staging_dir = 3; + + // The schema to use when parsing the data from the source. + // + // Supported values for product imports: + // + // * `product` (default): One JSON + // [Product][google.cloud.retail.v2beta.Product] per line. Each product must + // have a valid [Product.id][google.cloud.retail.v2beta.Product.id]. + // * `product_merchant_center`: See [Importing catalog data from Merchant + // Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + // + // Supported values for user events imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.retail.v2beta.UserEvent] per line. + // * `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. + // The schema is available here: + // https://support.google.com/analytics/answer/7029846. + // + // Supported values for auto-completion imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. + string data_schema = 4; +} + +// The inline source for the input config for ImportProducts method. +message ProductInlineSource { + // Required. A list of products to update/create. Each product must have a + // valid [Product.id][google.cloud.retail.v2beta.Product.id]. Recommended max + // of 100 items. + repeated Product products = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The inline source for the input config for ImportUserEvents method. +message UserEventInlineSource { + // Required. A list of user events to import. Recommended max of 10k items. + repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration of destination for Import related errors. +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 + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Request message for Import methods. +message ImportProductsRequest { + // Indicates how imported products are reconciled with the existing products + // created or imported before. + enum ReconciliationMode { + // Defaults to INCREMENTAL. + RECONCILIATION_MODE_UNSPECIFIED = 0; + + // Inserts new products or updates existing products. + INCREMENTAL = 1; + + // 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; + } + + // Required. + // `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + // + // If no updateMask is specified, requires products.create permission. + // If updateMask is specified, requires products.update permission. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Deprecated. This field has no effect. + string request_id = 6 [deprecated = true]; + + // Required. The desired input location of the data. + ProductInputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + google.protobuf.FieldMask update_mask = 4; + + // The mode of reconciliation between existing products and the products to be + // imported. Defaults to + // [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. + ReconciliationMode reconciliation_mode = 5; + + // 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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. + string notification_pubsub_topic = 7; +} + +// Request message for the ImportUserEvents request. +message ImportUserEventsRequest { + // Required. `projects/1234/locations/global/catalogs/default_catalog` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The desired input location of the data. + UserEventInputConfig input_config = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The desired location of errors incurred during the Import. Cannot be set + // for inline user event imports. + ImportErrorsConfig errors_config = 3; +} + +// Request message for ImportCompletionData methods. +message ImportCompletionDataRequest { + // Required. The catalog which the suggestions dataset belongs to. + // + // Format: `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // Required. The desired input location of the data. + CompletionDataInputConfig input_config = 2 + [(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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + string notification_pubsub_topic = 3; +} + +// The input config source for products. +message ProductInputConfig { + // Required. The source of the input. + oneof source { + // The Inline source for the input content for products. + ProductInlineSource product_inline_source = 1; + + // Google Cloud Storage location for the input content. + GcsSource gcs_source = 2; + + // BigQuery input source. + BigQuerySource big_query_source = 3; + } +} + +// The input config source for user events. +message UserEventInputConfig { + // The source of the input. + oneof source { + // Required. The Inline source for the input content for UserEvents. + UserEventInlineSource user_event_inline_source = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Google Cloud Storage location for the input content. + GcsSource gcs_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. BigQuery input source. + BigQuerySource big_query_source = 3 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// The input config source for completion data. +message CompletionDataInputConfig { + // The source of the input. + // + // Supported + // [BigQuerySource.data_schema][google.cloud.retail.v2beta.BigQuerySource.data_schema] + // values for suggestions imports: + // + // * `suggestions` (default): One JSON completion suggestion per line. + // * `denylist`: One JSON deny suggestion per line. + // * `allowlist`: One JSON allow suggestion per line. + oneof source { + // Required. BigQuery input source. + // + // 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. + BigQuerySource big_query_source = 1 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// Metadata related to the progress of the Import operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ImportMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were processed successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; + + // Deprecated. This field is never set. + 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 + // [Operation][google.longrunning.Operation]. + // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + string notification_pubsub_topic = 6; +} + +// Response of the +// [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest]. If +// the long running operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportProductsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ImportErrorsConfig errors_config = 2; +} + +// Response of the ImportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ImportErrorsConfig errors_config = 2; + + // Aggregated statistics of user event import status. + UserEventImportSummary import_summary = 3; +} + +// A summary of import result. The UserEventImportSummary summarizes +// the import status for user events. +message UserEventImportSummary { + // Count of user events imported with complete existing catalog information. + int64 joined_events_count = 1; + + // Count of user events imported, but with catalog information not found + // in the imported catalog. + int64 unjoined_events_count = 2; +} + +// Response of the +// [ImportCompletionDataRequest][google.cloud.retail.v2beta.ImportCompletionDataRequest]. +// If the long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +message ImportCompletionDataResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto new file mode 100644 index 00000000..c5ec1871 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto @@ -0,0 +1,194 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/retail/v2beta/user_event.proto"; +import "google/protobuf/struct.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 = "PredictionServiceProto"; +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 making recommendation prediction. +service PredictionService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Makes a recommendation prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict" + body: "*" + }; + } +} + +// Request message for Predict method. +message PredictRequest { + // Required. Full resource name of the format: + // {name=projects/*/locations/global/catalogs/default_catalog/placements/*} + // The ID of the Recommendations AI placement. Before you can request + // predictions from your model, you must create at least one placement for it. + // For more information, see [Managing + // placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). + // + // The full list of available placements can be seen at + // https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements + string placement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Context about the user, what they are looking at and what action + // they took to trigger the predict request. Note that this user event detail + // won't be ingested to userEvent logs. Thus, a separate userEvent write + // request is required for event logging. + 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. + int32 page_size = 3; + + // The previous PredictResponse.next_page_token. + string page_token = 4; + + // Filter for restricting prediction results with a length limit of 5,000 + // characters. Accepts values for tags and the `filterOutOfStockItems` flag. + // + // * Tag expressions. Restricts predictions to products that match all of the + // specified tags. Boolean operators `OR` and `NOT` are supported if the + // expression is enclosed in parentheses, and must be separated from the + // tag values by a space. `-"tagA"` is also supported and is equivalent to + // `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + // with a size limit of 1,000 characters. + // + // Note: "Recently viewed" models don't support tag filtering at the + // moment. + // + // * filterOutOfStockItems. Restricts predictions to products that do not + // have a + // stockState value of OUT_OF_STOCK. + // + // Examples: + // + // * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + // * filterOutOfStockItems tag=(-"promotional") + // * filterOutOfStockItems + // + // If your filter blocks all prediction results, the API will return generic + // (unfiltered) popular products. If you only want results strictly matching + // the filters, set `strictFiltering` to True in `PredictRequest.params` to + // receive empty results instead. + // Note that the API will never return items with storageStatus of "EXPIRED" + // or "DELETED" regardless of filter choices. + string filter = 5; + + // Use validate only mode for this prediction query. If set to true, a + // dummy model will be used that returns arbitrary products. + // Note that the validate only mode should only be used for testing the API, + // or if the model is not ready. + bool validate_only = 6; + + // Additional domain specific parameters for the predictions. + // + // Allowed values: + // + // * `returnProduct`: Boolean. If set to true, the associated product + // object will be returned in the `results.metadata` field in the + // prediction response. + // * `returnScore`: Boolean. If set to true, the prediction 'score' + // corresponding to each returned product will be set in the + // `results.metadata` field in the prediction response. The given + // 'score' indicates the probability of an product being clicked/purchased + // given the user's context and history. + // * `strictFiltering`: Boolean. True by default. If set to false, the service + // will return generic (unfiltered) popular products instead of empty if + // your filter blocks all prediction results. + // * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + // it needs to be one of {'no-price-reranking', 'low-price-reranking', + // 'medium-price-reranking', 'high-price-reranking'}. This gives + // request-level control and adjusts prediction results based on product + // price. + // * `diversityLevel`: String. Default empty. If set to be non-empty, then + // it needs to be one of {'no-diversity', 'low-diversity', + // 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + // request-level control and adjusts prediction results based on product + // category. + map params = 7; + + // The labels applied to a resource must meet the following requirements: + // + // * Each resource can have multiple labels, up to a maximum of 64. + // * Each label must be a key-value pair. + // * Keys have a minimum length of 1 character and a maximum length of 63 + // characters, and cannot be empty. Values can be empty, and have a maximum + // length of 63 characters. + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. All characters must use UTF-8 encoding, and + // international characters are allowed. + // * The key portion of a label must be unique. However, you can use the same + // key with multiple resources. + // * Keys must start with a lowercase letter or international character. + // + // See [Google Cloud + // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map labels = 8; +} + +// Response message for predict method. +message PredictResponse { + // PredictionResult represents the recommendation prediction results. + message PredictionResult { + // ID of the recommended product + string id = 1; + + // Additional product metadata / annotations. + // + // Possible values: + // + // * `product`: JSON representation of the product. Will be set if + // `returnProduct` is set to true in `PredictRequest.params`. + // * `score`: Prediction score in double value. Will be set if + // `returnScore` is set to true in `PredictRequest.params`. + map metadata = 2; + } + + // A list of recommended products. The order represents the ranking (from the + // most relevant product to the least). + repeated PredictionResult results = 1; + + // A unique attribution token. This should be included in the + // [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this + // recommendation, which enables accurate attribution of recommendation model + // performance. + string attribution_token = 2; + + // IDs of products in the request that were missing from the inventory. + repeated string missing_ids = 3; + + // True if the validateOnly property was set in the request. + bool validate_only = 4; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto new file mode 100644 index 00000000..4e6dfec8 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto @@ -0,0 +1,566 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/promotion.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.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 = "ProductProto"; +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"; +option (google.api.resource_definition) = { + type: "retail.googleapis.com/Branch" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}" +}; + +// Product captures all metadata information of items to be recommended or +// searched. +message Product { + option (google.api.resource) = { + type: "retail.googleapis.com/Product" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}" + }; + + // The type of this product. + enum Type { + // Default value. Default to + // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type] + // if unset. + TYPE_UNSPECIFIED = 0; + + // The primary type. + // + // As the primary unit for predicting, indexing and search serving, a + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product] is grouped with multiple + // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s. + PRIMARY = 1; + + // The variant type. + // + // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s usually share some common + // attributes on the same + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]s, but they have variant + // attributes like different colors, sizes and prices, etc. + VARIANT = 2; + + // The collection type. Collection products are bundled + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]s or + // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s that are sold together, + // such as a jewelry set with necklaces, earrings and rings, etc. + COLLECTION = 3; + } + + // Product availability. If this field is unspecified, the product is + // assumed to be in stock. + enum Availability { + // Default product availability. Default to + // [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK] + // if unset. + AVAILABILITY_UNSPECIFIED = 0; + + // Product in stock. + IN_STOCK = 1; + + // Product out of stock. + OUT_OF_STOCK = 2; + + // Product that is in pre-order state. + PREORDER = 3; + + // Product that is back-ordered (i.e. temporarily out of stock). + BACKORDER = 4; + } + + oneof expiration { + // The timestamp when this product becomes unavailable for + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // If it is set, the [Product][google.cloud.retail.v2beta.Product] is not + // available for + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] + // after [expire_time][google.cloud.retail.v2beta.Product.expire_time]. + // However, the product can still be retrieved by + // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] + // and + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be + // later than + // [available_time][google.cloud.retail.v2beta.Product.available_time] and + // [publish_time][google.cloud.retail.v2beta.Product.publish_time], + // otherwise an INVALID_ARGUMENT error is thrown. + // + // Corresponding properties: Google Merchant Center property + // [expiration_date](https://support.google.com/merchants/answer/6324499). + google.protobuf.Timestamp expire_time = 16; + + // Input only. The TTL (time to live) of the product. + // + // If it is set, it must be a non-negative value, and + // [expire_time][google.cloud.retail.v2beta.Product.expire_time] is set as + // current timestamp plus [ttl][google.cloud.retail.v2beta.Product.ttl]. The + // derived [expire_time][google.cloud.retail.v2beta.Product.expire_time] is + // returned in the output and [ttl][google.cloud.retail.v2beta.Product.ttl] + // is left blank when retrieving the + // [Product][google.cloud.retail.v2beta.Product]. + // + // If it is set, the product is not available for + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] + // after current timestamp plus + // [ttl][google.cloud.retail.v2beta.Product.ttl]. However, the product can + // still be retrieved by + // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] + // and + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + google.protobuf.Duration ttl = 17 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Immutable. Full resource name of the product, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. [Product][google.cloud.retail.v2beta.Product] identifier, which + // is the final component of [name][google.cloud.retail.v2beta.Product.name]. + // For example, this field is "id_1", if + // [name][google.cloud.retail.v2beta.Product.name] is + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [id](https://support.google.com/merchants/answer/6324405). Schema.org + // property [Product.sku](https://schema.org/sku). + string id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of the product. Default to + // [Catalog.product_level_config.ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type] + // if unset. + Type type = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Variant group identifier. Must be an + // [id][google.cloud.retail.v2beta.Product.id], with the same parent branch + // with this product. Otherwise, an error is thrown. + // + // For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]s, this field can only be + // empty or set to the same value as + // [id][google.cloud.retail.v2beta.Product.id]. + // + // For VARIANT [Product][google.cloud.retail.v2beta.Product]s, this field + // cannot be empty. A maximum of 2,000 products are allowed to share the same + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [item_group_id](https://support.google.com/merchants/answer/6324507). + // Schema.org property + // [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + string primary_product_id = 4; + + // The [id][google.cloud.retail.v2beta.Product.id] of the collection members + // when [type][google.cloud.retail.v2beta.Product.type] is + // [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]. + // + // Non-existent product ids are allowed. + // 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 + // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + // return. + repeated string collection_member_ids = 5; + + // The Global Trade Item Number (GTIN) of the product. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Corresponding properties: Google Merchant Center property + // [gtin](https://support.google.com/merchants/answer/6324461). + // Schema.org property + // [Product.isbn](https://schema.org/isbn), + // [Product.gtin8](https://schema.org/gtin8), + // [Product.gtin12](https://schema.org/gtin12), + // [Product.gtin13](https://schema.org/gtin13), or + // [Product.gtin14](https://schema.org/gtin14). + // + // If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + string gtin = 6; + + // Product categories. This field is repeated for supporting one product + // 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 + // other character(s). + // + // For example, if a shoes product belongs to both + // ["Shoes & Accessories" -> "Shoes"] and + // ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + // represented as: + // + // "categories": [ + // "Shoes & Accessories > Shoes", + // "Sports & Fitness > Athletic Clothing > Shoes" + // ] + // + // Must be set for + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product] otherwise an INVALID_ARGUMENT + // error is returned. + // + // At most 250 values are allowed per + // [Product][google.cloud.retail.v2beta.Product]. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [google_product_category][mc_google_product_category]. Schema.org property + // [Product.category] (https://schema.org/category). + // + // [mc_google_product_category]: + // https://support.google.com/merchants/answer/6324436 + repeated string categories = 7; + + // Required. Product title. + // + // This field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [title](https://support.google.com/merchants/answer/6324415). Schema.org + // property [Product.name](https://schema.org/name). + string title = 8 [(google.api.field_behavior) = REQUIRED]; + + // The brands of the product. + // + // A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded + // string with a length limit of 1,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [brand](https://support.google.com/merchants/answer/6324351). Schema.org + // property [Product.brand](https://schema.org/brand). + repeated string brands = 9; + + // Product description. + // + // This field must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [description](https://support.google.com/merchants/answer/6324468). + // Schema.org property [Product.description](https://schema.org/description). + string description = 10; + + // Language of the title/description and other string attributes. Use language + // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // + // For product prediction, this field is ignored and the model automatically + // detects the text language. The + // [Product][google.cloud.retail.v2beta.Product] can include text in different + // languages, but duplicating [Product][google.cloud.retail.v2beta.Product]s + // to provide text in multiple languages can result in degraded model + // performance. + // + // For product search this field is in use. It defaults to "en-US" if unset. + string language_code = 11; + + // Highly encouraged. Extra product attributes to be included. For example, + // for products, this could include the store name, vendor, style, color, etc. + // These are very strong signals for recommendation model, thus we highly + // recommend providing the attributes here. + // + // Features that can take on one of a limited number of possible values. Two + // types of features can be set are: + // + // Textual features. some examples would be the brand/maker of a product, or + // country of a customer. Numerical features. Some examples would be the + // height/weight of a product, or age of a customer. + // + // For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + // "lengths_cm": {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} + // }`. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * Max entries count: 200. + // * The key must be a UTF-8 encoded string with a length limit of 128 + // characters. + // * For indexable attribute, the key must match the pattern: + // `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + // `KEY_1_LIKE_THIS`. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a non-empty UTF-8 encoded string with a + // length limit of 256 characters. + // * For number attributes, at most 400 values are allowed. + map attributes = 12; + + // Custom tags associated with the product. + // + // At most 250 values are allowed per + // [Product][google.cloud.retail.v2beta.Product]. This value must be a UTF-8 + // encoded string with a length limit of 1,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // This tag can be used for filtering recommendation results by passing the + // tag as part of the + // [PredictRequest.filter][google.cloud.retail.v2beta.PredictRequest.filter]. + // + // Corresponding properties: Google Merchant Center property + // [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + repeated string tags = 13; + + // Product price and cost information. + // + // Corresponding properties: Google Merchant Center property + // [price](https://support.google.com/merchants/answer/6324371). + PriceInfo price_info = 14; + + // The rating of this product. + Rating rating = 15; + + // The timestamp when this [Product][google.cloud.retail.v2beta.Product] + // becomes available for + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + google.protobuf.Timestamp available_time = 18; + + // The online availability of the + // [Product][google.cloud.retail.v2beta.Product]. Default to + // [Availability.IN_STOCK][google.cloud.retail.v2beta.Product.Availability.IN_STOCK]. + // + // Corresponding properties: Google Merchant Center property + // [availability](https://support.google.com/merchants/answer/6324448). + // Schema.org property [Offer.availability](https://schema.org/availability). + Availability availability = 19; + + // The available quantity of the item. + google.protobuf.Int32Value available_quantity = 20; + + // Fulfillment information, such as the store IDs for in-store pickup or + // region IDs for different shipping methods. + // + // All the elements must have distinct + // [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type]. + // Otherwise, an INVALID_ARGUMENT error is returned. + repeated FulfillmentInfo fulfillment_info = 21; + + // Canonical URL directly linking to the product detail page. + // + // It is strongly recommended to provide a valid uri for the product, + // otherwise the service performance could be significantly degraded. + // + // This field must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [link](https://support.google.com/merchants/answer/6324416). Schema.org + // property [Offer.url](https://schema.org/url). + string uri = 22; + + // Product images for the product. We highly recommend putting the main + // image first. + // + // A maximum of 300 images are allowed. + // + // Corresponding properties: Google Merchant Center property + // [image_link](https://support.google.com/merchants/answer/6324350). + // Schema.org property [Product.image](https://schema.org/image). + repeated Image images = 23; + + // The target group associated with a given audience (e.g. male, veterans, + // car owners, musicians, etc.) of the product. + Audience audience = 24; + + // The color of the product. + // + // Corresponding properties: Google Merchant Center property + // [color](https://support.google.com/merchants/answer/6324487). Schema.org + // property [Product.color](https://schema.org/color). + ColorInfo color_info = 25; + + // The size of the product. To represent different size systems or size types, + // consider using this format: [[[size_system:]size_type:]size_value]. + // + // For example, in "US:MENS:M", "US" represents size system; "MENS" represents + // size type; "M" represents size value. In "GIRLS:27", size system is empty; + // "GIRLS" represents size type; "27" represents size value. In "32 inches", + // both size system and size type are empty, while size value is "32 inches". + // + // A maximum of 20 values are allowed per + // [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [size](https://support.google.com/merchants/answer/6324492), + // [size_type](https://support.google.com/merchants/answer/6324497), and + // [size_system](https://support.google.com/merchants/answer/6324502). + // Schema.org property [Product.size](https://schema.org/size). + repeated string sizes = 26; + + // The material of the product. For example, "leather", "wooden". + // + // A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + // string with a length limit of 200 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [material](https://support.google.com/merchants/answer/6324410). Schema.org + // property [Product.material](https://schema.org/material). + repeated string materials = 27; + + // The pattern or graphic print of the product. For example, "striped", "polka + // dot", "paisley". + // + // A maximum of 20 values are allowed per + // [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + // property [Product.pattern](https://schema.org/pattern). + repeated string patterns = 28; + + // The condition of the product. Strongly encouraged to use the standard + // values: "new", "refurbished", "used". + // + // A maximum of 1 value is allowed per + // [Product][google.cloud.retail.v2beta.Product]. Each value must be a UTF-8 + // encoded string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // Corresponding properties: Google Merchant Center property + // [condition](https://support.google.com/merchants/answer/6324469). + // Schema.org property + // [Offer.itemCondition](https://schema.org/itemCondition). + repeated string conditions = 29; + + // The promotions applied to the product. A maximum of 10 values are allowed + // per [Product][google.cloud.retail.v2beta.Product]. Only + // [Promotion.promotion_id][google.cloud.retail.v2beta.Promotion.promotion_id] + // will be used, other fields will be ignored if set. + repeated Promotion promotions = 34; + + // The timestamp when the product is published by the retailer for the first + // time, which indicates the freshness of the products. Note that this field + // is different from + // [available_time][google.cloud.retail.v2beta.Product.available_time], given + // it purely describes product freshness regardless of when it is available on + // search and recommendation. + google.protobuf.Timestamp publish_time = 33; + + // Indicates which fields in the + // [Product][google.cloud.retail.v2beta.Product]s are returned in + // [SearchResponse][google.cloud.retail.v2beta.SearchResponse]. + // + // Supported fields for all [type][google.cloud.retail.v2beta.Product.type]s: + // + // * [audience][google.cloud.retail.v2beta.Product.audience] + // * [availability][google.cloud.retail.v2beta.Product.availability] + // * [brands][google.cloud.retail.v2beta.Product.brands] + // * [color_info][google.cloud.retail.v2beta.Product.color_info] + // * [conditions][google.cloud.retail.v2beta.Product.conditions] + // * [gtin][google.cloud.retail.v2beta.Product.gtin] + // * [materials][google.cloud.retail.v2beta.Product.materials] + // * [name][google.cloud.retail.v2beta.Product.name] + // * [patterns][google.cloud.retail.v2beta.Product.patterns] + // * [price_info][google.cloud.retail.v2beta.Product.price_info] + // * [rating][google.cloud.retail.v2beta.Product.rating] + // * [sizes][google.cloud.retail.v2beta.Product.sizes] + // * [title][google.cloud.retail.v2beta.Product.title] + // * [uri][google.cloud.retail.v2beta.Product.uri] + // + // Supported fields only for + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]: + // + // * [categories][google.cloud.retail.v2beta.Product.categories] + // * [description][google.cloud.retail.v2beta.Product.description] + // * [images][google.cloud.retail.v2beta.Product.images] + // + // Supported fields only for + // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]: + // + // * Only the first image in + // [images][google.cloud.retail.v2beta.Product.images] + // + // To mark [attributes][google.cloud.retail.v2beta.Product.attributes] as + // retrievable, include paths of the form "attributes.key" where "key" is the + // key of a custom attribute, as specified in + // [attributes][google.cloud.retail.v2beta.Product.attributes]. + // + // For [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], the + // following fields are always returned in + // [SearchResponse][google.cloud.retail.v2beta.SearchResponse] by default: + // + // * [name][google.cloud.retail.v2beta.Product.name] + // + // For [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT], the + // following fields are always returned in by default: + // + // * [name][google.cloud.retail.v2beta.Product.name] + // * [color_info][google.cloud.retail.v2beta.Product.color_info] + // + // Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Note: Returning more fields in + // [SearchResponse][google.cloud.retail.v2beta.SearchResponse] may increase + // response payload size and serving latency. + google.protobuf.FieldMask retrievable_fields = 30; + + // Output only. Product variants grouped together on primary product which + // share similar product attributes. It's automatically grouped by + // [primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id] + // for all the product variants. Only populated for + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]s. + // + // Note: This field is OUTPUT_ONLY for + // [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]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto new file mode 100644 index 00000000..0ad73436 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto @@ -0,0 +1,829 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/import_config.proto"; +import "google/cloud/retail/v2beta/product.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.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 = "ProductServiceProto"; +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 ingesting [Product][google.cloud.retail.v2beta.Product] +// information of the customer's website. +service ProductService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a [Product][google.cloud.retail.v2beta.Product]. + rpc CreateProduct(CreateProductRequest) returns (Product) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" + body: "product" + }; + option (google.api.method_signature) = "parent,product,product_id"; + } + + // Gets a [Product][google.cloud.retail.v2beta.Product]. + rpc GetProduct(GetProductRequest) returns (Product) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Product][google.cloud.retail.v2beta.Product]s. + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a [Product][google.cloud.retail.v2beta.Product]. + rpc UpdateProduct(UpdateProductRequest) returns (Product) { + option (google.api.http) = { + patch: "/v2beta/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + body: "product" + }; + option (google.api.method_signature) = "product,update_mask"; + } + + // Deletes a [Product][google.cloud.retail.v2beta.Product]. + rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. + // + // Request processing may be synchronous. No partial updating is supported. + // Non-existing items are created. + // + // Note that it is possible for a subset of the + // [Product][google.cloud.retail.v2beta.Product]s to be successfully updated. + rpc ImportProducts(ImportProductsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.ImportProductsResponse" + metadata_type: "google.cloud.retail.v2beta.ImportMetadata" + }; + } + + // Updates inventory information for a + // [Product][google.cloud.retail.v2beta.Product] while respecting the last + // update timestamps of each inventory field. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2beta.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, updates are not immediately manifested in the + // [Product][google.cloud.retail.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // When inventory is updated with + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] + // and + // [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 + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or + // [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. + // + // 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. + // + // Pre-existing inventory information can only be updated with + // [SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], + // [AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], + // and + // [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. + rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" + body: "*" + }; + option (google.api.method_signature) = "inventory,set_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.SetInventoryResponse" + metadata_type: "google.cloud.retail.v2beta.SetInventoryMetadata" + }; + } + + // Incrementally adds place IDs to + // [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2beta.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, the added place IDs are not immediately manifested in the + // [Product][google.cloud.retail.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [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. + rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.AddFulfillmentPlacesResponse" + metadata_type: "google.cloud.retail.v2beta.AddFulfillmentPlacesMetadata" + }; + } + + // Incrementally removes place IDs from a + // [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2beta.Product] to exist before updating + // fulfillment information. If the request is valid, the update will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, the removed place IDs are not immediately manifested in the + // [Product][google.cloud.retail.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [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. + rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.RemoveFulfillmentPlacesResponse" + metadata_type: "google.cloud.retail.v2beta.RemoveFulfillmentPlacesMetadata" + }; + } + + // Updates local inventory information for a + // [Product][google.cloud.retail.v2beta.Product] at a list of places, while + // respecting the last update timestamps of each inventory field. + // + // This process is asynchronous and does not require the + // [Product][google.cloud.retail.v2beta.Product] to exist before updating + // inventory information. If the request is valid, the update will be enqueued + // and processed downstream. As a consequence, when a response is returned, + // updates are not immediately manifested in the + // [Product][google.cloud.retail.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // Local inventory information can only be modified using this method. + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] + // and + // [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. + rpc AddLocalInventories(AddLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.AddLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2beta.AddLocalInventoriesMetadata" + }; + } + + // Remove local inventory information for a + // [Product][google.cloud.retail.v2beta.Product] at a list of places at a + // removal timestamp. + // + // This process is asynchronous. If the request is valid, the removal will be + // enqueued and processed downstream. As a consequence, when a response is + // returned, removals are not immediately manifested in the + // [Product][google.cloud.retail.v2beta.Product] queried by + // [GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or + // [ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // Local inventory information can only be removed using this method. + // [CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] + // and + // [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. + rpc RemoveLocalInventories(RemoveLocalInventoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories" + body: "*" + }; + option (google.api.method_signature) = "product"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.RemoveLocalInventoriesResponse" + metadata_type: "google.cloud.retail.v2beta.RemoveLocalInventoriesMetadata" + }; + } +} + +// Request message for [CreateProduct][] method. +message CreateProductRequest { + // Required. The parent catalog resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Required. The [Product][google.cloud.retail.v2beta.Product] to create. + Product product = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Product][google.cloud.retail.v2beta.Product], which will become the final + // component of the [Product.name][google.cloud.retail.v2beta.Product.name]. + // + // If the caller does not have permission to create the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + // + // This field must be unique among all + // [Product][google.cloud.retail.v2beta.Product]s with the same + // [parent][google.cloud.retail.v2beta.CreateProductRequest.parent]. + // Otherwise, an ALREADY_EXISTS error is returned. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string product_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [GetProduct][] method. +message GetProductRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + // + // If the requested [Product][google.cloud.retail.v2beta.Product] does not + // exist, a NOT_FOUND error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + +// Request message for [UpdateProduct][] method. +message UpdateProductRequest { + // Required. The product to update/create. + // + // If the caller does not have permission to update the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2beta.Product] to update does not + // exist and + // [allow_missing][google.cloud.retail.v2beta.UpdateProductRequest.allow_missing] + // is not set, a NOT_FOUND error is returned. + Product product = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Product][google.cloud.retail.v2beta.Product] to update. The immutable and + // output only fields are NOT supported. If not set, all supported fields (the + // fields that are neither immutable nor output only) are updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, a new [Product][google.cloud.retail.v2beta.Product] will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for [DeleteProduct][] method. +message DeleteProductRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to delete the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2beta.Product] to delete does not + // exist, a NOT_FOUND error is returned. + // + // The [Product][google.cloud.retail.v2beta.Product] to delete can neither be + // a + // [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2beta.Product] member nor a + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product] with more than one + // [variants][google.cloud.retail.v2beta.Product.Type.VARIANT]. Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // All inventory information for the named + // [Product][google.cloud.retail.v2beta.Product] will be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + +// Request message for +// [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] +// method. +message ListProductsRequest { + // Required. The parent branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + // `default_branch` as the branch ID, to list products under the default + // branch. + // + // If the caller does not have permission to list + // [Product][google.cloud.retail.v2beta.Product]s under this branch, + // regardless of whether or not this branch exists, a PERMISSION_DENIED error + // is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return. + // If unspecified, defaults to 100. The maximum allowed value is 1000. Values + // above 1000 will be coerced to 1000. + // + // If this field is negative, an INVALID_ARGUMENT error is returned. + int32 page_size = 2; + + // A page token + // [ListProductsResponse.next_page_token][google.cloud.retail.v2beta.ListProductsResponse.next_page_token], + // received from a previous + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 3; + + // A filter to apply on the list results. Supported features: + // + // * List all the products under the parent branch if + // [filter][google.cloud.retail.v2beta.ListProductsRequest.filter] is unset. + // * List + // [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s sharing the same + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product]. For example: + // `primary_product_id = "some_product_id"` + // * List [Product][google.cloud.retail.v2beta.Product]s bundled in a + // [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2beta.Product]. + // For example: + // `collection_product_id = "some_product_id"` + // * List [Product][google.cloud.retail.v2beta.Product]s with a partibular + // type. For example: + // `type = "PRIMARY"` + // `type = "VARIANT"` + // `type = "COLLECTION"` + // + // If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + // + // If the specified + // [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] + // [Product][google.cloud.retail.v2beta.Product] or + // [Product.Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION] + // [Product][google.cloud.retail.v2beta.Product] does not exist, a NOT_FOUND + // error is returned. + string filter = 4; + + // The fields of [Product][google.cloud.retail.v2beta.Product] to return in + // the responses. If not set or empty, the following fields are returned: + // + // * [Product.name][google.cloud.retail.v2beta.Product.name] + // * [Product.id][google.cloud.retail.v2beta.Product.id] + // * [Product.title][google.cloud.retail.v2beta.Product.title] + // * [Product.uri][google.cloud.retail.v2beta.Product.uri] + // * [Product.images][google.cloud.retail.v2beta.Product.images] + // * [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + // * [Product.brands][google.cloud.retail.v2beta.Product.brands] + // + // If "*" is provided, all fields are returned. + // [Product.name][google.cloud.retail.v2beta.Product.name] is always returned + // no matter what mask is set. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for +// [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] +// method. +message ListProductsResponse { + // The [Product][google.cloud.retail.v2beta.Product]s. + repeated Product products = 1; + + // A token that can be sent as + // [ListProductsRequest.page_token][google.cloud.retail.v2beta.ListProductsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for [SetInventory][] method. +message SetInventoryRequest { + // Required. The inventory information to update. The allowable fields to + // update are: + // * [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + // * [Product.availability][google.cloud.retail.v2beta.Product.availability] + // * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity] + // * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info] + // The updated inventory fields must be specified in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]. + // + // If [SetInventoryRequest.inventory.name][] is empty or invalid, an + // INVALID_ARGUMENT error is returned. + // + // If the caller does not have permission to update the + // [Product][google.cloud.retail.v2beta.Product] named in + // [Product.name][google.cloud.retail.v2beta.Product.name], regardless of + // whether or not it exists, a PERMISSION_DENIED error is returned. + // + // If the [Product][google.cloud.retail.v2beta.Product] to update does not + // have existing inventory information, the provided inventory information + // will be inserted. + // + // If the [Product][google.cloud.retail.v2beta.Product] to update has existing + // inventory information, the provided inventory information will be merged + // while respecting the last update time for each inventory field, using the + // provided or default value for + // [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time]. + // + // The caller can replace place IDs for a subset of fulfillment types in the + // following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types and corresponding place IDs + // to update in [SetInventoryRequest.inventory.fulfillment_info][] + // + // The caller can clear all place IDs from a subset of fulfillment types in + // the following ways: + // + // * Adds "fulfillment_info" in + // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask] + // * Specifies only the desired fulfillment types to clear in + // [SetInventoryRequest.inventory.fulfillment_info][] + // * Checks that only the desired fulfillment info types have empty + // [SetInventoryRequest.inventory.fulfillment_info.place_ids][] + // + // The last update time is recorded for the following inventory fields: + // * [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + // * [Product.availability][google.cloud.retail.v2beta.Product.availability] + // * [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity] + // * [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info] + // + // If a full overwrite of inventory information while ignoring timestamps is + // needed, [UpdateProduct][] should be invoked instead. + Product inventory = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided + // [Product][google.cloud.retail.v2beta.Product] to update. + // + // At least one field must be provided. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask set_mask = 2; + + // The time when the request is issued, used to prevent + // out-of-order updates on inventory fields with the last update time + // recorded. If not provided, the internal system time will be used. + google.protobuf.Timestamp set_time = 3; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] with + // name [Product.name][google.cloud.retail.v2beta.Product.name] is not found, + // the inventory update will still be processed and retained for at most 1 day + // until the [Product][google.cloud.retail.v2beta.Product] is created. If set + // to false, a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 4; +} + +// Metadata related to the progress of the SetInventory operation. +// Currently empty because there is no meaningful metadata populated from the +// [SetInventory][] method. +message SetInventoryMetadata {} + +// Response of the SetInventoryRequest. Currently empty because +// there is no meaningful response populated from the [SetInventory][] +// method. +message SetInventoryResponse {} + +// Request message for [AddFulfillmentPlaces][] method. +message AddFulfillmentPlacesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. The fulfillment type, including commonly used types (such as + // pickup in store and same day delivery), and custom types. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // This field directly corresponds to [Product.fulfillment_info.type][]. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IDs for this + // [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type], such + // as the store IDs for "pickup-in-store" or the region IDs for + // "same-day-delivery" to be added for this + // [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type]. + // Duplicate IDs will be automatically ignored. + // + // At least 1 value is required, and a maximum of 2000 values are allowed. + // Each value must be a string with a length limit of 10 characters, matching + // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + // INVALID_ARGUMENT error is returned. + // + // If the total number of place IDs exceeds 2000 for this + // [type][google.cloud.retail.v2beta.AddFulfillmentPlacesRequest.type] after + // adding, then the update will be rejected. + repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED]; + + // The time when the fulfillment updates are issued, used to prevent + // out-of-order updates on fulfillment information. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 4; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the fulfillment information will still be processed and retained + // for at most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 5; +} + +// Metadata related to the progress of the AddFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddFulfillmentPlaces][] method. +message AddFulfillmentPlacesMetadata {} + +// Response of the AddFulfillmentPlacesRequest. Currently empty because +// there is no meaningful response populated from the [AddFulfillmentPlaces][] +// method. +message AddFulfillmentPlacesResponse {} + +// Request message for [AddLocalInventories][] method. +message AddLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of inventory information at difference places. Each place + // is identified by its place ID. At most 3000 inventories are allowed per + // request. + repeated LocalInventory local_inventories = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Indicates which inventory fields in the provided list of + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory] to update. The + // field is updated to the provided value. + // + // If a field is set while the place does not have a previous local inventory, + // the local inventory at that store is created. + // + // If a field is set while the value of that field is not provided, the + // original field value, if it exists, is deleted. + // + // If the mask is not set or set with empty paths, all inventory fields will + // be updated. + // + // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + // is returned and the entire update will be ignored. + google.protobuf.FieldMask add_mask = 4; + + // The time when the inventory updates are issued. Used to prevent + // out-of-order updates on local inventory fields. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp add_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the local inventory will still be processed and retained for at + // most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 6; +} + +// Metadata related to the progress of the AddLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [AddLocalInventories][] method. +message AddLocalInventoriesMetadata {} + +// Response of the [AddLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [AddLocalInventories][] +// method. +message AddLocalInventoriesResponse {} + +// Request message for [RemoveLocalInventories][] method. +message RemoveLocalInventoriesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. A list of place IDs to have their inventory deleted. + // At most 3000 place IDs are allowed per request. + repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time when the inventory deletions are issued. Used to prevent + // out-of-order updates and deletions on local inventory fields. If not + // provided, the internal system time will be used. + google.protobuf.Timestamp remove_time = 5; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the local inventory removal request will still be processed and + // retained for at most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 3; +} + +// Metadata related to the progress of the RemoveLocalInventories operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveLocalInventories][] method. +message RemoveLocalInventoriesMetadata {} + +// Response of the [RemoveLocalInventories][] API. Currently empty because +// there is no meaningful response populated from the [RemoveLocalInventories][] +// method. +message RemoveLocalInventoriesResponse {} + +// Request message for [RemoveFulfillmentPlaces][] method. +message RemoveFulfillmentPlacesRequest { + // Required. Full resource name of + // [Product][google.cloud.retail.v2beta.Product], such as + // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + // + // If the caller does not have permission to access the + // [Product][google.cloud.retail.v2beta.Product], regardless of whether or not + // it exists, a PERMISSION_DENIED error is returned. + string product = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; + + // Required. The fulfillment type, including commonly used types (such as + // pickup in store and same day delivery), and custom types. + // + // Supported values: + // + // * "pickup-in-store" + // * "ship-to-store" + // * "same-day-delivery" + // * "next-day-delivery" + // * "custom-type-1" + // * "custom-type-2" + // * "custom-type-3" + // * "custom-type-4" + // * "custom-type-5" + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + // + // This field directly corresponds to [Product.fulfillment_info.type][]. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IDs for this + // [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type], + // such as the store IDs for "pickup-in-store" or the region IDs for + // "same-day-delivery", to be removed for this + // [type][google.cloud.retail.v2beta.RemoveFulfillmentPlacesRequest.type]. + // + // At least 1 value is required, and a maximum of 2000 values are allowed. + // Each value must be a string with a length limit of 10 characters, matching + // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + // INVALID_ARGUMENT error is returned. + repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED]; + + // The time when the fulfillment updates are issued, used to prevent + // out-of-order updates on fulfillment information. If not provided, the + // internal system time will be used. + google.protobuf.Timestamp remove_time = 4; + + // If set to true, and the [Product][google.cloud.retail.v2beta.Product] is + // not found, the fulfillment information will still be processed and retained + // for at most 1 day and processed once the + // [Product][google.cloud.retail.v2beta.Product] is created. If set to false, + // a NOT_FOUND error is returned if the + // [Product][google.cloud.retail.v2beta.Product] is not found. + bool allow_missing = 5; +} + +// Metadata related to the progress of the RemoveFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated from the +// [RemoveFulfillmentPlaces][] method. +message RemoveFulfillmentPlacesMetadata {} + +// Response of the RemoveFulfillmentPlacesRequest. Currently empty because there +// is no meaningful response populated from the [RemoveFulfillmentPlaces][] +// method. +message RemoveFulfillmentPlacesResponse {} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/promotion.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/promotion.proto new file mode 100644 index 00000000..5346f14d --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/promotion.proto @@ -0,0 +1,40 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +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 = "PromotionProto"; +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"; + +// Promotion information. +message Promotion { + // ID of the promotion. For example, "free gift". + // + // The value must be a UTF-8 encoded string with a length limit of 128 + // characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + // returned. + // + // Google Merchant Center property + // [promotion](https://support.google.com/merchants/answer/7050148). + string promotion_id = 1; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/purge_config.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/purge_config.proto new file mode 100644 index 00000000..5ab09aa3 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/purge_config.proto @@ -0,0 +1,80 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.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 = "PurgeConfigProto"; +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 related to the progress of the Purge operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeMetadata {} + +// Request message for PurgeUserEvents method. +message PurgeUserEventsRequest { + // Required. The resource name of the catalog under which the events are + // created. The format is + // `projects/${projectId}/locations/global/catalogs/${catalogId}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The filter string to specify the events to be deleted with a + // length limit of 5,000 characters. Empty string filter is not allowed. The + // eligible fields for filtering are: + // + // * `eventType`: Double quoted + // [UserEvent.event_type][google.cloud.retail.v2beta.UserEvent.event_type] + // string. + // * `eventTime`: in ISO 8601 "zulu" format. + // * `visitorId`: Double quoted string. Specifying this will delete all + // events associated with a visitor. + // * `userId`: Double quoted string. Specifying this will delete all events + // associated with a user. + // + // Examples: + // + // * Deleting all events in a time range: + // `eventTime > "2012-04-23T18:25:43.511Z" + // eventTime < "2012-04-23T18:30:43.511Z"` + // * Deleting specific eventType in time range: + // `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + // * Deleting all events for a specific visitor: + // `visitorId = "visitor1024"` + // + // The filtering fields are assumed to have an implicit AND. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually perform the purge. + // If `force` is set to false, the method will return the expected purge count + // without deleting any user events. + bool force = 3; +} + +// Response of the PurgeUserEventsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeUserEventsResponse { + // The total count of events purged as a result of the operation. + int64 purged_events_count = 1; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto new file mode 100644 index 00000000..b8b2156a --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto @@ -0,0 +1,791 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/product.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.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 = "SearchServiceProto"; +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 search. +// +// This feature is only available for users who have Retail Search enabled. +// Please 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) = + "https://www.googleapis.com/auth/cloud-platform"; + + // 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. + rpc Search(SearchRequest) returns (SearchResponse) { + option (google.api.http) = { + post: "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" + body: "*" + }; + } +} + +// Request message for +// [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] +// method. +message SearchRequest { + // A facet specification to perform faceted search. + message FacetSpec { + // Specifies how a facet is computed. + message FacetKey { + // Required. Supported textual and numerical facet keys in + // [Product][google.cloud.retail.v2beta.Product] object, over which the + // facet values are computed. Facet key is case-sensitive. + // + // Allowed facet keys when + // [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query] + // is not specified: + // + // * textual_field = + // * "brands" + // * "categories" + // * "genders" + // * "ageGroups" + // * "availability" + // * "colorFamilies" + // * "colors" + // * "sizes" + // * "materials" + // * "patterns" + // * "conditions" + // * "attributes.key" + // * "pickupInStore" + // * "shipToStore" + // * "sameDayDelivery" + // * "nextDayDelivery" + // * "customFulfillment1" + // * "customFulfillment2" + // * "customFulfillment3" + // * "customFulfillment4" + // * "customFulfillment5" + // * "inventory(place_id,attributes.key)" + // + // * numerical_field = + // * "price" + // * "discount" + // * "rating" + // * "ratingCount" + // * "attributes.key" + // * "inventory(place_id,price)" + // * "inventory(place_id,original_price)" + // * "inventory(place_id,attributes.key)" + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Set only if values should be bucketized into intervals. Must be set + // for facets with numerical values. Must not be set for facet with text + // values. Maximum number of intervals is 30. + repeated Interval intervals = 2; + + // Only get facet for the given restricted values. For example, when using + // "pickupInStore" as key and set restricted values to + // ["store123", "store456"], only facets for "store123" and "store456" are + // returned. Only supported on textual fields and fulfillments. + // Maximum is 20. + // + // Must be set for the fulfillment facet keys: + // + // * pickupInStore + // + // * shipToStore + // + // * sameDayDelivery + // + // * nextDayDelivery + // + // * customFulfillment1 + // + // * customFulfillment2 + // + // * customFulfillment3 + // + // * customFulfillment4 + // + // * customFulfillment5 + repeated string restricted_values = 3; + + // Only get facet values that start with the given string prefix. For + // example, suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // Only supported on textual fields. Maximum is 10. + repeated string prefixes = 8; + + // Only get facet values that contains the given strings. For example, + // suppose "categories" has three values "Women > Shoe", + // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // Only supported on textual fields. Maximum is 10. + repeated string contains = 9; + + // The order in which [Facet.values][] are returned. + // + // Allowed values are: + // + // * "count desc", which means order by [Facet.FacetValue.count][] + // descending. + // + // * "value desc", which means order by [Facet.FacetValue.value][] + // descending. + // Only applies to textual facets. + // + // If not set, textual values are sorted in [natural + // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + // intervals are sorted in the order given by + // [FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals]; + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // are sorted in the order given by + // [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.restricted_values]. + string order_by = 4; + + // The query that is used to compute facet for the given facet key. + // When provided, it will override the default behavior of facet + // computation. The query syntax is the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] + // for detail syntax and limitations. Notice that there is no limitation + // on + // [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key] + // when query is specified. + // + // In the response, [FacetValue.value][] will be always "1" and + // [FacetValue.count][] will be the number of results that matches the + // query. + // + // For example, you can set a customized facet for "shipToStore", + // where + // [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key] + // is "customizedShipToStore", and + // [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query] + // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + // Then the facet will count the products that are both in stock and ship + // to store "123". + string query = 5; + } + + // Required. The facet key specification. + FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Maximum of facet values that should be returned for this facet. If + // unspecified, defaults to 20. The maximum allowed value is 300. Values + // above 300 will be coerced to 300. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 limit = 2; + + // List of keys to exclude when faceting. + // + // By default, + // [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key] + // is not excluded from the filter unless it is listed in this field. + // + // For example, suppose there are 100 products with color facet "Red" and + // 200 products with color facet "Blue". A query containing the filter + // "colorFamilies:ANY("Red")" and have "colorFamilies" as + // [FacetKey.key][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.key] + // will by default return the "Red" with count 100. + // + // If this field contains "colorFamilies", then the query returns both the + // "Red" with count 100 and "Blue" with count 200, because the + // "colorFamilies" key is now excluded from the filter. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated string excluded_filter_keys = 3; + + // Enables dynamic position for this facet. If set to true, the position of + // this facet among all facets in the response is determined by Google + // Retail Search. It will be ordered together with dynamic facets if dynamic + // facets is enabled. If set to false, the position of this facet in the + // response will be the same as in the request, and it will be ranked before + // the facets with dynamic position enable and all dynamic facets. + // + // For example, you may always want to have rating facet returned in + // the response, but it's not necessarily to always display the rating facet + // at the top. In that case, you can set enable_dynamic_position to true so + // that the position of rating facet in response will be determined by + // Google Retail Search. + // + // Another example, assuming you have the following facets in the request: + // + // * "rating", enable_dynamic_position = true + // + // * "price", enable_dynamic_position = false + // + // * "brands", enable_dynamic_position = false + // + // And also you have a dynamic facets enable, which will generate a facet + // 'gender'. Then the final order of the facets in the response can be + // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + // "rating") depends on how Google Retail Search orders "gender" and + // "rating" facets. However, notice that "price" and "brands" will always be + // ranked at 1st and 2nd position since their enable_dynamic_position are + // false. + bool enable_dynamic_position = 4; + } + + // The specifications of dynamically generated facets. + message DynamicFacetSpec { + // Enum to control DynamicFacet mode + enum Mode { + // Default value. + MODE_UNSPECIFIED = 0; + + // Disable Dynamic Facet. + DISABLED = 1; + + // Automatic mode built by Google Retail Search. + ENABLED = 2; + } + + // Mode of the DynamicFacet feature. + // Defaults to + // [Mode.DISABLED][google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode.DISABLED] + // if it's unset. + Mode mode = 1; + } + + // Boost specification to boost certain items. + message BoostSpec { + // Boost applies to products which match a condition. + message ConditionBoostSpec { + // An expression which specifies a boost condition. The syntax and + // supported fields are the same as a filter expression. See + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] + // for detail syntax and limitations. + // + // Examples: + // + // * To boost products with product ID "product_1" or "product_2", and + // color + // "Red" or "Blue": + // * (id: ANY("product_1", "product_2")) AND (colorFamilies: + // ANY("Red","Blue")) + string condition = 1; + + // Strength of the condition boost, which should be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the item a big promotion. However, it does not + // necessarily mean that the boosted item will be the top result at all + // times, nor that other items will be excluded. Results could still be + // shown even when none of them matches the condition. And results that + // are significantly more relevant to the search query can still trump + // your heavily favored but irrelevant items. + // + // Setting to -1.0 gives the item a big demotion. However, results that + // are deeply relevant might still be shown. The item will have an + // upstream battle to get a fairly high ranking, but it is not blocked out + // completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2; + } + + // Condition boost specifications. If a product matches multiple conditions + // in the specifictions, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 10. + repeated ConditionBoostSpec condition_boost_specs = 1; + + // Whether to skip boostspec validation. If this field is set to true, + // invalid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // will be ignored and valid + // [BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // will still be applied. + optional bool skip_boost_spec_validation = 2; + } + + // Specification to determine under which conditions query expansion should + // occur. + message QueryExpansionSpec { + // Enum describing under which condition query expansion should occur. + enum Condition { + // Unspecified query expansion condition. This defaults to + // [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + CONDITION_UNSPECIFIED = 0; + + // Disabled query expansion. Only the exact search query is used, even if + // [SearchResponse.total_size][google.cloud.retail.v2beta.SearchResponse.total_size] + // is zero. + DISABLED = 1; + + // Automatic query expansion built by Google Retail Search. + AUTO = 3; + } + + // The condition under which query expansion should occur. Default to + // [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + Condition condition = 1; + + // Whether to pin unexpanded results. If this field is set to true, + // unexpanded products are always at the top of the search results, followed + // by the expanded results. + bool pin_unexpanded_results = 2; + } + + // The specification for personalization. + message PersonalizationSpec { + // The personalization mode of each search request. + enum Mode { + // Default value. Defaults to + // [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Let CRS decide whether to use personalization. + AUTO = 1; + + // Disable personalization. + DISABLED = 2; + } + + // Defaults to + // [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO]. + Mode mode = 1; + } + + // 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. + 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 + // [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs] + // or + // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec] + // is set. + PRODUCT_SEARCH_ONLY = 1; + + // Only faceted search will be performed. The product search will be + // disabled. + // + // When in this mode, one or both of [SearchRequest.facet_spec][] 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] + // will not be returned. + FACETED_SEARCH_ONLY = 2; + } + + // Required. The resource name of the search engine placement, such as + // `projects/*/locations/global/catalogs/default_catalog/placements/default_search` + // This field is used to identify the serving configuration name and the set + // of models that will be used to make the search. + string placement = 1 [(google.api.field_behavior) = REQUIRED]; + + // The branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. + // + // Use "default_branch" as the branch ID or leave this field empty, to search + // products under the default branch. + string branch = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Raw search query. + string query = 3; + + // Required. A unique identifier for tracking visitors. For example, this + // could be implemented with an HTTP cookie, which should be able to uniquely + // identify a visitor on a single device. This unique identifier should not + // change if the visitor logs in or out of the website. + // + // This should be the same identifier as + // [UserEvent.visitor_id][google.cloud.retail.v2beta.UserEvent.visitor_id]. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string visitor_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // User information. + UserInfo user_info = 5; + + // Maximum number of [Product][google.cloud.retail.v2beta.Product]s to return. + // If unspecified, defaults to a reasonable value. The maximum allowed value + // is 120. Values above 120 will be coerced to 120. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 page_size = 7; + + // A page token + // [SearchResponse.next_page_token][google.cloud.retail.v2beta.SearchResponse.next_page_token], + // received from a previous + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] + // must match the call that provided the page token. Otherwise, an + // INVALID_ARGUMENT error is returned. + string page_token = 8; + + // A 0-indexed integer that specifies the current offset (that is, starting + // result location, amongst the [Product][google.cloud.retail.v2beta.Product]s + // deemed by the API as relevant) in search results. This field is only + // considered if + // [page_token][google.cloud.retail.v2beta.SearchRequest.page_token] is unset. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + int32 offset = 9; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. Filter + // expression is case-sensitive. See more details at this [user + // guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string filter = 10; + + // The default filter that is applied when a user performs a search without + // checking any filters on the search page. + // + // The filter applied to every search request when quality improvement such as + // query expansion is needed. For example, if a query does not have enough + // results, an expanded query with + // [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter] + // will be returned as a supplement of the original query. This field is + // strongly recommended to achieve high search quality. + // + // See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] + // for more details about filter syntax. + string canonical_filter = 28; + + // The order in which products are returned. Products can be ordered by + // a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave + // it unset if ordered by relevance. OrderBy expression is case-sensitive. See + // more details at this [user + // guide](https://cloud.google.com/retail/docs/filter-and-order#order). + // + // If this field is unrecognizable, an INVALID_ARGUMENT is returned. + string order_by = 11; + + // Facet specifications for faceted search. If empty, no facets are returned. + // + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + repeated FacetSpec facet_specs = 12; + + // Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + // to enable dynamic facets. Do not set this field. + // + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; + + // Boost specification to boost certain products. See more details at this + // [user guide](https://cloud.google.com/retail/docs/boosting). + // + // Notice that if both + // [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids] + // and [SearchRequest.boost_spec] are set, the boost conditions from both + // places are evaluated. If a search request matches multiple boost + // conditions, the final boost score is equal to the sum of the boost scores + // from all matched boost conditions. + BoostSpec boost_spec = 13; + + // The query expansion specification that specifies the conditions under which + // query expansion will occur. See more details at this [user + // guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + QueryExpansionSpec query_expansion_spec = 14; + + // The keys to fetch and rollup the matching + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s attributes, + // [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo] or + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s attributes. + // The attributes from all the matching + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s or + // [LocalInventory][google.cloud.retail.v2beta.LocalInventory]s are merged and + // de-duplicated. Notice that rollup attributes will lead to extra query + // latency. Maximum number of keys is 30. + // + // For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], a + // fulfillment type and a fulfillment ID must be provided in the format of + // "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + // "pickupInStore" is fulfillment type and "store123" is the store ID. + // + // Supported keys are: + // + // * colorFamilies + // * price + // * originalPrice + // * discount + // * variantId + // * inventory(place_id,price) + // * inventory(place_id,original_price) + // * inventory(place_id,attributes.key), where key is any key in the + // [Product.inventories.attributes][] map. + // * attributes.key, where key is any key in the + // [Product.attributes][google.cloud.retail.v2beta.Product.attributes] map. + // * pickupInStore.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "pickup-in-store". + // * shipToStore.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "ship-to-store". + // * sameDayDelivery.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "same-day-delivery". + // * nextDayDelivery.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "next-day-delivery". + // * customFulfillment1.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "custom-type-1". + // * customFulfillment2.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "custom-type-2". + // * customFulfillment3.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "custom-type-3". + // * customFulfillment4.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "custom-type-4". + // * customFulfillment5.id, where id is any + // [FulfillmentInfo.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids] + // for [FulfillmentInfo.type][google.cloud.retail.v2beta.FulfillmentInfo.type] + // "custom-type-5". + // + // If this field is set to an invalid value other than these, an + // INVALID_ARGUMENT error is returned. + repeated string variant_rollup_keys = 17; + + // The categories associated with a category page. Required for category + // navigation queries to achieve good search quality. The format should be + // 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 + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + repeated string page_categories = 23; + + // The search mode of the search request. If not specified, a single search + // request triggers both product search and faceted search. + SearchMode search_mode = 31; + + // The specification for personalization. + PersonalizationSpec personalization_spec = 32; +} + +// Response message for +// [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] +// method. +message SearchResponse { + // Represents the search results. + message SearchResult { + // [Product.id][google.cloud.retail.v2beta.Product.id] of the searched + // [Product][google.cloud.retail.v2beta.Product]. + string id = 1; + + // The product data snippet in the search response. Only + // [Product.name][google.cloud.retail.v2beta.Product.name] is guaranteed to + // be populated. + // + // [Product.variants][google.cloud.retail.v2beta.Product.variants] contains + // the product variants that match the search query. If there are multiple + // product variants matching the query, top 5 most relevant product variants + // are returned and ordered by relevancy. + // + // If relevancy can be deternmined, use + // [matching_variant_fields][google.cloud.retail.v2beta.SearchResponse.SearchResult.matching_variant_fields] + // to look up matched product variants fields. If relevancy cannot be + // determined, e.g. when searching "shoe" all products in a shoe product can + // be a match, 5 product variants are returned but order is meaningless. + Product product = 2; + + // The count of matched + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product]s. + int32 matching_variant_count = 3; + + // If a [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product] matches the search query, + // this map indicates which [Product][google.cloud.retail.v2beta.Product] + // fields are matched. The key is the + // [Product.name][google.cloud.retail.v2beta.Product.name], the value is a + // field mask of the matched [Product][google.cloud.retail.v2beta.Product] + // fields. If matched attributes cannot be determined, this map will be + // empty. + // + // For example, a key "sku1" with field mask + // "products.color_info" indicates there is a match between + // "sku1" [ColorInfo][google.cloud.retail.v2beta.ColorInfo] and the query. + map matching_variant_fields = 4; + + // The rollup matching + // [variant][google.cloud.retail.v2beta.Product.Type.VARIANT] + // [Product][google.cloud.retail.v2beta.Product] attributes. The key is one + // of the + // [SearchRequest.variant_rollup_keys][google.cloud.retail.v2beta.SearchRequest.variant_rollup_keys]. + // The values are the merged and de-duplicated + // [Product][google.cloud.retail.v2beta.Product] attributes. Notice that the + // rollup values are respect filter. For example, when filtering by + // "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + // returned. + // + // For textual and numerical attributes, the rollup values is a list of + // string or double values with type + // [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if + // there are two variants with colors "red" and "blue", the rollup values + // are + // + // { key: "colorFamilies" + // value { + // list_value { + // values { string_value: "red" } + // values { string_value: "blue" } + // } + // } + // } + // + // For [FulfillmentInfo][google.cloud.retail.v2beta.FulfillmentInfo], the + // rollup values is a double value with type + // [google.protobuf.Value][google.protobuf.Value]. For example, + // `{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; + } + + // A facet result. + message Facet { + // A facet value which contains value names and their count. + message FacetValue { + // A facet value which contains values. + oneof facet_value { + // Text value of a facet, such as "Black" for facet "colorFamilies". + string value = 1; + + // Interval value for a facet, such as [10, 20) for facet "price". + Interval interval = 2; + } + + // Number of items that have this facet value. + int64 count = 3; + } + + // The key for this facet. E.g., "colorFamilies" or "price" or + // "attributes.attr1". + string key = 1; + + // The facet values for this field. + repeated FacetValue values = 2; + + // Whether the facet is dynamically generated. + bool dynamic_facet = 3; + } + + // Information describing query expansion including whether expansion has + // occurred. + message QueryExpansionInfo { + // Bool describing whether query expansion has occurred. + bool expanded_query = 1; + + // Number of pinned results. This field will only be set when expansion + // happens and + // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + // is set to true. + int64 pinned_result_count = 2; + } + + // A list of matched items. The order represents the ranking. + repeated SearchResult results = 1; + + // Results of facets requested by user. + repeated Facet facets = 2; + + // The estimated total count of matched items irrespective of pagination. The + // count of [results][google.cloud.retail.v2beta.SearchResponse.results] + // returned by pagination may be less than the + // [total_size][google.cloud.retail.v2beta.SearchResponse.total_size] that + // matches. + int32 total_size = 3; + + // If spell correction applies, the corrected query. Otherwise, empty. + string corrected_query = 4; + + // A unique search token. This should be included in the + // [UserEvent][google.cloud.retail.v2beta.UserEvent] logs resulting from this + // search, which enables accurate attribution of search model performance. + string attribution_token = 5; + + // A token that can be sent as + // [SearchRequest.page_token][google.cloud.retail.v2beta.SearchRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 6; + + // Query expansion information for the returned results. + QueryExpansionInfo query_expansion_info = 7; + + // The URI of a customer-defined redirect page. If redirect action is + // triggered, no search will be performed, and only + // [redirect_uri][google.cloud.retail.v2beta.SearchResponse.redirect_uri] and + // [attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token] + // will be set in the response. + string redirect_uri = 10; + + // The fully qualified resource name of applied + // [controls](https://cloud.google.com/retail/docs/serving-control-rules). + repeated string applied_controls = 12; + + // The invalid + // [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2beta.SearchRequest.BoostSpec.condition_boost_specs] + // that are not applied during serving. + repeated SearchRequest.BoostSpec.ConditionBoostSpec + invalid_condition_boost_specs = 14; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto new file mode 100644 index 00000000..20112e61 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto @@ -0,0 +1,247 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/search_service.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 = "ServingConfigProto"; +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"; + +// 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}" + }; + + // Immutable. Fully qualified name + // projects/*/locations/global/catalogs/*/servingConfig/* + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The human readable serving config display name. Used in Retail + // UI. + // + // This field must be a UTF-8 encoded string with a length limit of 128 + // 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. + // 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. + // others-you-may-like CTR to others-you-may-like CVR). + // + // Required when + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string model_id = 3; + + // How much price ranking we want in serving results. + // Price reranking causes product items with a similar + // recommendation probability to be ordered by price, with the + // 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' + // + // If not specified, we choose default based on model type. Default value: + // 'no-price-reranking'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string price_reranking_level = 4; + + // Facet specifications for faceted search. If empty, no facets are returned. + // The ids refer to the ids of [Control][google.cloud.retail.v2beta.Control] + // resources with only the Facet control set. These controls are assumed to be + // in the same [Catalog][google.cloud.retail.v2beta.Catalog] as the + // [ServingConfig][google.cloud.retail.v2beta.ServingConfig]. + // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + // is returned. + // + // 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]. + repeated string facet_control_ids = 5; + + // The specification for dynamically generated facets. Notice that only + // textual facets can be dynamically generated. + // + // 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]. + SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6; + + // Condition boost specifications. If a product matches multiple conditions + // in the specifications, boost scores from these specifications are all + // applied and combined in a non-linear way. Maximum number of + // specifications is 100. + // + // Notice that if both + // [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids] + // and [SearchRequest.boost_spec] are set, the boost conditions from both + // places are evaluated. If a search request matches multiple boost + // conditions, the final boost score is equal to the sum of the boost scores + // from all matched boost conditions. + // + // 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]. + repeated string boost_control_ids = 7; + + // Condition filter specifications. If a product matches multiple conditions + // in the specifications, filters from these specifications are all + // applied and combined via the AND operator. Maximum number of + // specifications is 100. + // + // 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]. + repeated string filter_control_ids = 9; + + // Condition redirect specifications. Only the first triggered redirect action + // is applied, even if multiple apply. Maximum number of specifications is + // 1000. + // + // 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]. + repeated string redirect_control_ids = 10; + + // Condition synonyms specifications. If multiple syonyms conditions match, + // all matching synonyms control in the list will execute. Order of controls + // in the list will not matter. Maximum number of specifications is + // 100. + // + // 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]. + repeated string twoway_synonyms_control_ids = 18; + + // Condition oneway synonyms specifications. If multiple oneway synonyms + // conditions match, all matching oneway synonyms controls in the list will + // execute. Order of controls in the list will not matter. Maximum number of + // specifications is 100. + // + // 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]. + repeated string oneway_synonyms_control_ids = 12; + + // Condition do not associate specifications. If multiple do not associate + // conditions match, all matching do not associate controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // 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]. + repeated string do_not_associate_control_ids = 13; + + // Condition replacement specifications. + // - Applied according to the order in the list. + // - A previously replaced term can not be re-replaced. + // - Maximum number of specifications is 100. + // + // 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]. + repeated string replacement_control_ids = 14; + + // Condition ignore specifications. If multiple ignore + // conditions match, all matching ignore controls in the list will + // execute. + // - Order does not matter. + // - Maximum number of specifications is 100. + // + // 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]. + 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: + // + // * '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'. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [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. + // If not specified, we enable it by default. + // Allowed values are: + // + // * '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 + // 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). + // + // Can only be set if + // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + string enable_category_filter_level = 16; + + // 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 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto new file mode 100644 index 00000000..e56c28ac --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto @@ -0,0 +1,240 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/serving_config.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 = "ServingConfigServiceProto"; +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 modifying ServingConfig. +service ServingConfigService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a ServingConfig. + // + // A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s + // are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise + // a FAILED_PRECONDITION error is returned. + rpc CreateServingConfig(CreateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + body: "serving_config" + }; + option (google.api.method_signature) = + "parent,serving_config,serving_config_id"; + } + + // Deletes a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc DeleteServingConfig(DeleteServingConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a ServingConfig. + rpc UpdateServingConfig(UpdateServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + patch: "/v2beta/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + body: "serving_config" + }; + option (google.api.method_signature) = "serving_config,update_mask"; + } + + // Gets a ServingConfig. + // + // Returns a NotFound error if the ServingConfig does not exist. + rpc GetServingConfig(GetServingConfigRequest) returns (ServingConfig) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all ServingConfigs linked to this catalog. + rpc ListServingConfigs(ListServingConfigsRequest) + returns (ListServingConfigsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/servingConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Enables a Control on the specified ServingConfig. + // The control is added in the last position of the list of controls + // it belongs to (e.g. if it's a facet spec control it will be applied + // in the last position of servingConfig.facetSpecIds) + // Returns a ALREADY_EXISTS error if the control has already been applied. + // Returns a FAILED_PRECONDITION error if the addition could exceed maximum + // number of control allowed for that type of control. + rpc AddControl(AddControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } + + // Disables a Control on the specified ServingConfig. + // The control is removed from the ServingConfig. + // Returns a NOT_FOUND error if the Control is not enabled for the + // ServingConfig. + rpc RemoveControl(RemoveControlRequest) returns (ServingConfig) { + option (google.api.http) = { + post: "/v2beta/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl" + body: "*" + }; + option (google.api.method_signature) = "serving_config"; + } +} + +// Request for CreateServingConfig method. +message CreateServingConfigRequest { + // Required. Full resource name of parent. 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 ServingConfig to create. + ServingConfig serving_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the ServingConfig, which will become the final + // component of the ServingConfig's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-_/. + string serving_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateServingConfig method. +message UpdateServingConfigRequest { + // Required. The ServingConfig to update. + ServingConfig serving_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [ServingConfig][google.cloud.retail.v2beta.ServingConfig] to update. The + // following are NOT supported: + // + // * [ServingConfig.name][google.cloud.retail.v2beta.ServingConfig.name] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; +} + +// Request for ListServingConfigs method. +message ListServingConfigsRequest { + // Required. The catalog resource name. 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 100. If a value greater than 100 is provided, at most 100 results are + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListServingConfigs` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListServingConfigs method. +message ListServingConfigsResponse { + // All the ServingConfigs for a given catalog. + repeated ServingConfig serving_configs = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // Required. The id of the control to apply. Assumed to be in the same catalog + // as the serving config - if id is not found a NOT_FOUND error is returned. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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} + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/ServingConfig" + } + ]; + + // Required. The id of the control to apply. Assumed to be in the same catalog + // as the serving config. + string control_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto new file mode 100644 index 00000000..e2175801 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto @@ -0,0 +1,342 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/retail/v2beta/common.proto"; +import "google/cloud/retail/v2beta/product.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.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 = "UserEventProto"; +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"; + +// UserEvent captures all metadata information Retail API needs to know about +// how end users interact with customers' website. +message UserEvent { + // Required. User event type. Allowed values are: + // + // * `add-to-cart`: Products being added to cart. + // * `category-page-view`: Special pages such as sale or promotion pages + // viewed. + // * `detail-page-view`: Products detail page viewed. + // * `home-page-view`: Homepage viewed. + // * `promotion-offered`: Promotion is offered to a user. + // * `promotion-not-offered`: Promotion is not offered to a user. + // * `purchase-complete`: User finishing a purchase. + // * `search`: Product search. + // * `shopping-cart-page-view`: User viewing a shopping cart. + string event_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A unique identifier for tracking visitors. + // + // For example, this could be implemented with an HTTP cookie, which should be + // able to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor log in/out of the website. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // The field should not contain PII or user-data. We recommend to use Google + // Analystics [Client + // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + string visitor_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique identifier for tracking a visitor session with a length limit of + // 128 bytes. A session is an aggregation of an end user behavior in a time + // span. + // + // A general guideline to populate the sesion_id: + // 1. If user has no activity for 30 min, a new session_id should be assigned. + // 2. The session_id should be unique across users, suggest use uuid or add + // visitor_id as prefix. + string session_id = 21; + + // Only required for + // [UserEventService.ImportUserEvents][google.cloud.retail.v2beta.UserEventService.ImportUserEvents] + // method. Timestamp of when the user event happened. + google.protobuf.Timestamp event_time = 3; + + // A list of identifiers for the independent experiment groups this user event + // belongs to. This is used to distinguish between user events associated with + // different experiment setups (e.g. using Retail API, using different + // recommendation models). + repeated string experiment_ids = 4; + + // Highly recommended for user events that are the result of + // [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict]. + // This field enables accurate attribution of recommendation model + // performance. + // + // The value must be a valid + // [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token] + // for user events that are the result of + // [PredictionService.Predict][google.cloud.retail.v2beta.PredictionService.Predict]. + // The value must be a valid + // [SearchResponse.attribution_token][google.cloud.retail.v2beta.SearchResponse.attribution_token] + // for user events that are the result of + // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. + // + // This token enables us to accurately attribute page view or purchase back to + // the event and the particular predict response containing this + // clicked/purchased product. If user clicks on product K in the + // recommendation results, pass + // [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token] + // as a URL parameter to product K's page. When recording events on product + // K's page, log the + // [PredictResponse.attribution_token][google.cloud.retail.v2beta.PredictResponse.attribution_token] + // to this field. + string attribution_token = 5; + + // The main product details related to the event. + // + // This field is required for the following event types: + // + // * `add-to-cart` + // * `detail-page-view` + // * `purchase-complete` + // * `search` + // + // In a `search` event, this field represents the products returned to the end + // user on the current page (the end user may have not finished browsing the + // whole page yet). When a new page is returned to the end user, after + // pagination/filtering/ordering even for the same query, a new `search` event + // with different + // [product_details][google.cloud.retail.v2beta.UserEvent.product_details] is + // desired. The end user may have not finished browsing the whole page yet. + repeated ProductDetail product_details = 6; + + // The main auto-completion details related to the event. + // + // This field should be set for `search` event when autocomplete function is + // enabled and the user clicks a suggestion for search. + CompletionDetail completion_detail = 22; + + // Extra user event features to include in the recommendation model. + // + // If you provide custom attributes for ingested user events, also include + // them in the user events that you associate with prediction requests. Custom + // attribute formatting must be consistent between imported events and events + // provided with prediction requests. This lets the Retail API use + // those custom attributes when training models and serving predictions, which + // helps improve recommendation quality. + // + // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + // error is returned: + // + // * The key must be a UTF-8 encoded string with a length limit of 5,000 + // characters. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 256 characters. + // * For number attributes, at most 400 values are allowed. + // + // For product recommendations, an example of extra user information is + // traffic_channel, which is how a user arrives at the site. Users can arrive + // at the site by coming to the site directly, coming through Google + // search, or in other ways. + map attributes = 7; + + // The ID or name of the associated shopping cart. This ID is used + // to associate multiple items added or present in the cart before purchase. + // + // This can only be set for `add-to-cart`, `purchase-complete`, or + // `shopping-cart-page-view` events. + string cart_id = 8; + + // A transaction represents the entire purchase transaction. + // + // Required for `purchase-complete` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + PurchaseTransaction purchase_transaction = 9; + + // The user's search query. + // + // See [SearchRequest.query][google.cloud.retail.v2beta.SearchRequest.query] + // for definition. + // + // The value must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // At least one of + // [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + string search_query = 10; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the products being filtered. + // + // See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] + // for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string filter = 16; + + // The order in which products are returned. + // + // See + // [SearchRequest.order_by][google.cloud.retail.v2beta.SearchRequest.order_by] + // for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + string order_by = 17; + + // An integer that specifies the current offset for pagination (the 0-indexed + // starting location, amongst the products deemed by the API as relevant). + // + // See [SearchRequest.offset][google.cloud.retail.v2beta.SearchRequest.offset] + // for definition. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + int32 offset = 18; + + // 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 + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + // + // Required for `category-page-view` events. At least one of + // [search_query][google.cloud.retail.v2beta.UserEvent.search_query] or + // [page_categories][google.cloud.retail.v2beta.UserEvent.page_categories] is + // required for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + repeated string page_categories = 11; + + // User information. + UserInfo user_info = 12; + + // Complete URL (window.location.href) of the user's current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. Maximum length 5,000 + // characters. + string uri = 13; + + // The referrer URL of the current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. + string referrer_uri = 14; + + // A unique ID of a web page view. + // + // This should be kept the same for all user events triggered from the same + // pageview. For example, an item detail page view could trigger multiple + // events as the user is browsing the page. The `pageViewId` property should + // be kept the same for all these events so that they can be grouped together + // properly. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. + string page_view_id = 15; +} + +// Detailed product information associated with a user event. +message ProductDetail { + // Required. [Product][google.cloud.retail.v2beta.Product] information. + // + // Required field(s): + // + // * [Product.id][google.cloud.retail.v2beta.Product.id] + // + // Optional override field(s): + // + // * [Product.price_info][google.cloud.retail.v2beta.Product.price_info] + // + // If any supported optional fields are provided, we will treat them as a full + // override when looking up product information from the catalog. Thus, it is + // important to ensure that the overriding fields are accurate and + // complete. + // + // All other product fields are ignored and instead populated via catalog + // lookup after event ingestion. + Product product = 1 [(google.api.field_behavior) = REQUIRED]; + + // Quantity of the product associated with the user event. + // + // For example, this field will be 2 if two products are added to the shopping + // cart for `purchase-complete` event. Required for `add-to-cart` and + // `purchase-complete` event types. + google.protobuf.Int32Value quantity = 2; +} + +// Detailed completion information including completion attribution token and +// clicked completion info. +message CompletionDetail { + // Completion attribution token in + // [CompleteQueryResponse.attribution_token][google.cloud.retail.v2beta.CompleteQueryResponse.attribution_token]. + string completion_attribution_token = 1; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion]. + string selected_suggestion = 2; + + // End user selected + // [CompleteQueryResponse.CompletionResult.suggestion][google.cloud.retail.v2beta.CompleteQueryResponse.CompletionResult.suggestion] + // position, starting from 0. + int32 selected_position = 3; +} + +// A transaction represents the entire purchase transaction. +message PurchaseTransaction { + // The transaction ID with a length limit of 128 characters. + string id = 1; + + // Required. Total non-zero revenue or grand total associated with the + // transaction. This value include shipping, tax, or other adjustments to + // total revenue that you want to include as part of your revenue + // calculations. + float revenue = 2 [(google.api.field_behavior) = REQUIRED]; + + // All the taxes associated with the transaction. + float tax = 3; + + // All the costs associated with the products. These can be manufacturing + // costs, shipping expenses not borne by the end user, or any other costs, + // such that: + // + // * Profit = + // [revenue][google.cloud.retail.v2beta.PurchaseTransaction.revenue] - + // [tax][google.cloud.retail.v2beta.PurchaseTransaction.tax] - + // [cost][google.cloud.retail.v2beta.PurchaseTransaction.cost] + float cost = 4; + + // Required. Currency code. Use three-character ISO-4217 code. + string currency_code = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto new file mode 100644 index 00000000..ab7a0b35 --- /dev/null +++ b/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto @@ -0,0 +1,190 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/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"; +import "google/longrunning/operations.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 = "UserEventServiceProto"; +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 ingesting end user actions on the customer website. +service UserEventService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Writes a single user event. + rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:write" + body: "user_event" + }; + } + + // Writes a single user event from the browser. This uses a GET request to + // due to browser restriction of POST-ing to a 3rd party domain. + // + // This method is used only by the Retail API JavaScript pixel and Google Tag + // Manager. Users should not call this method directly. + rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect" + }; + } + + // Deletes permanently all user events specified by the filter provided. + // Depending on the number of events specified by the filter, this operation + // could take hours or days to complete. To test a filter, use the list + // command first. + rpc PurgeUserEvents(PurgeUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.PurgeUserEventsResponse" + metadata_type: "google.cloud.retail.v2beta.PurgeMetadata" + }; + } + + // 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. + rpc ImportUserEvents(ImportUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.ImportUserEventsResponse" + metadata_type: "google.cloud.retail.v2beta.ImportMetadata" + }; + } + + // 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. + rpc RejoinUserEvents(RejoinUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RejoinUserEventsResponse" + metadata_type: "RejoinUserEventsMetadata" + }; + } +} + +// Request message for WriteUserEvent method. +message WriteUserEventRequest { + // Required. The parent catalog resource name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. User event to write. + UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CollectUserEvent method. +message CollectUserEventRequest { + // Required. The parent catalog name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URL encoded UserEvent proto with a length limit of 2,000,000 + // characters. + string user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // The URL including cgi-parameters but excluding the hash fragment with a + // length limit of 5,000 characters. This is often more useful than the + // referer URL, because many browsers only send the domain for 3rd party + // requests. + string uri = 3; + + // The event timestamp in milliseconds. This prevents browser caching of + // otherwise identical get requests. The name is abbreviated to reduce the + // payload bytes. + int64 ets = 4; +} + +// Request message for RejoinUserEvents method. +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. + // 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. + enum UserEventRejoinScope { + // Rejoin all events with the latest product catalog, including both joined + // events and unjoined events. + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0; + + // Only rejoin joined events with the latest product catalog. + JOINED_EVENTS = 1; + + // Only rejoin unjoined events with the latest product catalog. + UNJOINED_EVENTS = 2; + } + + // Required. The parent catalog resource name, such as + // `projects/1234/locations/global/catalogs/default_catalog`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + UserEventRejoinScope user_event_rejoin_scope = 2; +} + +// 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. +message RejoinUserEventsMetadata {} diff --git a/versions.txt b/versions.txt index 45eb2724..69449d98 100644 --- a/versions.txt +++ b/versions.txt @@ -4,3 +4,7 @@ google-cloud-retail:2.1.0:2.1.1-SNAPSHOT grpc-google-cloud-retail-v2:2.1.0:2.1.1-SNAPSHOT proto-google-cloud-retail-v2:2.1.0:2.1.1-SNAPSHOT +proto-google-cloud-retail-v2alpha:2.1.0:2.1.1-SNAPSHOT +proto-google-cloud-retail-v2beta:2.1.0:2.1.1-SNAPSHOT +grpc-google-cloud-retail-v2alpha:2.1.0:2.1.1-SNAPSHOT +grpc-google-cloud-retail-v2beta:2.1.0:2.1.1-SNAPSHOT